Skip to main content

CLI

warning

The CLI client uses the REST API, so in order to be able to use it, make sure that the "api" module is enabled in your Sonar server's config.toml file.

See Server: Configuration file

Installation

$ brew install nt0xa/sonar/sonar

API token

Configration file

To start using the CLI, you must first create the configuration file at ~/.config/sonar/config.toml. To configure sever you only need two values:

  • <DOMAIN> — your server's domain.

  • <TOKEN> — your user's token. If you are the one who deployed the server, you can use the token from the Server: Configuration file. Otherwise, you can go to the configured messenger and use the /profile command to get your token.

    Getting token in TelegramGetting token in Telegram

Here is an example configuration:

~/.config/sonar/config.toml
[servers]
[servers.myserver1]
token = "<TOKEN>"
url = "https://<DOMAIN>:31337"

# You can add another server here, if you have more than one.
# [servers.myserver2]
# token = "<TOKEN2>"
# url = "https://<DOMAIN2>:31337"

[context]
# The server that is currently active.
server = "myserver1"