diff --git a/docs/docs/building-modules/09-autocli.md b/docs/docs/building-modules/09-autocli.md index 1de895d2a3f6..a3c464b2613b 100644 --- a/docs/docs/building-modules/09-autocli.md +++ b/docs/docs/building-modules/09-autocli.md @@ -104,25 +104,6 @@ https://github.com/cosmos/cosmos-sdk/blob/bcdf81cbaf8d70c4e4fa763f51292d54aed689 With this configuration, you can invoke the `GetTest` method by running `./app tx myservice get test`, and you can invoke the `GetTest2` method by running `./app tx myservice get test2`. -### Adding Custom Commands - -Although `autocli` can automatically generate CLI commands and flags based on your protobuf messages, you may want to add custom commands to your CLI application. To add a custom command, you can use the `AddCommand()` method provided by `cobra`. For instance, to add a custom `test` command to your CLI application, you can use the following code: - -``` go -rootCmd := autocli.RootCmd(appOptions) -rootCmd.AddCommand(&cobra.Command{ - Use: "test", - Short: "custom test command", - RunE: func(cmd *cobra.Command, args []string) error { - // custom command logic here - return nil - }, -}) - -``` - -This will add a new `test` command to your CLI application that can be invoked by running `./app test`. - ## Customising Flag Names By default, `autocli` generates flag names based on the names of the fields in your protobuf message. However, you can customise the flag names by providing a `FlagOptions` parameter to the `Builder.AddMessageFlags()` method. This parameter allows you to specify custom names for flags based on the names of the message fields. For example, if you have a message with the fields `test` and `test1`, you can use the following naming options to customise the flags