cosmos/autocli

Table of Contents

cosmos/autocli/v1/options.proto

Top

FlagOptions

FlagOptions are options for flags generated from rpc request fields.

By default, all request fields are configured as flags based on the

kebab-case name of the field. Fields can be turned into positional arguments

instead by using RpcCommandOptions.positional_args.

FieldTypeLabelDescription
name string

name is an alternate name to use for the field flag.

shorthand string

shorthand is a one-letter abbreviated flag.

usage string

usage is the help message.

default_value string

default_value is the default value as text.

deprecated string

deprecated is the usage text to show if this flag is deprecated.

shorthand_deprecated string

shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated.

hidden bool

hidden hides the flag from help/usage text

ModuleOptions

ModuleOptions describes the CLI options for a Cosmos SDK module.

FieldTypeLabelDescription
tx ServiceCommandDescriptor

tx describes the tx commands for the module.

query ServiceCommandDescriptor

query describes the queries commands for the module.

PositionalArgDescriptor

PositionalArgDescriptor describes a positional argument.

FieldTypeLabelDescription
proto_field string

proto_field specifies the proto field to use as the positional arg. Any fields used as positional args will not have a flag generated.

varargs bool

varargs makes a positional parameter a varargs parameter. This can only be applied to last positional parameter and the proto_field must a repeated field.

RpcCommandOptions

RpcCommandOptions specifies options for commands generated from protobuf

rpc methods.

FieldTypeLabelDescription
rpc_method string

rpc_method is short name of the protobuf rpc method that this command is generated from.

use string

use is the one-line usage method. It also allows specifying an alternate name for the command as the first word of the usage text. By default the name of an rpc command is the kebab-case short name of the rpc method.

long string

long is the long message shown in the 'help ' output.

short string

short is the short description shown in the 'help' output.

example string

example is examples of how to use the command.

alias string repeated

alias is an array of aliases that can be used instead of the first word in Use.

suggest_for string repeated

suggest_for is an array of command names for which this command will be suggested - similar to aliases but only suggests.

deprecated string

deprecated defines, if this command is deprecated and should print this string when used.

version string

version defines the version for this command. If this value is non-empty and the command does not define a "version" flag, a "version" boolean flag will be added to the command and, if specified, will print content of the "Version" variable. A shorthand "v" flag will also be added if the command does not define one.

flag_options RpcCommandOptions.FlagOptionsEntry repeated

flag_options are options for flags generated from rpc request fields. By default all request fields are configured as flags. They can also be configured as positional args instead using positional_args.

positional_args PositionalArgDescriptor repeated

positional_args specifies positional arguments for the command.

skip bool

skip specifies whether to skip this rpc method when generating commands.

RpcCommandOptions.FlagOptionsEntry

FieldTypeLabelDescription
key string

value FlagOptions

ServiceCommandDescriptor

ServiceCommandDescriptor describes a CLI command based on a protobuf service.

FieldTypeLabelDescription
service string

service is the fully qualified name of the protobuf service to build the command from. It can be left empty if sub_commands are used instead which may be the case if a module provides multiple tx and/or query services.

rpc_command_options RpcCommandOptions repeated

rpc_command_options are options for commands generated from rpc methods. If no options are specified for a given rpc method on the service, a command will be generated for that method with the default options.

sub_commands ServiceCommandDescriptor.SubCommandsEntry repeated

sub_commands is a map of optional sub-commands for this command based on different protobuf services. The map key is used as the name of the sub-command.

ServiceCommandDescriptor.SubCommandsEntry

FieldTypeLabelDescription
key string

value ServiceCommandDescriptor

cosmos/autocli/v1/query.proto

Top

AppOptionsRequest

AppOptionsRequest is the RemoteInfoService/AppOptions request type.

AppOptionsResponse

AppOptionsResponse is the RemoteInfoService/AppOptions response type.

FieldTypeLabelDescription
module_options AppOptionsResponse.ModuleOptionsEntry repeated

module_options is a map of module name to autocli module options.

AppOptionsResponse.ModuleOptionsEntry

FieldTypeLabelDescription
key string

value ModuleOptions

Query

RemoteInfoService provides clients with the information they need

to build dynamically CLI clients for remote chains.

Method NameRequest TypeResponse TypeDescription
AppOptions AppOptionsRequest AppOptionsResponse

AppOptions returns the autocli options for all of the modules in an app.

Scalar Value Types

.proto Type Notes Python Type
double float
float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int/long
uint32 Uses variable-length encoding. int/long
uint64 Uses variable-length encoding. int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. int/long
sfixed32 Always four bytes. int
sfixed64 Always eight bytes. int/long
bool boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. str/unicode
bytes May contain any arbitrary sequence of bytes. str