Skip to content

CLI reference

Commands use this form

Command syntax
telegram-commander <command> [flags]

--config / -c is required for commands that load configuration. The path may be relative to the current working directory or absolute. What goes in that file is documented in Configuration.

If you are just getting started, Run in CLI shows these commands in the order you will use them.

Commands

run

Run the bot in the foreground.

Start the bot in the foreground

Run the bot
telegram-commander run --config /path/to/configfile.yaml

Config changes need a restart

The bot reads the config once at start. After you edit the file, restart the process (for example systemctl restart telegram-commander).

validate

Validate config, functions, and button references offline.

Check the config offline or online

Validate the config
telegram-commander validate --config /path/to/configfile.yaml
telegram-commander validate --config /path/to/configfile.yaml --online

--online needs internet

With --online the check also asks Telegram whether the bot token works, so the machine must be able to reach Telegram.

version

Print the program version.

fmt

Pretty-print a YAML config file.

Print or save formatted YAML

Format a config file
telegram-commander fmt --config /path/to/configfile.yaml
telegram-commander fmt --config /path/to/configfile.yaml -w

environ

Print process environment variables (useful for debugging service units).

list-functions

List built-in and loaded custom functions. Use it to confirm your custom function files were found. See Functions.

Show every available function

List available functions
telegram-commander list-functions --config /path/to/configfile.yaml

completion

Generate shell completion scripts:

Choose the shell you use

Generate a completion script
telegram-commander completion bash
telegram-commander completion zsh
telegram-commander completion fish
telegram-commander completion powershell

manpage

Write a man page to stdout.