Skip to content

feat: show login status, org, and credential info in brev status#368

Open
robobryce wants to merge 1 commit intobrevdev:mainfrom
robobryce:feat/brev-status-login-info
Open

feat: show login status, org, and credential info in brev status#368
robobryce wants to merge 1 commit intobrevdev:mainfrom
robobryce:feat/brev-status-login-info

Conversation

@robobryce
Copy link
Copy Markdown

Summary

  • Unhide the brev status command and extend it to report login state, credential provider, JWT issued/expires timestamps with remaining duration, refresh-token presence, and the active user/org — in addition to the existing instance section that runs when the command is invoked inside a Brev workspace.
  • Provider detection covers KAS (NVIDIA NGC), Auth0, in-pod Kubernetes service-account tokens, and manual tokens set via brev login --token.
  • Wire the command to noLoginCmdStore so an expired or missing token never triggers an interactive login prompt; remote user/org lookups fail gracefully and the local credential metadata is still shown.

Sample output

Logged out:

Status:      Logged out
Run brev login to log in.

Logged in (KAS):

Status:      Logged in
Provider:    kas (NVIDIA NGC) (https://login.nvidia.com)
Issued at:   2026-04-25T16:30:57Z
Expires at:  2026-04-25T17:31:57Z (59m 33s remaining)
Refresh:     present

User:        Alice Example
	ID:        user-abc
	Email:     alice@example.com

Org:         my-org
	ID:        org-xyz

Expired token:

Expires at:  2026-04-25T16:28:54Z (expired; refresh token will be used on next call)

Test plan

  • brev status with no ~/.brev/credentials.json shows the logged-out message
  • brev status with a valid KAS token shows provider kas (NVIDIA NGC) and a positive remaining duration
  • brev status with a valid Auth0 token shows provider auth0
  • brev status with a token whose exp is in the past shows expired without prompting for login
  • brev status with refresh_token: "auto-login" shows provider manual access token and Refresh: absent
  • brev status does NOT prompt for re-login when the access token is expired
  • brev --help lists status (no longer hidden)

🤖 Generated with Claude Code

The hidden `brev status` command only printed the current workspace's
name, ID, and machine type. Extend it to also report login state,
credential provider (kas/auth0/service account/manual token), JWT
issued/expires timestamps with humanized remaining duration, refresh
token presence, and the active user and organization. Switch the
command's wiring from loginCmdStore to noLoginCmdStore so that running
`brev status` with an expired or missing token never triggers an
interactive login prompt; remote user/org lookups instead fail
gracefully and the local-only credential metadata is still shown.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@robobryce robobryce requested a review from a team as a code owner April 25, 2026 20:43
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.

2 participants