GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Braintrust home page
  • Contact us
  • Dashboard
  • Integrations
  • SDKs
  • Reference
  • Cookbook
  • Troubleshooting
  • Changelog
  • Glossary
  • Overview
  • Query by SQL
  • Quickstart
  • Migrate

This view

  • Original page
  • New address

GeezerVison is showing docs.braintrust.dev — Migrate bt - Braintrust

This page describes steps to follow when upgrading bt across versions with breaking changes.

Command syntax

How you invoke bt depends on how it is installed:
  • For the standalone installer, mise, and global npm or pnpm installations, use the commands as written.
  • For a project-local npm installation, run commands from the project and replace bt with npx bt.
  • For a project-local pnpm installation, run commands from the project and replace bt with pnpm exec bt.
The commands in this guide use bt. Substitute the project-local invocation above when applicable.

Before you update

1

Check the installed version of bt

bt --version
Record the version so you can identify the migration instructions that apply after updating.
2

Record authentication and context

Complete this step only if your installed version is older than v0.16.0. Otherwise, continue to Update bt.
Record three parts of your current setup before updating:
  • Saved profiles: Run bt auth profiles. For each profile you still use, record its name, whether it uses OAuth or an API key, its authentication status, and any associated organization shown.
  • Environment API key: Check whether BRAINTRUST_API_KEY is set where you run bt, such as your shell, an environment file, CI/CD settings, or a secret manager. Record only whether it is set, not its value.
  • Selected context: Run bt status and record the selected profile, organization, and project so you can restore them after updating.

Update bt

Update bt using the method that matches how you installed it, then check the installed version:
  • Standalone
  • npm
  • pnpm
  • mise
  • Windows
Run these commands:
bt update
bt --version
If your installed version does not recognize bt update, run this command instead:
bt self update
bt --version
If braintrust is installed in a project, run these commands from that project:
npm install braintrust@latest
npx bt --version
If you installed braintrust globally, update the global package instead:
npm install --global braintrust@latest
bt --version
The braintrust package pins a specific version of bt, which can lag behind standalone releases. If the package does not yet include the bt release whose migration steps you need, use the standalone installer.
If braintrust is installed in a project, run these commands from that project:
pnpm add braintrust@latest
pnpm exec bt --version
If you installed braintrust globally, update the global package instead:
pnpm add --global braintrust@latest
bt --version
The braintrust package pins a specific version of bt, which can lag behind standalone releases. If the package does not yet include the bt release whose migration steps you need, use the standalone installer.
Update bt, then verify the installed version:
mise upgrade "github:braintrustdata/bt" --bump
bt --version
For a standalone Windows installation running bt v0.17.0 or later, run:
bt update
bt --version
For v0.16.x or earlier, rerun the PowerShell installer instead. bt update did not work on Windows in those versions.
powershell -ExecutionPolicy Bypass -c "irm https://github.com/braintrustdata/bt/releases/latest/download/bt-installer.ps1 | iex"
bt --version

Version-specific migrations

Only releases with migration steps appear below. Complete each applicable section newer than the version you recorded before updating, through the version you installed, in ascending version order.

v0.16.0

For the full list of changes, see the v0.16.0 changelog entry.
v0.16.0 changes authentication context, command names, and tracing setup:
  • Saved profiles no longer select the active organization. You can use one profile with every organization its credentials can access. Project selection remains separate.
  • Top-level commands replace the previous bt auth commands.
  • Coding-agent tracing setup moves to bt trace.
The update preserves saved profiles and credentials, but an organization stored only in a legacy profile is no longer selected as active context.
1

Verify authentication

Verify each credential source you plan to keep using:
  • Saved profiles: Run bt status --all. This command checks every saved OAuth and API key profile. Confirm that each profile you still use can authenticate successfully.
  • Environment API key: bt status --all reports when BRAINTRUST_API_KEY overrides saved profiles, but it does not validate the key. To verify the environment key, use it for an authenticated request such as bt projects list --org "your-org". Replace your-org with the organization you recorded before updating. If the command returns the organization’s projects, the key works.
2

Repair authentication if needed

Repair each credential source you plan to keep using that could not authenticate. If multiple saved profiles need repair, repeat the applicable commands for each profile.
  • Environment API key
  • Saved OAuth profile
  • Saved API key profile
If BRAINTRUST_API_KEY is missing or invalid, replace it with a valid Braintrust API key in the environment where you run bt.
For a BYOC deployment, also set BRAINTRUST_API_URL and BRAINTRUST_APP_URL in the environment where you run bt.
If the profile reports token expired, refresh it:
bt login --refresh --profile your-profile
If the refresh fails or the profile reports credential missing, log in again:
bt login --oauth --profile your-profile
For a BYOC deployment, add its --api-url and --app-url to the login command.
If the profile reports credential missing or invalid API key, log in again:
bt login --profile your-profile
Choose API key and enter it when prompted.
For a BYOC deployment, add its --api-url and --app-url to the login command.
3

Choose credentials, organization, and project

Choose the credentials, organization, and project that bt should use for subsequent commands.To save your selection globally, use bt switch --global as shown below. For a project-specific selection, use bt switch --local (which writes to the nearest .bt/config.json, which you can create with bt init).
  • Environment API key
  • Saved profile
  1. Leave BRAINTRUST_API_KEY set.
  2. Check BRAINTRUST_ORG_NAME and BRAINTRUST_DEFAULT_PROJECT. Keep values accessible to the API key, or unset them to choose interactively.
  3. Run bt switch --global and select an organization and project accessible to your API key. If only one organization is available, bt selects it automatically.
  1. Unset BRAINTRUST_API_KEY, since it overrides credentials from saved profiles.
  2. Check BRAINTRUST_PROFILE, BRAINTRUST_ORG_NAME, and BRAINTRUST_DEFAULT_PROJECT. Keep the intended profile and values accessible to it, or unset them to choose interactively.
  3. Run bt switch --global. If prompted, select the saved profile. Then select an organization and project accessible with that profile. If only one organization is available, bt selects it automatically.
4

Verify the migrated setup

Run bt status --all and confirm that the saved profiles, selected profile, organization, and project are correct.
5

Update scripts and automation if needed

Skip this step if you do not have scripts or saved commands that use bt.
Existing scripts may require two types of changes:

Replace old commands and flags

v0.16.0 changes several commands and flags, including replacing the bt auth command group with top-level commands. Update existing scripts as follows:
Before v0.16.0Replacement
bt auth loginbt login
bt auth logoutbt logout
bt auth refreshbt login --refresh
bt auth profilesbt status --all to verify saved credentials. bt profiles list lists local profiles and is available in v0.17.0 or later
bt self updatebt update. Use the old command once if the installed version does not recognize bt update
--fresh on bt sync or bt datasets pipeline--force. The behavior is unchanged
--api-key <KEY>The BRAINTRUST_API_KEY environment variable or a saved OAuth or API key profile created with bt login. The flag is deprecated and hidden from help output in v0.16.0 and v0.17.x, then removed in v0.18.0

Specify credentials, organization, and project

Starting in v0.16.0, a saved profile no longer provides an organization. Update affected scripts based on how they authenticate:
  • If the script uses a saved profile, add --profile <PROFILE> --org <ORG>. An explicit --profile flag takes precedence over BRAINTRUST_API_KEY, so you do not need to unset the variable.
  • If the script uses BRAINTRUST_API_KEY, leave it set and add --org <ORG>. Do not pass --profile.
For commands scoped to a project, also add --project <PROJECT>.
6

Identify coding-agent migrations

If you have an older tracing setup for Claude Code, Codex, OpenCode, or pi, follow its migration guide to preserve your settings when moving to bt-managed tracing. Cursor, Grok, Antigravity, and Muse Code use bt-managed tracing from their first release and do not require this migration.

v0.18.0

For the full list of changes, see the v0.18.0 changelog entry.
Before v0.18.0, scripts and saved commands could pass an API key with the --api-key flag. Starting in v0.18.0, this flag is no longer supported. Update affected commands to use one of these authentication methods:
  • Environment API key: Set BRAINTRUST_API_KEY in the command’s environment, then remove the --api-key flag. For example, change:
    bt projects list --api-key "$BT_API_KEY" --org "<your-org>"
    
    to:
    BRAINTRUST_API_KEY="$BT_API_KEY" bt projects list --org "<your-org>"
    
  • Saved profile: Create or repair the profile with bt login, then pass --profile <your-profile> to commands that should use it. An explicit --profile flag takes precedence over BRAINTRUST_API_KEY.
Run one affected command after the change to confirm that it authenticates successfully.

v0.19.0

For the full list of changes, see the v0.19.0 changelog entry.
1

Update scripts that run bt login

This step applies only if your scripts or CI workflows run bt login with BRAINTRUST_API_KEY set. Other commands can continue using BRAINTRUST_API_KEY without changes.
Before v0.19.0, when bt login authenticated with an API key supplied through BRAINTRUST_API_KEY, it saved the key as a profile without asking for confirmation. Starting in v0.19.0, it requires confirmation before saving the environment key.After upgrading, choose one of these options for each affected bt login flow:
  • Interactive login: Leave BRAINTRUST_API_KEY set, run bt login, and confirm the prompt to save the key.
  • Non-interactive login: Leave BRAINTRUST_API_KEY set and pass --save-env-api-key:
    BRAINTRUST_API_KEY="$BT_API_KEY" bt login --profile <your-profile> --save-env-api-key
    
2

Enable tracing in the configuration file

Starting in bt v0.19.0, Claude Code and Codex no longer use TRACE_TO_BRAINTRUST to enable tracing. This applies even if you don’t update the tracing plugin.
  • If your tracing configuration already sets trace_to_braintrust to true, you don’t need to change it.
  • If you relied on TRACE_TO_BRAINTRUST, follow the Claude Code migration or Codex migration to enable tracing in the configuration file while preserving your settings.
3

Refresh existing OpenCode and pi tracing configuration

If you use an OpenCode or pi tracing integration configured by a version of bt earlier than v0.19.0, its configuration may contain obsolete top-level destination and authentication fields. These can override settings written by newer versions of bt in the route object.Starting in v0.19.0, bt trace enable removes those obsolete fields and updates the saved tracing settings in the global file. It does not migrate project-local files.Follow the OpenCode migration instructions or pi migration instructions to preserve your settings and migrate both global and project-local files.
4

Update affected Codex tracing commands

If a script or saved command passes --dangerously-bypass-hook-trust to bt trace run codex, update it before running it with v0.19.0 or higher. Before v0.19.0, bt could forward this option even though it conflicts with the managed hook and can produce duplicate Braintrust hook output. Starting in v0.19.0, bt rejects the combination before launching Codex.Remove --dangerously-bypass-hook-trust from commands launched through bt trace run codex. If the Codex invocation requires that option, run Codex directly instead of through bt trace run.
5

Address Claude Code tracing warnings

With bt v0.19.0 or higher, bt trace enable claude warns if Claude’s settings.json contains obsolete Braintrust tracing environment variables, but it does not remove them.Follow the Claude Code plugin migration to preserve your tracing destination and remove obsolete settings after verifying tracing.

v0.19.2

For the full list of changes, see the v0.19.2 changelog entry.
Before v0.19.2, bt sync pull used a three-day time window when --window and BT_SYNC_WINDOW were omitted. Starting in v0.19.2, project log pulls retain that default, but experiment and dataset pulls are unbounded.
1

Review experiment and dataset pull commands

Find scripts and saved commands that use bt sync pull with an experiment or dataset object reference and do not set --window or BT_SYNC_WINDOW.
2

Choose a time window

To preserve the previous behavior, add --window 3d to each affected command or set BT_SYNC_WINDOW=3d in its environment. Leave the window unset only when you intend to pull all matching history.For example:
bt sync pull "experiment:<experiment-id>" --window 3d
bt sync pull "dataset:<dataset-id>" --window 3d

v0.19.3

For the full list of changes, see the v0.19.3 changelog entry.
Starting in v0.19.3, bt trace enable opencode and bt trace enable pi install v2 of their tracing integrations instead of v1. Updating bt alone does not update an installed plugin or extension. For an existing v1 installation, follow the OpenCode migration instructions or pi migration instructions before updating the integration. The guides explain how to preserve settings that v1 read from environment variables and how to migrate global and project-local configuration files. For routine updates after completing the applicable migrations, use bt trace update to preserve your tracing settings.

v0.20.0

For the full list of changes, see the v0.20.0 changelog entry.
Before v0.20.0, bt topics config enable and bt topics config set accepted a --relabel-overlap flag. Starting in v0.20.0, passing --relabel-overlap produces an error. Remove --relabel-overlap from any scripts or saved commands that pass it to bt topics config enable or bt topics config set.

v0.26.0

For the full list of changes, see the v0.26.0 changelog entry.
Starting in v0.26.0, bt reads its command-specific environment variables with the BRAINTRUST_ prefix instead of BT_, matching the Braintrust SDKs. For example, BT_EVAL_WATCH is now BRAINTRUST_EVAL_WATCH, and BT_FUNCTIONS_PUSH_IF_EXISTS is now BRAINTRUST_FUNCTIONS_PUSH_IF_EXISTS. The earlier BT_ names still work as deprecated aliases, so no immediate change is required. If both names are set, bt uses the BRAINTRUST_ value and ignores the BT_ value. Coding-agent tracing follows the same rule. For example, BT_DAEMON_CONFIG is now BRAINTRUST_DAEMON_CONFIG. To update, replace the BT_ prefix with BRAINTRUST_ for these variables in your shell profiles, .env files, and CI/CD settings. Run bt <command> --help to see the variable names a command reads. Don’t rename BT_BINARY_PATH or BT_SKIP_DOWNLOAD. The bt launcher in the braintrust npm package reads them, and they keep the BT_ prefix.

v0.33.0

For the full list of changes, see the v0.33.0 changelog entry.
Before v0.33.0, bt trace disable uninstalled a coding agent’s tracing integration and deleted its tracing configuration. Starting in v0.33.0, it pauses tracing and keeps both, and bt trace uninstall removes them. If a script or saved command runs bt trace disable <coding-agent> to remove tracing, change it to bt trace uninstall <coding-agent>. To pause tracing without removing the integration, keep bt trace disable and run bt trace enable <coding-agent> to resume.

Troubleshooting

Start by inspecting the saved profiles and selected context:
bt status --all
This command verifies each saved profile, reports missing, expired, or invalid credentials, and shows the selected profile, organization, project, and configuration source. Use the output to choose a troubleshooting path:

Fix authentication or context

If the output is not what you expect, check the following:
  • If you intend to use a saved profile, unset BRAINTRUST_API_KEY or pass --profile <PROFILE>. bt status --all reports when the environment API key is overriding saved profiles.
  • If BRAINTRUST_PROFILE is set, unset it or make sure it names the intended profile. It takes precedence over the profile saved by bt switch unless you pass --profile explicitly.
To correct problems:
  • Repair a saved profile with the applicable bt login command from the migration steps. The command updates the existing profile, so you do not need to delete and recreate it first.
  • Correct organization and project context with bt switch instead of editing the files directly.
  • Check command-line flags and environment variables that can override saved values. See Credential precedence for authentication details.

Inspect configuration files

If the environment variables are correct, inspect the following locations:
DataDefault locationWhat to check
Saved profile metadata
  • macOS and Linux: ~/.config/bt/auth.json
  • Windows, v0.22.2 or later: %USERPROFILE%\.braintrust\auth\credentials.dpapi, encrypted together with credentials
  • Windows, earlier versions: %APPDATA%\bt\auth.json
Confirm that the expected profile exists and uses the expected auth_kind. This file stores metadata, not credentials, except on Windows with v0.22.2 or later. Starting in v0.16.0, bt does not treat a legacy org_name value as active context. Starting in v0.19.0, bt automatically adds a stable ID for each profile under profile_ids
Saved credentials
  • macOS and Linux: the system credential store, or ~/.config/bt/secrets.json if secure storage is unavailable
  • Windows, v0.22.2 or later: %USERPROFILE%\.braintrust\auth\credentials.dpapi, with no plaintext fallback
  • Windows, earlier versions: %APPDATA%\bt\secrets.json
Do not copy, share, or edit stored credentials. Use bt status --all to check them and bt login to repair them
Global context
  • macOS and Linux: ~/.config/bt/config.json
  • Windows: %USERPROFILE%\.config\bt\config.json
Check the profile, org, project, and project_id values written by bt switch --global
Project contextThe nearest .bt/config.json found by searching upward from the current directory. bt stops after checking the Git repository root or your home directoryCheck the profile, org, project, and project_id values. These values override the corresponding global values
On macOS and Linux, XDG_CONFIG_HOME is an optional environment variable that changes where applications store configuration files. If it is set, bt uses $XDG_CONFIG_HOME/bt/ instead of ~/.config/bt/.

Next steps

  • CLI overview for the full command reference and auth precedence.
  • bt releases for release artifacts and version history.

Was this page helpful?

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.