bt is the command-line interface for Braintrust. Use it to run evals, query logs, manage prompts, sync data, and configure coding agents — all from your terminal.
Install
~/.cargo/bin/bt. Source or open a new shell if bt is not found.
Getting started
Available commands
| Command | Subcommands | Description |
|---|---|---|
bt auth | login, refresh, profiles, logout | Authenticate with Braintrust |
bt switch | Switch org and project context | |
bt status | Show current org and project context | |
bt sql | Run SQL queries against Braintrust | |
bt view | logs, trace, span | View logs, traces, and spans |
bt eval | Run eval files (Unix only) | |
bt experiments | list, view, delete | Manage experiments |
bt projects | list, create, view, delete | Manage projects |
bt functions | list, view, invoke, delete | Manage and invoke functions |
bt scorers | list, view, invoke, delete | Manage and invoke scorers |
bt tools | list, view, invoke, delete | Manage and invoke tools |
bt prompts | list, view, delete | Manage prompts |
bt sync | pull, push, status | Sync project logs to/from local NDJSON files |
bt init | Initialize .bt/ config in current directory | |
bt setup | skills, mcp, doctor | Configure coding agents and MCP |
bt docs | Manage workflow docs for coding agents | |
bt self | update | Self-update the CLI binary |
Global flags
| Flag | Short | Env var | Description |
|---|---|---|---|
--json | Output as JSON | ||
--profile <NAME> | BRAINTRUST_PROFILE | Use a saved login profile | |
--org <NAME> | -o | BRAINTRUST_ORG_NAME | Override org |
--project <NAME> | -p | BRAINTRUST_DEFAULT_PROJECT | Override project |
--api-key <KEY> | BRAINTRUST_API_KEY | Override API key | |
--prefer-profile | Prefer profile even if API key env is set | ||
--no-input | Disable interactive prompts | ||
--api-url <URL> | BRAINTRUST_API_URL | Override API URL | |
--app-url <URL> | BRAINTRUST_APP_URL | Override app URL | |
--env-file <PATH> | BRAINTRUST_ENV_FILE | Load a .env file |
Environment variables
For CI/CD environments, use the
BRAINTRUST_API_KEY environment variable instead of OAuth login.| Variable | Purpose |
|---|---|
BRAINTRUST_API_KEY | API key (skips OAuth; use for CI) |
BRAINTRUST_PROFILE | Profile selection |
BRAINTRUST_ORG_NAME | Org override |
BRAINTRUST_DEFAULT_PROJECT | Project override |
BRAINTRUST_API_URL | API endpoint (default: https://api.braintrust.dev) |
BRAINTRUST_APP_URL | App endpoint (default: https://www.braintrust.dev) |
BRAINTRUST_ENV_FILE | .env file path |
BT_EVAL_RUNNER | Eval runner binary |
BT_EVAL_LANGUAGE | Force eval language (js / py) |
BT_EVAL_LOCAL | Run evals locally (same as --no-send-logs) |
BT_EVAL_PYTHON_RUNNER | Override Python runner binary |
NO_COLOR | Disable colored output |
PAGER | Custom pager (default: less -R) |
GITHUB_TOKEN | GitHub API auth for bt self update in CI |
bt automatically loads .env files from the current directory: .env → .env.{NODE_ENV} → .env.local → .env.{NODE_ENV}.local. Existing env vars are not overwritten.
Troubleshooting
bt not found after install
bt not found after install
Open a new shell. Ensure
~/.cargo/bin is in your PATH.OAuth login fails
OAuth login fails
On SSH,
bt auto-detects and prints the URL. Use --no-browser to force this. 5-minute callback timeout.No profile found
No profile found
Run
bt auth profiles --verbose to check. Specify with --profile or BRAINTRUST_PROFILE.Wrong org or project
Wrong org or project
Run
bt status --verbose to see where each value comes from.Token expired
Token expired
Run
bt auth refresh, or bt auth login to re-authenticate.Self-update fails
Self-update fails
Only works for installer-managed installs. Use your package manager otherwise.