> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.

# Sessions

Log in to your AI Agent, check the session, and log out. Device login is the default. For its steps, see [Log in](/adacli/getting-started#log-in). This page covers the login without a browser, and the `status` command.

## Commands

| Command  | What it does                                                       |
| -------- | ------------------------------------------------------------------ |
| `login`  | Logs in with device login, or with an email and a password.        |
| `logout` | Removes the stored session for the AI Agent.                       |
| `status` | Shows if the session is valid and adacli can connect to the Agent. |

## Examples

Log in with an email and a password that adacli reads from stdin:

```bash
adacli acme login --email admin@example.com --password-stdin < ~/.ada-password
```

Log in with `ADACLI_EMAIL` and `ADACLI_PASSWORD` set in the environment:

```bash
adacli acme login
```

Check the session as JSON:

```bash
adacli acme status --json
```

Log out:

```bash
adacli acme logout
```

## Details

* adacli takes the email from `--email`, then from `ADACLI_EMAIL`. It takes the password from `--password-stdin` or `--password`, then from `ADACLI_PASSWORD`.
* If adacli finds an email and a password, it logs in without a browser. If it finds neither, it starts device login. If it finds only one, it exits with code `2`.
* `--password` shows the password in the process list. Use `--password-stdin` or `ADACLI_PASSWORD`.
* An SSO account and an account with MFA must use device login.
* `login --device-code <code>` gets a session from a device code that someone already approved. It opens no browser.
* `status` exits with code `0` when the session is valid. It exits with code `3` when you are not logged in or the session expired. When the check itself fails, for example because adacli cannot connect to the Ada service, `status` exits with the code of that failure, such as `8`. An AI assistant uses the exit code to check the login before it runs other commands.
* With `--json`, `status` writes its result to stdout, also when there is no working session: `not_logged_in` or `session_invalid`. It writes no error to stderr.
* `logout` does not log you out of the dashboard.

For every option of a command, run it with `--help`, for example `adacli acme login --help`.

## Related commands

* [`skills`](/adacli/commands/skills): install the skills that device login offers.
* [`session-tracking`](/adacli/commands/session-tracking): log the intent of an AI assistant.
* [`upgrade`](/adacli/commands/upgrade): check for a newer adacli release.

---

Have any questions? Contact your Ada team, or email us at [](mailto:help@ada.cx?subject=Help%20Docs%20inquiry).