Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 40 additions & 15 deletions bittensor_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ def __init__(self):
self.config_path = os.path.expanduser(defaults.config.path)

self.app = typer.Typer(
rich_markup_mode="rich", callback=self.main_callback, epilog=_epilog
rich_markup_mode="rich",
callback=self.main_callback,
epilog=_epilog,
no_args_is_help=True,
)
self.config_app = typer.Typer(epilog=_epilog)
self.wallet_app = typer.Typer(epilog=_epilog)
Expand All @@ -437,61 +440,80 @@ def __init__(self):
self.config_app,
name="config",
short_help="Config commands, aliases: `c`, `conf`",
no_args_is_help=True,
)
self.app.add_typer(self.config_app, name="conf", hidden=True)
self.app.add_typer(self.config_app, name="c", hidden=True)
self.app.add_typer(
self.config_app, name="conf", hidden=True, no_args_is_help=True
)
self.app.add_typer(self.config_app, name="c", hidden=True, no_args_is_help=True)

# wallet aliases
self.app.add_typer(
self.wallet_app,
name="wallet",
short_help="Wallet commands, aliases: `wallets`, `w`",
no_args_is_help=True,
)
self.app.add_typer(self.wallet_app, name="w", hidden=True, no_args_is_help=True)
self.app.add_typer(
self.wallet_app, name="wallets", hidden=True, no_args_is_help=True
)
self.app.add_typer(self.wallet_app, name="w", hidden=True)
self.app.add_typer(self.wallet_app, name="wallets", hidden=True)

# root aliases
self.app.add_typer(
self.root_app,
name="root",
short_help="Root commands, alias: `r`",
no_args_is_help=True,
)
self.app.add_typer(self.root_app, name="r", hidden=True)
self.app.add_typer(self.root_app, name="r", hidden=True, no_args_is_help=True)

# stake aliases
self.app.add_typer(
self.stake_app,
name="stake",
short_help="Stake commands, alias: `st`",
no_args_is_help=True,
)
self.app.add_typer(self.stake_app, name="st", hidden=True)
self.app.add_typer(self.stake_app, name="st", hidden=True, no_args_is_help=True)

# sudo aliases
self.app.add_typer(
self.sudo_app,
name="sudo",
short_help="Sudo commands, alias: `su`",
no_args_is_help=True,
)
self.app.add_typer(self.sudo_app, name="su", hidden=True)
self.app.add_typer(self.sudo_app, name="su", hidden=True, no_args_is_help=True)

# subnets aliases
self.app.add_typer(
self.subnets_app,
name="subnets",
short_help="Subnets commands, alias: `s`, `subnet`",
no_args_is_help=True,
)
self.app.add_typer(
self.subnets_app, name="s", hidden=True, no_args_is_help=True
)
self.app.add_typer(
self.subnets_app, name="subnet", hidden=True, no_args_is_help=True
)
self.app.add_typer(self.subnets_app, name="s", hidden=True)
self.app.add_typer(self.subnets_app, name="subnet", hidden=True)

# weights aliases
self.app.add_typer(
self.weights_app,
name="weights",
short_help="Weights commands, aliases: `wt`, `weight`",
hidden=True,
no_args_is_help=True,
)
self.app.add_typer(
self.weights_app, name="wt", hidden=True, no_args_is_help=True
)
self.app.add_typer(
self.weights_app, name="weight", hidden=True, no_args_is_help=True
)
self.app.add_typer(self.weights_app, name="wt", hidden=True)
self.app.add_typer(self.weights_app, name="weight", hidden=True)

# config commands
self.config_app.command("set")(self.set_config)
Expand Down Expand Up @@ -613,8 +635,11 @@ def __init__(self):
name="child",
short_help="Child Hotkey commands, alias: `children`",
rich_help_panel=HELP_PANELS["STAKE"]["CHILD"],
no_args_is_help=True,
)
self.stake_app.add_typer(
children_app, name="children", hidden=True, no_args_is_help=True
)
self.stake_app.add_typer(children_app, name="children", hidden=True)
children_app.command("get")(self.stake_get_children)
children_app.command("set")(self.stake_set_children)
children_app.command("revoke")(self.stake_revoke_children)
Expand Down Expand Up @@ -2862,9 +2887,9 @@ def root_list_delegates(

[green]$[/green] btcli root list_delegates

[green]$[/green] btcli root list_delegates --wallet-name my_wallet
[green]$[/green] btcli root list_delegates

[green]$[/green] btcli root list_delegates --subtensor.network finney # can also be `test` or `local`
[green]$[/green] btcli root list_delegates --network finney # can also be `test` or `local`

[blue bold]NOTE[/blue bold]: This commmand is intended for use within a
console application. It prints directly to the console and does not return any value.
Expand Down