Command line¶
When installing opsdroid a command line utility is created for starting the bot and managing the bot configuration.
$ opsdroid start
Reference¶
opsdroid¶
Opsdroid is a chat bot framework written in Python.
It is designed to be extendable, scalable and simple. See https://opsdroid.github.io/ for more information.
opsdroid [OPTIONS] COMMAND [ARGS]...
config¶
Subcommands related to opsdroid configuration.
opsdroid config [OPTIONS] COMMAND [ARGS]...
Options
- -f <path>¶
Load a configuration from a path instead of using the default location.
build¶
Load configuration, load modules and install dependencies.
This function loads the configuration and install all necessary
dependencies defined on a requirements.txt
file inside the module.
If the flag --verbose
is passed the logging level will be set as debug and
all logs will be shown to the user.
- Args:
ctx (
click.Context
): The current click cli context. verbose (bool): set the logging level to debug.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid config build [OPTIONS]
Options
- --verbose¶
Turns logging level to debug to see all logging messages.
edit¶
Open config file with your favourite editor.
By default this command will open the configuration file with
vi/vim. If you have a different editor that you would like to sure,
you need to change the environment variable - EDITOR
.
- Args:
ctx (
click.Context
): The current click cli context.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid config edit [OPTIONS]
gen¶
Print out the example config.
Open the example configuration file and print it into the terminal.
If the -f flag was used with the config command, then this path will be
set on ctx.obj
and will be passed into this subcommand and the contents
of the file set in the path will be print into the terminal instead.
- Args:
ctx (
click.Context
): The current click cli context.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid config gen [OPTIONS]
lint¶
Validate the configuration.
This subcommand allows you to validate your configuration or a configuration from a file if the -f flag is used. This avoids the need to start the bot just to have it crash because of a configuration error.
This command could also be helpful if you need to do changes to the configuration but you are unsure if everything is set correct. You could have the new config file located somewhere and test it before using it to start opsdroid.
- Args:
ctx (
click.Context
): The current click cli context.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid config lint [OPTIONS]
list-modules¶
Print out a list of all active modules.
This function will try to get information from the modules that are active in the configuration file and print them as a table or will just print a sentence saying that there are no active modules for that type.
- Args:
ctx (
click.Context
): The current click cli context.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid config list-modules [OPTIONS]
logs¶
Print the content of the log file into the terminal.
Open opsdroid logs and prints the contents of the file into the terminal.
If you wish to follow the logs in real time you can use the -f
flag which
will allow you to do this.
- Args:
ctx (
click.Context
): The current click cli context. follow(bool): Set by the-f
flag to trigger the print of the logs in real time.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid logs [OPTIONS] COMMAND [ARGS]...
Options
- -f¶
Print the logs in real time
start¶
Start the opsdroid bot.
If the -f
flag is used with this command, opsdroid will load the
configuration specified on that path otherwise it will use the default
configuration.
opsdroid start [OPTIONS]
Options
- -f <path>¶
Load a configuration from a path instead of using the default location.
version¶
Print out the version of opsdroid that is installed and exits.
- Args:
ctx (
click.Context
): The current click cli context.- Returns:
int: the exit code. Always returns 0 in this case.
opsdroid version [OPTIONS]