@cryptotaxi247 / kubo / commits / 59b5d6ab4

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

* feat(key): add 'ipfs key ls' as alias for 'ipfs key list' 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 #10976 Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> * feat(key): make 'ipfs key ls' canonical, deprecate 'list' aligns with other commands like 'ipfs pin ls' and 'ipfs files ls'. 'ipfs key list' still works but shows deprecation warning. * fix(key): correct --key option description in verify command was copy-pasted from sign command and said "signing" instead of "verifying" --------- Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Co-authored-by: Marcin Rataj <lidel@lidel.org>

Vedant Madane committed Jan 31, 2026 at 00:09 UTC 59b5d6ab4da8d7a2bebaa2e1eb7b82cbce476503
4 files changed +23 -8
client/rpc/key.go
+1 -1
@@ -101,7 +101,7 @@ func (api *KeyAPI) List(ctx context.Context) ([]iface.Key, error) {
101 var out struct {
102 Keys []keyOutput
103 }
104 - if err := api.core().Request("key/list").Exec(ctx, &out); err != nil {
104 + if err := api.core().Request("key/ls").Exec(ctx, &out); err != nil {
105 return nil, err
106 }
107
core/commands/commands_test.go
+1
@@ -106,6 +106,7 @@ func TestCommands(t *testing.T) {
106 "/key/gen",
107 "/key/import",
108 "/key/list",
109 + "/key/ls",
110 "/key/rename",
111 "/key/rm",
112 "/key/rotate",
core/commands/keystore.go
+16 -4
@@ -38,9 +38,9 @@ publish'.
38 > ipfs key gen --type=rsa --size=2048 mykey
39 > ipfs name publish --key=mykey QmSomeHash
40
41 -'ipfs key list' lists the available keys.
41 +'ipfs key ls' lists the available keys.
42
43 - > ipfs key list
43 + > ipfs key ls
44 self
45 mykey
46 `,
@@ -49,7 +49,8 @@ publish'.
49 "gen": keyGenCmd,
50 "export": keyExportCmd,
51 "import": keyImportCmd,
52 - "list": keyListCmd,
52 + "list": keyListDeprecatedCmd,
53 + "ls": keyListCmd,
54 "rename": keyRenameCmd,
55 "rm": keyRmCmd,
56 "rotate": keyRotateCmd,
@@ -488,6 +489,17 @@ var keyListCmd = &cmds.Command{
489 Type: KeyOutputList{},
490 }
491
492 +var keyListDeprecatedCmd = &cmds.Command{
493 + Status: cmds.Deprecated,
494 + Helptext: cmds.HelpText{
495 + Tagline: "Deprecated: use 'ipfs key ls' instead.",
496 + },
497 + Options: keyListCmd.Options,
498 + Run: keyListCmd.Run,
499 + Encoders: keyListCmd.Encoders,
500 + Type: keyListCmd.Type,
501 +}
502 +
503 const (
504 keyStoreForceOptionName = "force"
505 )
@@ -773,7 +785,7 @@ the signed payload is always prefixed with "libp2p-key signed message:".
785 `,
786 },
787 Options: []cmds.Option{
776 - cmds.StringOption("key", "k", "The name of the key to use for signing."),
788 + cmds.StringOption("key", "k", "The name of the key to use for verifying."),
789 cmds.StringOption("signature", "s", "Multibase-encoded signature to verify."),
790 ke.OptionIPNSBase,
791 },
docs/changelogs/v0.40.md
+5 -3
@@ -17,7 +17,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team.
17 - [New `ipfs diag datastore` commands](#new-ipfs-diag-datastore-commands)
18 - [🚇 Improved `ipfs p2p` tunnels with foreground mode](#-improved-ipfs-p2p-tunnels-with-foreground-mode)
19 - [Improved `ipfs dag stat` output](#improved-ipfs-dag-stat-output)
20 - - [Skip bad keys when listing](#skip_bad_keys_when_listing)
20 + - [🔑 `ipfs key` improvements](#-ipfs-key-improvements)
21 - [Accelerated DHT Client and Provide Sweep now work together](#accelerated-dht-client-and-provide-sweep-now-work-together)
22 - [🌐 No unnecessary DNS lookups for AutoTLS addresses](#-no-unnecessary-dns-lookups-for-autotls-addresses)
23 - [⏱️ Configurable gateway request duration limit](#️-configurable-gateway-request-duration-limit)
@@ -111,9 +111,11 @@ Ratio: 1.500000
111
112 Use `--progress=true` to force progress even when piped, or `--progress=false` to disable it.
113
114 -#### Skip bad keys when listing
114 +#### 🔑 `ipfs key` improvements
115
116 -Change the `ipfs key list` behavior to log an error and continue listing keys when a key cannot be read from the keystore or decoded.
116 +`ipfs key ls` is now the canonical command for listing keys, matching `ipfs pin ls` and `ipfs files ls`. The old `ipfs key list` still works but is deprecated.
117 +
118 +Listing also became more resilient: bad keys are now skipped with an error log instead of failing the entire operation.
119
120 #### Accelerated DHT Client and Provide Sweep now work together
121