Skip to content
/ cli Public

Command Line Interface for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.

License

Notifications You must be signed in to change notification settings

configcat/cli

Repository files navigation

Command Line Interface for ConfigCat

ConfigCat CLI CI

The ConfigCat Command Line Interface 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.

ConfigCat CLI Feature Flag Create

See the command reference documentation for more information about each available command.

Getting Started

The following instructions will guide you through the first steps to start using this tool.

Installation

You can install the CLI on multiple operating systems using the following methods.

Homebrew (macOS / Linux)

Install the CLI with Homebrew from ConfigCat's tap by executing the following command:

brew tap configcat/tap
brew install configcat
Snap (Linux)

Install the CLI with Snapcraft by executing the following command:

sudo snap install configcat
Scoop (Windows)

Install the CLI with Scoop from ConfigCat's bucket by executing the following command:

scoop bucket add configcat https://github.com/configcat/scoop-configcat
scoop install configcat
Chocolatey (Windows)

Install the CLI with Chocolatey by executing the following command:

choco install configcat
.NET tool / NuGet.org

The CLI can be installed as a .NET tool via the .NET SDK.

dotnet tool install -g configcat-cli

After installing, you can execute the CLI using the configcat command:

configcat scan "/repository" --print --config-id <CONFIG-ID>
Docker

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>
Install Script

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 /usr/local/bin directory.

It might happen, that you don't have permissions to write into /usr/local/bin, then you should execute the install script with sudo.

curl -fsSL "https://raw.githubusercontent.com/configcat/cli/main/scripts/install.sh" | sudo bash

The script accepts the following input parameters:

Parameter Description Default value
-d, --dir The directory where the CLI should be installed. /usr/local/bin
-v, --version The desired version to install. latest
-a, --arch The desired architecture to install. x64

Available architecture values for Linux: x64, musl-x64, musl-arm64, arm, arm64.

Available architecture values for macOS: x64, arm64.

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
Standalone executables

You can download the executables directly from GitHub Releases for your desired platform.

Configuration

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.

ConfigCat CLI

Environment Variables

Besides the configuration command above, the CLI can read your credentials from the following environment variables.

Name Description
CONFIGCAT_API_HOST The Management API host. (default: api.configcat.com)
CONFIGCAT_API_USER The Management API basic authentication username.
CONFIGCAT_API_PASS 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.

About ConfigCat

ConfigCat is a feature flag and configuration management service that lets you separate releases from deployments. You can turn your features ON/OFF using ConfigCat Dashboard even after they are deployed. ConfigCat lets you target specific groups of users based on region, email or any other custom user attribute.

ConfigCat is a hosted feature flag service. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.

About

Command Line Interface for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.

Topics

Resources

License

Stars

Watchers

Forks

Languages