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

# Authentication

export const AdminBadge = ({size = "md"}) => {
  return <Tooltip tip="Workspace owners and administrators can execute this action." cta="Workspace roles" href="/admin/users/access-control">
            <Badge icon="shield-check" color="blue" size={size}>admin</Badge>
        </Tooltip>;
};

The CLI supports two ways to authenticate: an interactive login for your development machine, and an API key for non-interactive use such as CI pipelines, scripts, and AI agents.

## Interactive login

To log in, run the `login` command.

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

Retrieve your authentication token from the [Secrets](https://app.mirurobotics.com/settings/cli-token) page. <AdminBadge />

<Frame>
  <img src="https://assets.mirurobotics.com/docs/v04/images/secrets/cli-token/page.png" style={{ borderRadius:"16px" }} />
</Frame>

Paste the token into the CLI.

```
Please retrieve your authentication token from the following URL:
🔗 https://app.mirurobotics.com/settings/cli-token

🔑 Paste your authentication token: **********

Validating authentication token...
✅ Successfully logged in as Benjamin
```

## API key

The `login` command prompts for a token, which makes it unsuitable for anything non-interactive. To authenticate without a prompt, export the `MIRU_API_KEY` environment variable instead.

```bash theme={null}
export MIRU_API_KEY=<your-api-key>
```

No `login` is required when `MIRU_API_KEY` is set.

To create an API key, follow the instructions in the [API keys](/admin/apikeys#create-an-api-key) section. To determine which scopes the key needs, find the command you want to run in the [CLI Reference](/references/cli/release-create) and consult its **API key scopes** section.

For using the CLI in a CI pipeline, see the [CI/CD guide](/developers/ci/overview).
