feat(CENG-686): Add --verbose output for cloudsmith whoami command#264
Merged
BartoszBlizniak merged 7 commits intomasterfrom Feb 16, 2026
Conversation
…about current authentication methods
…bose-with-auth-details
…bose-with-auth-details
--verbose output for cloudsmith whoami command
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the cloudsmith whoami command with a --verbose (-v) flag that displays detailed authentication information including the active authentication method (API Key or SSO Token), credential source, token metadata, and SSO status. The verbose output supports both human-readable text and JSON formats.
Changes:
- Added
get_token_metadata()function to retrieve API token metadata (slug and creation date) - Implemented verbose mode for
cloudsmith whoamiwith detailed authentication information display - Updated imports in
user.pyto properly distinguish between upstream and wrapped API exceptions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
cloudsmith_cli/core/api/user.py |
Added get_token_metadata() function to fetch token metadata and refined exception imports to distinguish upstream vs wrapped exceptions |
cloudsmith_cli/cli/commands/whoami.py |
Implemented verbose mode with helper functions to detect and display authentication method, credential source, token metadata, and SSO status |
CHANGELOG.md |
Added entry documenting the new --verbose flag for cloudsmith whoami command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
estebangarcia
approved these changes
Feb 16, 2026
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.
Description
Enhance
cloudsmith whoamiwith a--verbose(-v) flag that displays detailed authentication information.Verbose output includes:
CLOUDSMITH_API_KEYenv var (with last 4 chars),credentials.ini(with file path), or--api-keyCLI flag/user/tokens/endpoint)CLOUDSMITH_NO_KEYRINGawareness — shown when keyring is disabledJSON schema for verbose output (
--verbose --output-format json){ "data": { "is_authenticated": true, "username": "user-slug", "email": "user@example.com", "name": "Display Name", "auth": { "active_method": "api_key | sso_token | none", "api_key": { "configured": true, "source": "CLOUDSMITH_API_KEY env var (ends with ...abcd) | credentials.ini (/path/to/credentials.ini) | CLI --api-key flag", "source_key": "env_var | credentials_file | cli_flag", "slug": "token-slug-perm | null", "created": "2025-01-15T10:30:00Z | null" }, "sso": { "configured": true, "keyring_enabled": true, "source": "System Keyring | null", "last_refreshed": "2025-01-15T10:30:00Z | null" } } } }Backward compatible:
cloudsmith whoamioutput is unchangedType of Change
Additional Notes