Skip to content

Allow passing an --active flag to gh auth status #9434

@tjschuck

Description

@tjschuck

Right now, when you do gh auth status, it can output multiple accounts, only one of which is active:

% gh auth status
github.com
  ✓ Logged in to github.com account tjschuck (GITHUB_TOKEN)
  - Active account: true
  - Git operations protocol: https
  - Token: ghp_************************************
  - Token scopes: 'notifications', 'read:org', 'repo', 'workflow'

  ✓ Logged in to github.com account tjschuck (keyring)
  - Active account: false
  - Git operations protocol: https
  - Token: gho_************************************
  - Token scopes: 'gist', 'read:org', 'read:packages', 'repo', 'workflow'

Ideally, you'd be able to do something like gh auth status --active to get only the active account listing. This is useful if you want to, for example, check the current scopes available for the active token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-authrelating to the gh auth commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions