Skip to main content
1

Choose your installation method

Kosli CLI can be installed from package managers, by Curling pre-built binaries, or can be used from the distributed Docker images.
You can download the correct Kosli CLI for your platform, given that you can run shell scripts on it, by invoking this one-line script:
curl -fL https://raw.githubusercontent.com/kosli-dev/cli/refs/heads/main/install-cli.sh | sh
2

Verifying the installation worked

Run this command:
kosli version
The expected output should be similar to this:
version.BuildInfo{Version:"{{< cli-version >}}", GitCommit:"Homebrew", GitTreeState:"clean", GoVersion:"go1.23.4"}

Using the CLI

The CLI Reference section contains all the information you may need to run the Kosli CLI. The CLI flags offer flexibility for configuration and can be assigned in three distinct manners:
  1. Directly on the command line.
  2. Via environment variables.
  3. Within a config file.
Among these options, priority is given in the following order: Option 1 holds the highest precedence, followed by Option 2, with Option 3 being the least prioritized.

Assigning flags via environment variables

To assign a CLI flag using environment variables, generate a variable prefixed with KOSLI_. Use the flag’s name in uppercase and substitute any internal dashes with underscores. For instance:
  • --api-token corresponds to KOSLI_API_TOKEN
  • --org corresponds to KOSLI_ORG

Assigning flags via config files

A config file is an alternative to using Kosli flags or environment variables. You could use a config file for the values that rarely change - like API token or org, but you can represent all Kosli flags in a config file. Each key in the config file corresponds to the flag name, capitalized. For instance:
  • --api-token would become API-TOKEN.
  • --org would become ORG.
Config files can be written in JSON, YAML, or TOML formats. To direct Kosli CLI to use a config file, employ the —config-file flag when executing Kosli commands. By default, the CLI looks for a config file called kosli.<yaml/yml/json/toml> Below are examples of different config file formats:
{
  "ORG": "my-org",
  "API-TOKEN": "123456abcdef"
}
When using the --config-file flag you can skip the file extension. For example, to list environments with org and api-token in the configuration file you would run:
kosli list environments --config-file=kosli-conf
Last modified on March 10, 2026