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

# Sign in

> Connect the CLI to Kaneo Cloud or a self-hosted instance, use API keys in CI, and keep several logins.

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
kaneo login
```

The CLI shows a one-time code, copies it to your clipboard, and opens the approval page of your Kaneo web app. Approve the request there and the CLI saves the login. After signing in you can choose a default workspace. Pass `--no-browser` to print the link instead of opening a browser.

For a self-hosted instance, pass its address once. Later commands reuse it:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
kaneo login --api-url https://kaneo.example.com
```

`kaneo login` uses [device authorization](/docs/api-reference/authentication) with the `kaneo-cli` client ID, which self-hosted Kaneo allows by default. If you set `DEVICE_AUTH_CLIENT_IDS`, keep `kaneo-cli` in the list.

Check or end the session with:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
kaneo whoami
kaneo logout
```

## API keys for CI and scripts

Create a key in **Settings → Account → API Keys** and set it in the environment:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
export KANEO_API_KEY=your-key
kaneo task list -w your-workspace-id -p KAN
```

The CLI picks credentials in this order: `--token`, then `KANEO_API_KEY`, then the stored login. A stored login is only ever sent to the server it was created for. A few account-level actions need a signed-in session, and the CLI tells you when an API key cannot be used.

## Profiles

Each login is stored as a profile. The first one is called `default`. To keep a second server or account, sign in with another profile name:

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
kaneo login --profile work --api-url https://kaneo.example.com
kaneo profile list
kaneo profile use default
```

`kaneo login` and `kaneo profile use` make that profile the active one. To use a profile for a single command, pass `--profile work` or set `KANEO_PROFILE=work`. `kaneo profile rename` and `kaneo profile remove` manage the rest.


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