Skip to content

feat(key): add 'ipfs key ls' as alias for 'ipfs key list'#11147

Merged
lidel merged 4 commits intoipfs:masterfrom
VedantMadane:feat/key-ls-alias
Jan 30, 2026
Merged

feat(key): add 'ipfs key ls' as alias for 'ipfs key list'#11147
lidel merged 4 commits intoipfs:masterfrom
VedantMadane:feat/key-ls-alias

Conversation

@VedantMadane
Copy link
Copy Markdown
Contributor

Summary

Fixes #10976 - Add ipfs key ls as an alias for ipfs key list.

Problem

The CLI is inconsistent with list vs ls. Commands like ipfs repo and ipfs pin use ls instead of list, but ipfs key only supports list.

Solution

Add ls as an alias for the list subcommand in ipfs key to be consistent with other ipfs commands.

Changes

  • Added "ls": keyListCmd to the subcommands map in core/commands/keystore.go

Testing

# Before (would fail)
$ ipfs key ls
Error: unknown subcommand "ls"

# After (works the same as 'list')
$ ipfs key ls
self
mykey

Add 'ls' as an alias for the 'list' subcommand in 'ipfs key' to be
consistent with other ipfs commands like 'ipfs repo ls' and
'ipfs pin ls' which use 'ls' instead of 'list'.

Fixes ipfs#10976

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
@VedantMadane VedantMadane requested a review from a team as a code owner January 15, 2026 09:02
@lidel lidel self-assigned this Jan 30, 2026
lidel added 2 commits January 30, 2026 17:06
aligns with other commands like 'ipfs pin ls' and 'ipfs files ls'.
'ipfs key list' still works but shows deprecation warning.
was copy-pasted from sign command and said "signing" instead of "verifying"
Copy link
Copy Markdown
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I made a few changes on top to align with how we handle CLI consistency:

  • Made ls the canonical command and deprecated list (shows warning in --help)
  • Updated help text examples to use ipfs key ls
  • Updated client/rpc to use key/ls endpoint for consistency with pin/ls, pubsub/ls
  • Added test expectation for the new subcommand
  • Combined with other key improvements in changelog

Also snuck in a typo fix for ipfs key verify --help (said "signing" instead of "verifying").

@lidel lidel merged commit 59b5d6a into ipfs:master Jan 30, 2026
23 of 24 checks passed
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.

ipfs key ls as an alias for ipfs key list

3 participants