Install the Braintrust CLI and start running evals, querying logs, and syncing data from your terminal
bt is the command-line interface for Braintrust. It lets you run evals, instrument your code, browse and query logs, sync data, manage functions, and configure coding agents — without leaving your terminal.
The installer downloads a pre-built binary to ~/.local/bin/bt (or $XDG_BIN_HOME/bt if set).After installing, the installer prompts you to run bt setup. This writes Braintrust skill files for your coding agent. You can run it now or skip it and come back later — see Set up coding agents below.To install a specific version:
bt auth login # OAuth: opens a browser login flow, saves credentials to your keychainexport BRAINTRUST_API_KEY=<your-key> # API key: good for CI, scripts, or if you prefer not to use OAuth
Create an API key under Settings > API keys in the Braintrust app.After authenticating, set a default org and project:
bt switch # Pick a default org and projectbt status # Confirm what's active
bt saves a context — a default org and project — so you don’t need to specify them on every command. You can always override with -o/-p flags or environment variables.
Run your evaluation files directly without npx or SDK runner setup:
bt eval # Discover and run all eval files in the current directorybt eval tests/ # Run eval files under a specific directorybt eval --watch # Re-run on file changes during developmentbt eval --filter my-evaluator # Run a specific evaluator by name
bt eval auto-detects your JavaScript runner (tsx, vite-node, ts-node) and supports Python eval files too. For other languages, run your eval file directly with your language’s toolchain. See bt eval for the full list of flags.
bt view logs # Browse logs for the active projectbt view logs --search "error" # Search by keywordbt view logs --filter "metrics.duration > 5.0" # Filter by expressionbt view logs --url <braintrust-url> # Open a Braintrust URL in the terminal
For programmatic access, bt sql runs SQL queries against your logs from the terminal or in scripts:
bt sql "SELECT * FROM project_logs('my-project') WHERE scores.Factuality < 0.5 LIMIT 50"BRAINTRUST_API_KEY=... bt sql "SELECT count(*) FROM project_logs('my-project')" --json
bt sync downloads Braintrust data to local NDJSON files for offline analysis, backup, or migration:
bt sync pull project_logs:my-project --window 24h # Pull the last 24 hours of logsbt sync pull experiment:my-experiment # Pull a specific experimentbt sync push project_logs:my-project # Push local data back to Braintrust
bt setup writes Braintrust skill files, workflow docs and optionally MCP server config into your agent’s config directory — giving your coding agent (Claude, Cursor, Codex, Opencode) the context it needs to work with Braintrust.
It also detects your project language, installs the exact SDK version, instruments your LLM clients, verifies the app still runs, and outputs a Braintrust permalink to the captured trace:
bt setup # Interactive wizard with the minimal amount of questionsbt setup -i # Interactive wizard with all the options# Directly starts codex to instrument the code since all questions are answeredbt setup --project 'project-name' --api-key BRAINTRUST_API_KEY --agent codex
See bt setup for supported languages and all subcommands.
bt functions push uploads local TypeScript or Python function definitions (tools, scorers, LLM functions) to Braintrust. bt functions pull downloads them back to local files.
bt functions push my_tools.ts # Upload a TypeScript function filebt functions push src/scorers.py # Upload a Python function filebt functions pull --slug my-scorer # Download a function by slug
See bt functions for bundling behavior, language options, and all flags.