Skip to content

feat: add whoami command#657

Draft
apucacao wants to merge 5 commits intomainfrom
ag/whoami-cmd
Draft

feat: add whoami command#657
apucacao wants to merge 5 commits intomainfrom
ag/whoami-cmd

Conversation

@apucacao
Copy link
Contributor

@apucacao apucacao commented Mar 11, 2026

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

N/A

Describe the solution you've provided

Adds ldcli whoami — shows who your current access token belongs to. Reads from config/env like other commands, so you don't need to pass --access-token explicitly (similar to gh auth status).

$ ldcli whoami
Ariel Flores <ariel@acme.com>
Role:    admin
Token:   my-api-token (personal)
Account: abc123

Describe alternatives you've considered

N/A

Additional context

apucacao and others added 5 commits March 11, 2026 15:12
Adds `ldcli whoami` which calls /api/v2/caller-identity to show
information about the identity associated with the current access token
(token name, auth kind, member ID, scopes, etc.).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removes --access-token requirement from whoami — the command reads
the token from config/env (like ldcli login sets up), matching the
pattern of gh auth status and similar commands.

Also hides --access-token, --base-uri, and --analytics-opt-out from
whoami's help output since they're not relevant to this command.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fetches /api/v2/members/{id} after caller-identity when a memberId
is present, giving plaintext output like:

  Ariel Flores <ariel@acme.com>
  Role:    admin
  Token:   my-api-token (personal)

JSON output remains the raw caller-identity response for scripting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant