> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ale.run/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Guide for how to authenticate with the ale CLI using email/password or API key

## Login

### Email / Password

<Steps>
  <Step title="Run the login command with your ale endpoint URL">
    ```bash theme={null}
    ale login <URL>
    # ale login https://app.ale-test.com/api
    ```
  </Step>

  <Step title="When your email and password match, you'll see the following message">
    ```bash theme={null}
    👉 Connecting to "https://app.ale-test.com/api"
    ? Email or username admin@ale-test.com
    ? Password [hidden]
    👋 Hello, admin / admin@ale-test.com
    ```
  </Step>
</Steps>

### API Key

<Steps>
  <Step title="Run the login command by providing the ale endpoint as a parameter and the API key as an option">
    ```bash theme={null}
    ale login <URL> -t [API key]
    # ale login https://app.ale-test.com/api
    ```
  </Step>

  <Step title="When authentication is successful, you'll see the following message">
    ```bash theme={null}
    👉 Connecting to "https://app.ale-test.com/api"
    👋 Hello, admin / admin@ale-test.com
    ```
  </Step>
</Steps>

## Check Current Session

<Steps>
  <Step title="Run this command in an environment where ale is already logged in">
    ```bash theme={null}
    ale whoami
    ```
  </Step>

  <Step title="Your current logged-in account will be displayed in the terminal">
    ```bash theme={null}
    admin@ale-test.com at https://app.ale-test.com/api
    ```
  </Step>
</Steps>

## Logout

<Steps>
  <Step title="Run the logout command">
    ```bash theme={null}
    ale logout
    ```
  </Step>

  <Step title="Confirm successful logout">
    ```bash theme={null}
    Logged out.
    ```
  </Step>
</Steps>
