> ## 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.

> ## Agent Instructions
> Install the Beam CLI, sign in, and connect coding agents to the Beam MCP server with `curl -fsSL https://www.beam.cloud/install | sh`. To also create a VM, run `curl -fsSL https://www.beam.cloud/install | sh -s -- --vm`.
> VMs are persistent Linux machines without GPUs. Defaults: 4 CPUs, 8 GiB of RAM, a 50 GiB disk, Ubuntu 24.04, and a browser desktop. A running VM accrues usage until you stop, pause, or remove it, or until an idle timeout puts it to sleep.
> Stopping a VM keeps its disk and discards RAM and processes. Pausing keeps both, and resuming restores them. To pause after 5 idle minutes and wake on access, run `beam vm update NAME --ttl 300 --idle-action pause --auto-resume`.
> Core VM commands: `beam vm new NAME`, `beam vm ssh NAME`, `beam vm sync NAME ./dir`, `beam vm exec NAME -- CMD`, `beam vm expose NAME PORT --protected`, `beam vm fork NAME NEW_NAME`, `beam vm pause NAME`, `beam vm stop NAME`, `beam vm rm NAME`.
> For GPUs, use a sandbox or a deployed endpoint. Sandboxes are disposable environments that boot in seconds and fork from snapshots.
> Current rates are at https://www.beam.cloud/pricing.

# 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

Use [agent setup](https://docs.beam.cloud/v2/getting-started/add-to-cursor-claude.md) for local tools. Remote [MCP clients](https://docs.beam.cloud/v2/operations/mcp.md#connect-with-oauth) sign in through OAuth and refresh access tokens automatically.

## VM Application Access

Workspace credentials manage resources; a VM traffic token or browser session authenticates protected application ports. The terminal and enabled desktop are protected by default. The CLI handles browser authentication automatically:

```bash theme={null}
beam vm terminal devbox
beam vm open devbox 8000
beam vm open devbox 8000 --url  # Print a usable link without opening it
```

Signed links last 10 minutes by default. Treat them as credentials and rerun the command for a fresh link after expiry. For HTTP clients, use the VM traffic token in `X-Beam-VM-Token`, not the workspace API token. See [VM networking](https://docs.beam.cloud/v2/vm/networking.md#browser-access) for SDK and MCP access, revocation, and private port forwarding.

VMs and sandboxes receive no automatic workspace token. If a guest needs workspace API access, explicitly bind a `BETA9_TOKEN` or `BEAM_TOKEN` secret; these are plaintext opt-ins. Other runtime secrets use [brokered placeholders](https://docs.beam.cloud/v2/environment/secrets.md#brokered-secrets-for-vms-and-sandboxes).


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