feat: show login status, org, and credential info in brev status#368
Open
robobryce wants to merge 1 commit intobrevdev:mainfrom
Open
feat: show login status, org, and credential info in brev status#368robobryce wants to merge 1 commit intobrevdev:mainfrom
robobryce wants to merge 1 commit intobrevdev:mainfrom
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
brev statuscommand 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.brev login --token.noLoginCmdStoreso 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:
Logged in (KAS):
Expired token:
Test plan
brev statuswith no~/.brev/credentials.jsonshows the logged-out messagebrev statuswith a valid KAS token shows providerkas (NVIDIA NGC)and a positive remaining durationbrev statuswith a valid Auth0 token shows providerauth0brev statuswith a token whoseexpis in the past showsexpiredwithout prompting for loginbrev statuswithrefresh_token: "auto-login"shows providermanual access tokenandRefresh: absentbrev statusdoes NOT prompt for re-login when the access token is expiredbrev --helplistsstatus(no longer hidden)🤖 Generated with Claude Code