Skip to content

fix: output all the required parameters for npm token list#9691

Merged
owlstronaut merged 1 commit into
release/v11from
backport/v11/9588
Jun 29, 2026
Merged

fix: output all the required parameters for npm token list#9691
owlstronaut merged 1 commit into
release/v11from
backport/v11/9588

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #9588 to release/v11.

### What

Added missing token metadata to `npm token list` outputs:

* Added `id` field to the `--json` output.
* Added `name` field to the default and `--parseable` outputs of `npm
token list`.

### Why

Currently, token information is fragmented across different output
formats:

* `npm token revoke` requires a token ID or token value, but the
`--json` output does not expose the token ID.
* The default and `--parseable` outputs expose the ID but not the token
name.
* This makes it difficult to automate token lifecycle management (such
as identifying and revoking expired tokens) because users need
information from multiple output formats.

### How

* Updated the token listing implementation to include the token `id` in
the JSON response.
* Updated the default and parseable formatters to include the token
`name`.
* Ensured all output formats expose the metadata required for scripting,
automation, and token revocation workflows while maintaining backward
compatibility where possible.

Fixes the issue: #9443

(cherry picked from commit 6da6555)
@owlstronaut owlstronaut merged commit 05793d0 into release/v11 Jun 29, 2026
37 checks passed
@owlstronaut owlstronaut deleted the backport/v11/9588 branch June 29, 2026 15:01
@github-actions github-actions Bot mentioned this pull request Jun 29, 2026
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.

2 participants