Skip to navigation

CLI reference

Every beaker command

Install the CLI with pip install beaker-sdk, or run it without installing: uvx --from beaker-sdk beaker <command>.

Sign in

CommandWhat it does
beaker loginOpens your browser so you can approve this machine, then saves your session
beaker logoutSigns out and deletes the saved session
beaker auth statusShows who you’re signed in as, and for which organization

For CI and other unattended jobs, create an API key in the app and set it as BEAKER_API_KEY. The CLI picks the first of these it finds: --api-key, your saved session, then BEAKER_API_KEY.

GitHub

CommandWhat it does
beaker github statusShows the GitHub App installations connected to your organization and the repositories they can see
beaker github connectOpens the page where you install the Beaker GitHub App
beaker github branches --repo owner/nameLists the branches Beaker can read, for run trigger --ref

Installing the GitHub App and choosing which repositories it can see happens on GitHub.

Agents

CommandWhat it does
beaker agent list [--json]Lists your agents with their repository and config path
beaker agent setup NAME [--repo owner/name]Picks or creates an agent, links it to your repository, and saves its key in .beaker/beaker.yaml
beaker agent create NAME --repo owner/nameCreates an agent without prompts
beaker agent edit NAME [--name ...] [--config-path ...]Renames an agent or changes its config path
beaker agent env listLists the environment variables saved for the agent
beaker agent env set NAME --value-stdinSaves an encrypted environment variable for hosted runs
beaker agent env delete NAMERemoves an environment variable

An agent that is linked to a repository can’t be linked to a different one.

To pick an agent, Beaker uses --agent, then BEAKER_AGENT_KEY, then agent_key from your beaker.yaml.

Datasets

CommandWhat it does
beaker dataset uploadUploads a dataset. Each upload is saved as a new, unchangeable revision
beaker dataset listLists your datasets and their revisions
beaker dataset show REFERENCEShows a dataset. REFERENCE is name, name@revision or name@production
beaker dataset promote REFERENCEMarks a revision as the production dataset

Runs

CommandWhat it does
beaker run trigger --ref REF --dataset REFERENCEStarts a run from a branch in your GitHub repository
beaker run status RUN_IDShows progress, candidates and results. Add --watch to follow along
beaker run listLists recent runs
beaker run cancel RUN_IDCancels a run that’s still going
beaker run pull RUN_IDDownloads the candidates and results
beaker model listLists the models you can optimize with

Set up and check locally

These run on your machine.

CommandWhat it does
beaker initCreates .beaker/beaker.yaml and a starter integration in your repo
beaker run smokeChecks that your integration and dataset load correctly, without running your agent or scoring it
beaker onboarding statusShows which setup steps are done and what to do next
beaker trace instrumentAdds tracing to your code
beaker trace inspectPrints a trace from a local run
beaker trace doctorFails if the latest local trace is incomplete

beaker init keeps any config you already have. To use an integration in another file, pass --integration-id <id> --target <path.py-or-module:attribute>.

beaker run smoke loads your dataset (a local folder, or a hosted dataset revision) and checks every row. Add --strict for the checks Beaker runs before a hosted run. Use --integration-id <id> to pick an integration when your config has more than one.

Configure hosted runs

Python version

Hosted runs use Python 3.12 by default. Beaker reads requires-python from your project’s pyproject.toml and picks the lowest version that fits. To set it yourself, use environment_base. The supported values are debian_slim:3.12 and debian_slim:3.13:

integrations:
example:
entrypoint: "beaker_integration:integration"
environment_base: "debian_slim:3.13"

If environment_base doesn’t match what your project needs, Beaker stops before building and tells you what to change.

Installing a workspace package

If your integration lives in a uv workspace, set pip_install_from to the pyproject.toml of the package to install alongside your source folder. beaker init sets this for you.

integrations:
example:
pip_install_from: "workspace/pyproject.toml"

The path must point to a file inside source_dir.