CLI
featurectrl CLI allows you to manage configs in your project.
Installation
Section titled “Installation”curl -fsSL https://featurectrl.io/cli/install.sh | shThe script will install the latest featurectrl cli. Verify the installation by running:
featurectrl --versionInit featurectrl in your project
Section titled “Init featurectrl in your project”featurectrl init --org my-org --app-name my-appThis 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.
Publishing feature flags
Section titled “Publishing feature flags”featurectrl pushThis 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.
Command reference
Section titled “Command reference”Global CLI options:
| Flag | Default | Description |
|---|---|---|
-c, --config <path> | $FEATURECTRL_CONFIG_PATH or featurectrl.config.json | Path to the config file. |
--api-key <key> | $FEATURECTRL_API_KEY | Private API key. |
--api-url <url> | $FEATURECTRL_API_URL or https://api.featurectrl.io | API base URL. |
featurectrl init
Section titled “featurectrl init”Create a featurectrl.config.json skeleton in the current directory.
| Flag | Default | Description |
|---|---|---|
-o, --org <slug> | Organization slug. Will be prompted if omitted. | |
-a, --app-name <name> | App name. Will be prompted if omitted. |
featurectrl push
Section titled “featurectrl push”Read the local config file and submit it to the server.
featurectrl --version
Section titled “featurectrl --version”Print the installed CLI version.