Skip to content

Deprecate bt setup - #292

Open
Cedric / ViaDézo1er (viadezo1er) wants to merge 20 commits into
release-1.0-devfrom
cedric/deprecate-setup
Open

Deprecate bt setup#292
Cedric / ViaDézo1er (viadezo1er) wants to merge 20 commits into
release-1.0-devfrom
cedric/deprecate-setup

Conversation

@viadezo1er

@viadezo1er Cedric / ViaDézo1er (viadezo1er) commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Show a message warning about the deprecation of bt setup.

Before:

bt
...
setup        Configure Braintrust setup flows
...

After:

bt
...
setup        Configure Braintrust setup flows (deprecated: use curl -fsSL https://braintrust.dev/wizard/setup.sh | sh)
...

Before:

❯ bt setup


  ███  ███
███      ███
  ███  ███
███      ███
  ███  ███

Braintrust
...

After:

❯ bt setup
bt setup has been deprecated, use the command below instead:

    curl -fsSL https://braintrust.dev/wizard/setup.sh | sh



  ███  ███
███      ███
  ███  ███
███      ███
  ███  ███

Braintrust
...

Before:

❯ bt setup -h
Configure Braintrust setup flows

Usage: bt setup [OPTIONS] [COMMAND]
...

After:

❯ bt setup -h
Deprecated: use curl -fsSL https://braintrust.dev/wizard/setup.sh | sh

Configure Braintrust setup flows

Usage: bt setup [OPTIONS] [COMMAND]
...

Based on cedric/prune-profiles from #274, will be merged after it.
For reviews, don't forget to compare against cedric/prune-profiles and not against main.

first draft

BREAKING-CHANGE: --profile and --prefer-profile removed
Breaks any script using them
…n to use the new auth storage format orgid,email
The field is needed by OAuth but it's unused both bt and the backend
Therefore exposing it is useless
Now bt_cli is hardcoded as its value
 - Preserves separate OAuth and API-key login identities.
 - Keeps multiple API keys for the same org distinct using key hints.
 - Implements the intended precedence:
     1. Explicit --api-key
     2. --prefer-api-key
     3. OAuth
     4. BRAINTRUST_API_KEY
     5. Stored API key
 - Validates explicit/environment API keys against the requested org.
 - Does not fall back to OAuth when a selected key is invalid or belongs to another org.
 - Rejects API-key authentication in cross-org mode.
 - Pins the exact API-key login selected by bt switch or bt init.
 - Adds bt auth login --global/--local.
 - Adds filtering to bt auth logins --org/--prefer-api-key.
 - Changes bare bt auth logout to select from all saved logins instead of deleting the currently active one.
 - Adds bt auth logout --oauth and retains --api-key-hint.

 Config handling — src/config/mod.rs

 - Makes global/local merging org-safe:
     - A project is never inherited from another org.
     - project and project_id remain coupled.
     - Local project-without-org does not inherit the global org.

 - Stores cross-org as:

   ```json
     { "org": "" }
   ```

 - Ignores the legacy profile field.

 - Preserves unknown config keys during updates.

 - Only treats .bt/config.json as a local config; a bare .bt directory is not one.

 - Adds separate filesystem discovery rules for bt init.

 bt switch — src/switch.rs

 - Starts with a saved-login picker:
     - OAuth entries collapse into org choices.
     - API keys remain separate and display their hints.
     - Cross-org OAuth is selectable.
 - Automatically selects a sole login/project.
 - Prompts for project when multiple projects exist.
 - Pins a selected API-key slot exactly.
 - Implements global/local scope rules:
     - --global does not search for local config.
     - --local requires an existing .bt/config.json.
     - Interactive ambiguity opens a scope picker.
     - Non-interactive ambiguity errors before network work.
 - Preserves unknown config fields.
 - Fixes the scope-picker ANSI corruption you reported by passing plain labels to Dialoguer.

 bt init — src/init.rs

 - Adds:
     - --here
     - -f/--force

 - Searches upward for .bt, .git, home, or filesystem root using the specified boundary rules.

 - Resolves destination errors before authentication.

 - Uses the same saved-login/project selection behavior as switch.

 - Excludes cross-org from the picker because init requires a project.

 - Writes org, project, and project_id.

 - Reports permission/write failures with the affected path.

 - Now exposes the real destination error instead of only saying:

   ```text
     could not resolve `bt init` destination
   ```

 Cross-org CLI/status — src/args.rs, src/main.rs, src/status.rs

 - Normalizes these to canonical cross-org:

   ```sh
     --org cross-org
     --org ""
   ```

 - Displays cross-org as cross-org in human and JSON status output.

 - Prevents stale projects from being combined with cross-org context.

 - Makes --prefer-api-key fail actionably from cross-org context.
before it was always the same name which could lead to corruption if multiple bt used it at the same time
`bt datasets snapshots create my-dataset` would use the name of the OAuth login when the credentials used were BRAINTRUST_API_KEY, ie not OAuth
Always show current auth in bt status even if it's from API key in env
OAuth logins are instance-scoped by normalized app_url; API keys remain org-scoped.gc
Added OAuth migration and duplicate pruning.gc
Added org_id, app_url, and api_url config support with correct precedence and context coupling.gc
Reworked bt auth login, bt init, and bt switch.gc
Removed cross-org/profile selection behavior.gc
Updated login filtering, logout, status, setup compatibility, URL-derived context hints, tests, and README.gc
@viadezo1er Cedric / ViaDézo1er (viadezo1er) changed the title cedric/deprecate setup Deprecate bt setup Jul 29, 2026
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Latest downloadable build artifacts for this PR commit 8d888c08b41d:

Available artifact names
  • artifacts-build-global
  • artifacts-build-local-aarch64-pc-windows-msvc
  • artifacts-build-local-x86_64-apple-darwin
  • artifacts-build-local-x86_64-pc-windows-msvc
  • artifacts-build-local-x86_64-unknown-linux-gnu
  • artifacts-build-local-x86_64-unknown-linux-musl
  • artifacts-build-local-aarch64-apple-darwin
  • artifacts-build-local-aarch64-unknown-linux-gnu
  • artifacts-plan-dist-manifest
  • cargo-dist-cache

@viadezo1er
Cedric / ViaDézo1er (viadezo1er) changed the base branch from main to release-1.0-dev July 29, 2026 21:41
Also print a message when `bt auth login` uses BRAINTRUST_API_KEY
Now it only deals with credentials
@viadezo1er
Cedric / ViaDézo1er (viadezo1er) marked this pull request as ready for review July 30, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant