Skip to content

fix: bt auth ignored --json#271

Open
Cedric / ViaDézo1er (viadezo1er) wants to merge 1 commit into
mainfrom
cedric/json-ignored-auth-commands
Open

fix: bt auth ignored --json#271
Cedric / ViaDézo1er (viadezo1er) wants to merge 1 commit into
mainfrom
cedric/json-ignored-auth-commands

Conversation

@viadezo1er

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

Copy link
Copy Markdown
Contributor

and bt auth profiles --profile profile-name
now prints only the designated profile information

bt auth refresh honoring --json (same with bt auth login/logout, which is most useful with --no-input --api-key sk-... in scripts):
Before:

❯ bt auth refresh --json -o ced-test-1
Refreshing OAuth token for profile 'ced-test-1' (source: org-based resolution, api_url: https://api.braintrust.dev)
Cached access token expiry before refresh: 1784243644 (about 86379s remaining)
New access token expiry: 1784243665 (about 86399s remaining)
Refresh token rotation: yes
{"access_expires_at":1784243665,"auth":"oauth","name":"ced-test-1","refresh_token_rotated":true,"status":"ok"}

After:

❯ bt auth refresh --json -o ced-test-1
Refreshing OAuth token for profile 'ced-test-1' (source: org-based resolution, api_url: https://api.braintrust.dev)
Cached access token expiry before refresh: 1784243644 (about 86379s remaining)
New access token expiry: 1784243665 (about 86399s remaining)
Refresh token rotation: yes
{"access_expires_at":1784243665,"auth":"oauth","name":"ced-test-1","refresh_token_rotated":true,"status":"ok"}

--profile profile-name showing only the selected profile for bt auth profiles:
Before:

❯ bt auth profiles --profile 'ced-test-1'
! -/ — oauth — org: -/ — token expired
✓ BT Staging — api_key — org: BT Staging — sk-****O50s6
✓ Braintrust SDKs — oauth — org: Braintrust SDKs — Cédric Halber (cedric@braintrustdata.com)
✓ ced-test-1 — oauth — org: ced-test-1 — Cédric Halber (cedric@braintrustdata.com)
! ced1 — oauth — org: ced1 — token expired
✓ ced7 — oauth — org: ced7 — xnnjgu+4a442se9ppp9g@sharklasers.com
! ced8 — oauth — org: ced8 — token expired
! delete-this — oauth — org: delete-this — token expired
✓ profile — oauth — Cédric Halber (cedric@braintrustdata.com)

Credentials: /Users/cedric@braintrustdata.com/.config/bt/auth.json

After:

❯ bt auth profiles --profile 'ced-test-1'
✓ ced-test-1 — oauth — org: ced-test-1 — Cédric Halber (cedric@braintrustdata.com)

Credentials: /Users/cedric@braintrustdata.com/.config/bt/auth.json

Fix #249

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Latest downloadable build artifacts for this PR commit 8a7aace3aee0:

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

@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/json-ignored-auth-commands branch 2 times, most recently from 9526668 to c30726b Compare July 14, 2026 02:15
@viadezo1er Cedric / ViaDézo1er (viadezo1er) marked this pull request as ready for review July 14, 2026 02:21
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/json-ignored-auth-commands branch from c30726b to b4a8809 Compare July 15, 2026 01:05
Comment thread tests/functions.rs Outdated
"expected oauth-only refresh hint, got: {stderr}"
);
// Errors are not part of the --json contract (they surface via the global
// error printer); stdout should not carry a partial result.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove these redundant comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/json-ignored-auth-commands branch 2 times, most recently from 6c6069c to 87e072f Compare July 15, 2026 23:27
and bt auth profiles --profile profile-name
now prints only the designated profile information
@viadezo1er Cedric / ViaDézo1er (viadezo1er) force-pushed the cedric/json-ignored-auth-commands branch from 87e072f to 8a7aace Compare July 15, 2026 23:27
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.

bt auth refresh ignore --json

2 participants