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

# Sign in to the Olostep CLI

> Sign in with your Olostep account, check who you are, sign out, and use a token in CI.

The CLI signs in with your Olostep account, the same account you use on the [dashboard](https://www.olostep.com/dashboard). You don't need to paste an API key.

Most commands need you to be signed in. `--help`, `olostep help`, and `olostep feedback` don't.

## Sign in

```bash theme={null}
olostep login
```

Your browser opens the Olostep sign-in page. Sign in, and the CLI saves the sign-in on this computer. You stay signed in until you run `olostep logout`.

If you run a command that needs sign-in before you have signed in, the CLI shows `Please sign in to Olostep to continue.` with two choices, **Sign in** and **Exit**. Choose **Sign in** to open the browser; the command continues after you sign in.

## Check who you are

```bash theme={null}
olostep whoami
```

Prints your account, your team, the team's plan and its credit balance. `olostep whoami` is the same command as `olostep account info`.

```bash theme={null}
olostep whoami --json
```

## Sign out

```bash theme={null}
olostep logout
```

Olostep revokes this computer's connection, and the CLI forgets the saved sign-in. Other computers stay signed in.

## Scripts, CI and agents

A script or CI job can't complete a browser sign-in. Give it a token instead, with the `OLOSTEP_TOKEN` environment variable or the `--token` flag on any command:

```bash theme={null}
export OLOSTEP_TOKEN="<token>"
olostep credits balance --json
```

```bash theme={null}
olostep credits balance --json --token "<token>"
```

A token in `OLOSTEP_TOKEN` or `--token` is used instead of the saved sign-in.

When a command that needs sign-in runs without a terminal, or from a coding agent, and there is no sign-in or token, the CLI does not prompt. It prints this to stderr and exits with code `3`:

```text theme={null}
Please sign in to Olostep to continue. Run `olostep login` (or set OLOSTEP_TOKEN), then run this again.
```

Check for exit code `3` in scripts:

```bash theme={null}
olostep credits balance --json > balance.json
if [ $? -eq 3 ]; then
  echo "Sign in first: olostep login"
fi
```

See [Exit codes](https://docs.olostep.com/cli/usage.md#exit-codes) for every code.

## Where the sign-in is stored

The CLI keeps its sign-in in `~/.config/olostep` (or `$XDG_CONFIG_HOME/olostep` if you set `XDG_CONFIG_HOME`). The folder is readable only by your user.

## API keys

The CLI does not need an API key. Your code that calls the [Olostep API](https://docs.olostep.com/get-started/authentication.md) does. To put one of your keys into a `.env` file without printing it:

```bash theme={null}
olostep keys reveal <key> --write-env .env
```

This writes `OLOSTEP_API_KEY=...` to `.env`. See [`olostep keys reveal`](https://docs.olostep.com/cli/reference/account-billing#olostep-keys-reveal).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.