diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index b5a0837430ff..572d7817418a 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#22443](https://github.com/cosmos/cosmos-sdk/pull/22443) Add keyring flags in query commands. * [#21936](https://github.com/cosmos/cosmos-sdk/pull/21936) Print possible enum values in error message after an invalid input was provided. ### Bug Fixes diff --git a/client/v2/autocli/app.go b/client/v2/autocli/app.go index c3bccd557306..607f9052d25c 100644 --- a/client/v2/autocli/app.go +++ b/client/v2/autocli/app.go @@ -72,8 +72,11 @@ func (appOptions AppOptions) EnhanceRootCommand(rootCmd *cobra.Command) error { GetClientConn: func(cmd *cobra.Command) (grpc.ClientConnInterface, error) { return client.GetClientQueryContext(cmd) }, - AddQueryConnFlags: sdkflags.AddQueryFlagsToCmd, - AddTxConnFlags: sdkflags.AddTxFlagsToCmd, + AddQueryConnFlags: func(c *cobra.Command) { + sdkflags.AddQueryFlagsToCmd(c) + sdkflags.AddKeyringFlags(c.Flags()) + }, + AddTxConnFlags: sdkflags.AddTxFlagsToCmd, } return appOptions.EnhanceRootCommandWithBuilder(rootCmd, builder)