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]...

Options

--gen-config

[Deprecated] Print an example config and exit.

-v, --version

[Deprecated] Print the version and exit.

-e, --edit-config

[Deprecated] Open configuration.yaml with your favorite editor and exits.

-l, --view-log

[Deprecated] Open opsdroid logs with your favorite editor and exits.

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.

This is a pretty basic function that will simply open your opsdroid configuration file and prints the whole thing into the terminal. You can also use the -f flag to generate a config from a path instead of using the default config location.

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

Open the log 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.

This file will be updated if you are using the configuration option logging.path. Notice that depending on your logging.level and how long you run opsdroid, this file will grow quite quickly.

Args:

ctx (click.Context): The current click cli context.

Returns:

int: the exit code. Always returns 0 in this case.

opsdroid logs [OPTIONS]

start

Start the opsdroid bot.

opsdroid start [OPTIONS]

Options

-f <path>

Load a configuration from a path instead of using the default location.

version

Print the version and exit.

opsdroid version [OPTIONS]