Skip to content

cmd: add whoami environment output + tests (1360)#1439

Closed
RoryGlenn wants to merge 1 commit intostripe:masterfrom
RoryGlenn:feature/1360-whoami-command
Closed

cmd: add whoami environment output + tests (1360)#1439
RoryGlenn wants to merge 1 commit intostripe:masterfrom
RoryGlenn:feature/1360-whoami-command

Conversation

@RoryGlenn
Copy link
Copy Markdown

@RoryGlenn RoryGlenn commented Feb 10, 2026

Reviewers

r @tomer-stripe
cc @stripe/developer-products

Title
Add stripe whoami + tests (issue #1360)

PR Description
This PR adds a stripe whoami command to make it easy to confirm which Stripe CLI profile/environment a terminal is currently using (requested in #1360). This helps when running multiple terminals against different sandboxes/accounts and you need to verify you’re listening/triggering in the right place.

Changes:

stripe whoami outputs current profile/project name, account_id, display_name, device_name, color, and API key presence.
Adds JSON output (--json) for easy diffing across terminals.
Adds optional redacted key output (--show-keys) to confirm which key is in use without exposing secrets.
Fix: populate live_mode_key_expires_at (previously printed/serialized but never set).
UX: JSON output now ends with a newline (avoids zsh showing a trailing %).
Tests:

Added unit tests covering JSON + human output and --show-keys redaction.
Made resource tests hermetic by clearing STRIPE_API_KEY to avoid developer env leakage.
How to test:

go test repos.
go test ./pkg/cmd -run TestWhoami
Fixes #1360

@RoryGlenn RoryGlenn requested a review from a team as a code owner February 10, 2026 03:24
@tomer-stripe
Copy link
Copy Markdown
Collaborator

closing in favor of #1508

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.

CLI command to show your currently logged in environment

2 participants