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

# Authentication and Workspaces

> Browser login, named contexts, and tokens for automation

Sign in to connect the CLI to your Beam workspace.

## Sign In

```bash theme={null}
beam login
beam whoami
beam status
```

Finish signing in or creating an account in your browser. On a remote machine, use `beam login --browserless` and open the printed link on another device.

Credentials are saved in `~/.beam/config.ini`.

## Named Contexts

Save credentials under a name and select that context when running commands:

```bash theme={null}
beam login --name production
beam --context production whoami
beam --context production deployment list
beam config list
```

Use `beam config select production` to change the default context, or `beam config create` to connect to a self-hosted gateway.

## CI and Server-side SDKs

Save an [API token](https://platform.beam.cloud/settings/api-keys) as `BEAM_TOKEN` in your CI secrets. The Python SDK and CLI use it for the default context:

```bash theme={null}
# BEAM_TOKEN is supplied by your CI secret store.
beam --no-input whoami
beam deploy app.py:handler --json
```

`--json` returns JSON and disables prompts. Check the exit status for failures.

For TypeScript, set `beamOpts.token` on the server. Keep tokens out of source control and browser code.

## Coding Agents

Run `beam setup agent` to connect your coding agent. It can guide you through browser login using the `login` and `login_status` tools. See [agent setup](/v2/getting-started/add-to-cursor-claude).
