Braintrust CLI
$ bt Official Med RiskBraintrust CLI (bt) manages AI evaluation projects, datasets, prompts/functions, and experiment logs from terminals and CI. Supports --json, --org, --profile, and headless execution via BRAINTRUST_API_KEY.
npm install -g @braintrust/bt bt runs local eval suites, seeds datasets from local JSONL files, and invokes Braintrust functions with --json output directly in CI without MCP round-trips.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json across inspection commands, structured --input JSON on functions invoke, --profile / --org targeting, and env var auth.
- Supports
--jsonand--mode jsonoutput flags - Headless authentication via
BRAINTRUST_API_KEY
Requires --force on destructive bt projects delete and isolates workspaces with --org / --profile, though dataset mutations lack --dry-run.
- Destructive deletes gated by confirmation or explicit
--force - Supports scoped API keys and named
--profilecontexts
Installable via @braintrust/bt on npm, npx, or standalone shell installer across macOS, Linux, and Windows.
- Published on npm (
@braintrust/bt) andbt.dev/cli/install.sh
Unifies datasets, projects, functions, and eval workflows in one fast CLI.
- Covers
datasets,eval,functions,projects, andtopics
Official Braintrust repository (braintrustdata/bt) under Apache-2.0 license.
- First-party
braintrustdata/btrepository
Well-documented CLI guides on braintrust.dev with clear flag references.
- Official docs at braintrust.dev/docs/guides/cli
Security, Auth & Guardrails
Reads BRAINTRUST_API_KEY from the environment or named --profile configurations stored locally.
Apache-2.0 open-source CLI; requires a Braintrust account (free tier and paid plans available).
# Braintrust CLI (bt) Agent Rules - Set `BRAINTRUST_API_KEY` and pass `--org` / `--profile` explicitly to target the right workspace. - Pass `--json` when inspecting projects or invoking functions. - Require user confirmation before `bt projects delete` (especially with `--force`).
Agent-Ready Command Recipes
Safe Read-Only Queries
bt projects view my-eval-project --json
Inspects project metadata and configuration in structured JSON.
bt functions invoke --slug summarize --input '{"text":"hello"}' --mode json Executes a prompt/function with structured --input and returns JSON output.
Controlled Writes & Previews
bt datasets create --name smoke-suite --file ./evals/smoke.jsonl --json
Uploads local JSONL test cases into a Braintrust dataset.
Strengths for Agents
- + Clean
--jsonoutput and--profile/--orgflags prevent workspace mix-ups in CI. - + Seamless local JSON/JSONL dataset seeding via
--file.
Caveats & Pitfalls
- ! No universal
--dry-runon dataset uploads or function invocations. - ! Requires
BRAINTRUST_API_KEYor prior login before querying remote state.