Skip to content

CLI

featurectrl CLI allows you to manage configs in your project.

Terminal window
curl -fsSL https://featurectrl.io/cli/install.sh | sh

The script will install the latest featurectrl cli. Verify the installation by running:

Terminal window
featurectrl --version
Terminal window
featurectrl init --org my-org --app-name my-app

This creates featurectrl.config.json:

{
"organization": "my-org",
"app": "my-app",
"flags": {
"example_flag": {
"defaultValue": { "enabled": false },
"description": "An example feature flag — rename or remove."
}
},
"segments": ["example_segment"]
}

organization is your organization slug - it identifies which organization the config is published to.

You also need to configure SDK integration, depending on the language / tools you use in your project.

Terminal window
featurectrl push

This pushes featurectrl.config.json to the server - creating/updating required feature flags and segments. push command needs private API key to be set as FEATURECTRL_API_KEY env variable, or passed via CLI --api-key argument.

For self-hosted setup you also need to override server API url using FEATURECTRL_API_URL environment variable, or --api-url CLI argument.

Global CLI options:

FlagDefaultDescription
-c, --config <path>$FEATURECTRL_CONFIG_PATH or featurectrl.config.jsonPath to the config file.
--api-key <key>$FEATURECTRL_API_KEYPrivate API key.
--api-url <url>$FEATURECTRL_API_URL or https://api.featurectrl.ioAPI base URL.

Create a featurectrl.config.json skeleton in the current directory.

FlagDefaultDescription
-o, --org <slug>Organization slug. Will be prompted if omitted.
-a, --app-name <name>App name. Will be prompted if omitted.

Read the local config file and submit it to the server.

Print the installed CLI version.