bittensor.cli#

Attributes#

Classes#

CLIErrorParser

Custom ArgumentParser for better error messages.

cli

Implementation of the Command Line Interface (CLI) class for the Bittensor protocol.

Module Contents#

bittensor.cli.console#
bittensor.cli.ALIAS_TO_COMMAND#
bittensor.cli.COMMANDS#
class bittensor.cli.CLIErrorParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]#

Bases: argparse.ArgumentParser

Custom ArgumentParser for better error messages.

error(message)[source]#

This method is called when an error occurs. It prints a custom error message.

class bittensor.cli.cli(config=None, args=None)[source]#

Implementation of the Command Line Interface (CLI) class for the Bittensor protocol. This class handles operations like key management (hotkey and coldkey) and token transfer.

Initializes a bittensor.CLI object.

Parameters:
  • config (bittensor.config, optional) – The configuration settings for the CLI.

  • args (List[str], optional) – List of command line arguments.

config#
static __create_parser__()[source]#

Creates the argument parser for the Bittensor CLI.

Returns:

An argument parser object for Bittensor CLI.

Return type:

argparse.ArgumentParser

static create_config(args)[source]#

From the argument parser, add config to bittensor.executor and local config

Parameters:

args (List[str]) – List of command line arguments.

Returns:

The configuration object for Bittensor CLI.

Return type:

bittensor.config

static check_config(config)[source]#

Checks if the essential configuration exists under different command

Parameters:

config (bittensor.config) – The configuration settings for the CLI.

run()[source]#

Executes the command from the configuration.