Skip to content

feat: gws auth status command to display current auth state #416

@Montana

Description

@Montana

Hey all,

A gws auth status command that shows the current authentication state at a glance, which account is active, what scopes are granted, whether the token is valid/expired, and credential storage details.

Auth is the a big source of friction in this project (see #197, #205, #187, #188, #236, #232). Almost every auth-related issue follows the same debugging pattern: the user doesn't know which account is active, which scopes were actually granted, or whether their token has expired. Right now the only way to find out is to make an API call and see if it fails.

A dedicated status command would:

Proposed behavior

$ gws auth status

Account:      user@example.com
Auth method:  OAuth (user credentials)
Token status: Valid (expires in 47m)
Scopes:       gmail.readonly, drive, calendar (12 total)
Credential store: OS keyring
Config path:  ~/.config/gws/credentials/user@example.com.enc

Possible flags:

  • --json for structured output (consistent with the rest of the CLI)
  • --scopes to list all granted scopes individually
  • --account <email> to check a specific account rather than the active one

When no credentials are found:

$ gws auth status
No credentials found. Run `gws auth login` to authenticate.

Additional context

This would also be useful for AI agents — an agent could call gws auth status --json before attempting any API call to verify it has the right scopes, rather than failing mid-workflow.

Thank you,
Michael.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions