Skip to content

Configuration File

The configuration file is a TOML file that holds the target instance address and the authentication credentials of tlm-cli.

This file and its search paths belong to the CLI: the tlm-cloud-sdk library reads no configuration file, as described in Session and Token Storage.

File Location

The CLI searches for the configuration file in the following directories, in order:

Priority Path
1 Current working directory (./)
2 ~/.config/tlm-cli/
3 /etc/tlm-cli/

The first file found is used. The default filename is .config.toml. Override it with the TLM_CONFIG_FILENAME environment variable:

TLM_CONFIG_FILENAME=my-instance.toml tlm-cli pms devices list

The global option --config / -c skips the search and uses the given file instead:

tlm-cli --config ./my-instance.toml pms devices list

File Format

[application]
instance = "your-instance.example.com"

[auth]
username = "user@example.com"
password = "your-password"

Fields

[application]

Field Type Required Description
instance string Yes Hostname of the ToloMEO Manager instance, e.g. tolomeo.io. Do not include https:// or a trailing slash.

The client derives all API base URLs from this value:

  • Resource APIs: https://apis.<instance>
  • Authentication: https://accounts.<instance>

[auth]

Field Type Required Description
username string Yes Email address used to authenticate against the instance.
password string Yes Password for the account.

Example

Create ~/.config/tlm-cli/.config.toml and fill in your actual values:

[application]
instance = "your-instance.example.com"

[auth]
username = "you@example.com"
password = "your-password"

If you are working from a cloned repository, a .config.toml.sample file is provided at the repository root as a starting point.

Security

The configuration file contains plaintext credentials. Restrict its permissions to the owning user:

chmod 600 ~/.config/tlm-cli/.config.toml

Token Cache

The CLI caches the login token in ~/.tlm-cli/token.json, one entry per instance and username, so it authenticates only when no valid token is cached.

Runtime Options

These options control CLI behavior at runtime and are independent of the TOML config file.

Option Type Default Description
--config / -c path — Use this configuration file instead of searching the paths above.
--plain / TLM_CLI_PLAIN bool false Emit plain JSON output; see Output Mode.
TLM_CONFIG_FILENAME string — Filename to search for instead of .config.toml.

Output Mode

Mechanism How to use
--plain flag tlm-cli --plain pms devices list
TLM_CLI_PLAIN env var TLM_CLI_PLAIN=1 tlm-cli pms devices list
Automatic (non-TTY stdout) Pipe or redirect stdout: tlm-cli pms devices list \| jq

When plain mode is active:

  • stdout emits newline-delimited JSON: arrays for list commands, objects for show/detail commands.
  • stderr emits warning: and error: prefixed plain-text messages.
  • Interactive prompts, TUI editors, progress spinners, and Rich formatting are all disabled.

Plain mode activates automatically whenever stdout is not a TTY — for example in Docker containers without an attached terminal, CI pipelines, or shell redirects. You do not need to set --plain explicitly when piping output.

See also