The ConfigCat Command Line Interface (CLI) allows you to interact with the Public Management API via the command line. It supports most functionality found on the ConfigCat Dashboard. You can manage ConfigCat resources like Feature Flags, Targeting / Percentage rules, Products, Configs, Environments, and more.
This is the Command Line Tool of ConfigCat.
ConfigCat is a hosted feature flag service: https://configcat.com
For more information, see the documentation here: https://configcat.com/docs/advanced/cli
configcat [options] [command]
-v, --verbose Print detailed execution information
-ni, --non-interactive Turn off progress rendering and interactive features
--version Show version information
-?, -h, --help Show help and usage information
setup Setup the CLI with Public Management API host and credentials
ls List all Product, Config, and Environment IDs
p, product Manage Products
c, config Manage Configs
e, environment Manage Environments
f, flag, s, setting Manage Feature Flags & Settings
seg, segment Manage Segments
pg, permission-group Manage Permission Groups
m, member Manage Members
t, tag Manage Tags
k, sdk-key List SDK Keys
scan <directory> Scan files for Feature Flag & Setting usages
Use "configcat [command] -?" for more information about a command.
See the command reference documentation for more information about each available command.
The following instructions will guide you through the first steps to start using this tool.
You can install the CLI on multiple operating systems using the following sources.
Homebrew (macOS / Linux)
Install the CLI with Snapcraft by executing the following command:
sudo snap install configcat
Install the CLI with Chocolatey by executing the following command:
choco install configcat
The CLI can be executed from a Docker image.
docker pull configcat/cli
An example of how to scan a repository for feature flag & setting references with the docker image.
docker run --rm \
--env CONFIGCAT_API_HOST=<API-HOST> \
--env CONFIGCAT_API_USER=<API-USER> \
--env CONFIGCAT_API_PASS=<API-PASSWORD> \
-v /path/to/repository:/repository \
configcat/cli scan "/repository" --print --config-id <CONFIG-ID>
On Unix platforms, you can install the CLI by executing an install script.
curl -fsSL "https://raw.githubusercontent.com/configcat/cli/main/scripts/install.sh" | bash
By default, the script downloads the OS specific artifact from the latest GitHub Release with
curl and moves it into the
It might happen, that you don't have permissions to write into
/usr/local/bin, then you should execute the install script with
curl -fsSL "https://raw.githubusercontent.com/configcat/cli/main/scripts/install.sh" | sudo bash
The script accepts the following input parameters:
|The directory where the CLI should be installed.|
|The desired version to install.|
|The desired architecture to install.|
The possible architecture values for Linux:
For macOS, the architecture is fixed to
x64, but we plan to support Apple silicon in the future.
Script usage examples:
Custom installation directory:
curl -fsSL "https://raw.githubusercontent.com/configcat/cli/main/scripts/install.sh" | bash -s -- -d=/path/to/install
Install a different version:
curl -fsSL "https://raw.githubusercontent.com/configcat/cli/main/scripts/install.sh" | bash -s -- -v=1.4.2
Install with custom architecture:
curl -fsSL "https://raw.githubusercontent.com/configcat/cli/main/scripts/install.sh" | bash -s -- -a=arm
You can download the executables directly from GitHub Releases for your desired platform.
After a successful installation, the CLI must be configured with your ConfigCat Management API credentials.
You can do this by using the
configcat setup command.
Besides the configuration command above, the CLI can read your credentials from the following environment variables.
|The Management API host. (default: api.configcat.com)|
|The Management API basic authentication username.|
|The Management API basic authentication password.|
When any of these environment variables are set, the CLI will use them over the local values set by the
configcat setup command.
The CLI supports both interactive and argument driven execution. When no arguments provided for a command and user input is enabled (stdout is not redirected), the CLI automatically activates interactive mode.
The same operation with command arguments would look like this:
configcat flag create \
--config-id <config-id> \
--name "My awesome feature" \
--hint "This is my awesome feature" \
--type boolean \
--tag-ids <tag-id-1> <tag-id-2> \
create command writes the newly created resource's ID to the standard output, that you can save for further operations.
You can change the output format of several command's result to JSON with the
--json option, like:
configcat flag ls --json. See more about these commands in the command reference documentation.
Scan & Upload Code References
The CLI has the ability to scan your source code for feature flag and setting usages and upload the found code references to ConfigCat. You can read more about this feature here.
Here are a few examples showing the true power of the CLI.
Create a Feature Flag
The following example shows how you can create a Feature Flag in a specific Config.
The following example shows how you can update the value of a Feature Flag in a specific Environment.
Add targeting rules
The following example shows how you can add targeting rules to a Feature Flag.
Add percentage rules
The following example shows how you can set percentage rules on a Feature Flag.