From 11eab347bd368cbb888a78b17b7f0587e63eecd9 Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Thu, 15 Jan 2026 14:30:35 +0530 Subject: [PATCH 1/3] 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> --- core/commands/keystore.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 6ce1b5a0d98..0e0eb7ca281 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -50,6 +50,7 @@ publish'. "export": keyExportCmd, "import": keyImportCmd, "list": keyListCmd, + "ls": keyListCmd, "rename": keyRenameCmd, "rm": keyRmCmd, "rotate": keyRotateCmd, From a7fcb9bad7af42fd2bc7593586c1d1a54a2a05d5 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 30 Jan 2026 17:06:31 +0100 Subject: [PATCH 2/3] 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. --- client/rpc/key.go | 2 +- core/commands/commands_test.go | 1 + core/commands/keystore.go | 17 ++++++++++++++--- docs/changelogs/v0.40.md | 8 +++++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/client/rpc/key.go b/client/rpc/key.go index 710d9fb06d2..a38c0962a2b 100644 --- a/client/rpc/key.go +++ b/client/rpc/key.go @@ -101,7 +101,7 @@ func (api *KeyAPI) List(ctx context.Context) ([]iface.Key, error) { var out struct { Keys []keyOutput } - if err := api.core().Request("key/list").Exec(ctx, &out); err != nil { + if err := api.core().Request("key/ls").Exec(ctx, &out); err != nil { return nil, err } diff --git a/core/commands/commands_test.go b/core/commands/commands_test.go index 49e359e2436..d4bad96012e 100644 --- a/core/commands/commands_test.go +++ b/core/commands/commands_test.go @@ -106,6 +106,7 @@ func TestCommands(t *testing.T) { "/key/gen", "/key/import", "/key/list", + "/key/ls", "/key/rename", "/key/rm", "/key/rotate", diff --git a/core/commands/keystore.go b/core/commands/keystore.go index 0e0eb7ca281..e2a5ba4380c 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -38,9 +38,9 @@ publish'. > ipfs key gen --type=rsa --size=2048 mykey > ipfs name publish --key=mykey QmSomeHash -'ipfs key list' lists the available keys. +'ipfs key ls' lists the available keys. - > ipfs key list + > ipfs key ls self mykey `, @@ -49,7 +49,7 @@ publish'. "gen": keyGenCmd, "export": keyExportCmd, "import": keyImportCmd, - "list": keyListCmd, + "list": keyListDeprecatedCmd, "ls": keyListCmd, "rename": keyRenameCmd, "rm": keyRmCmd, @@ -489,6 +489,17 @@ var keyListCmd = &cmds.Command{ Type: KeyOutputList{}, } +var keyListDeprecatedCmd = &cmds.Command{ + Status: cmds.Deprecated, + Helptext: cmds.HelpText{ + Tagline: "Deprecated: use 'ipfs key ls' instead.", + }, + Options: keyListCmd.Options, + Run: keyListCmd.Run, + Encoders: keyListCmd.Encoders, + Type: keyListCmd.Type, +} + const ( keyStoreForceOptionName = "force" ) diff --git a/docs/changelogs/v0.40.md b/docs/changelogs/v0.40.md index ca7fede8484..c9d72bdade7 100644 --- a/docs/changelogs/v0.40.md +++ b/docs/changelogs/v0.40.md @@ -17,7 +17,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team. - [New `ipfs diag datastore` commands](#new-ipfs-diag-datastore-commands) - [🚇 Improved `ipfs p2p` tunnels with foreground mode](#-improved-ipfs-p2p-tunnels-with-foreground-mode) - [Improved `ipfs dag stat` output](#improved-ipfs-dag-stat-output) - - [Skip bad keys when listing](#skip_bad_keys_when_listing) + - [🔑 `ipfs key` improvements](#-ipfs-key-improvements) - [Accelerated DHT Client and Provide Sweep now work together](#accelerated-dht-client-and-provide-sweep-now-work-together) - [⏱️ Configurable gateway request duration limit](#️-configurable-gateway-request-duration-limit) - [🔧 Recovery from corrupted MFS root](#-recovery-from-corrupted-mfs-root) @@ -110,9 +110,11 @@ Ratio: 1.500000 Use `--progress=true` to force progress even when piped, or `--progress=false` to disable it. -#### Skip bad keys when listing +#### 🔑 `ipfs key` improvements -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. +`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. + +Listing also became more resilient: bad keys are now skipped with an error log instead of failing the entire operation. #### Accelerated DHT Client and Provide Sweep now work together From 20dc6ed5f5f3da5077b396757f47d6c4e1b3807b Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 30 Jan 2026 17:10:11 +0100 Subject: [PATCH 3/3] fix(key): correct --key option description in verify command was copy-pasted from sign command and said "signing" instead of "verifying" --- core/commands/keystore.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/commands/keystore.go b/core/commands/keystore.go index e2a5ba4380c..afcdb62db5b 100644 --- a/core/commands/keystore.go +++ b/core/commands/keystore.go @@ -785,7 +785,7 @@ the signed payload is always prefixed with "libp2p-key signed message:". `, }, Options: []cmds.Option{ - cmds.StringOption("key", "k", "The name of the key to use for signing."), + cmds.StringOption("key", "k", "The name of the key to use for verifying."), cmds.StringOption("signature", "s", "Multibase-encoded signature to verify."), ke.OptionIPNSBase, },