cli package¶
Submodules¶
cli.cli module¶
- class cli.cli.CLI(name, no_welcome_message=False, command_not_found_message='Command not found.')¶
Bases:
objectThe CLI class it self, this will represent your cli.
- Parameters
name (
str) – The name of your CLIno_welcome_message (
bool) – Choose if you want to display a welcome message or not.command_not_found_message (
str) – Pick whatever error message you want to print out when a command is not found.
- command(name=None, description=None, aliases=[])¶
Make a command for your cli.
- Parameters
name (
str) – The name of the command, Default to the name of your function.description (
str) – The description of the command, Defaults to the function’s doc.aliases (
List[str]) – A list of strings that contains the name of the aliases you want.
- group(name=None, description=None, aliases=[])¶
Make a command group for your cli.
- Parameters
name (
str) – The name of the group, Default to the name of your function.description (
str) – The description of the group, Defaults to the function’s doc.aliases (
List[str]) – A list of strings that contains the name of the aliases you want.
- run(interactive=True)¶
Run your cli.
- Parameters
interactive (
bool) – Pick if the cli should be interactive or not, if set to false you will do likepython3 main.py command_name.
- get_command(name)¶
- remove_command(name)¶
Remove a command.
- Parameters
name (
str) – The name of the command that you want to remove.
- show_help()¶
- add_shard(shard)¶
Add a shard to the cli.
- Parameters
shard (
cli.cli.ext.shard.Shard) – The shard you want to add
cli.commands module¶
- class cli.commands.CommandGroup(**kwargs)¶
Bases:
cli.commands.Command- command(name=None, description=None, aliases=[])¶
- get_subcommand(name)¶