{"id":26514899,"url":"https://github.com/devcyclehq/cli","last_synced_at":"2026-04-03T21:10:45.348Z","repository":{"id":37233676,"uuid":"448966290","full_name":"DevCycleHQ/cli","owner":"DevCycleHQ","description":"DevCycle - CLI","archived":false,"fork":false,"pushed_at":"2025-03-06T19:56:43.000Z","size":36965,"stargazers_count":18,"open_issues_count":10,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-06T20:32:15.837Z","etag":null,"topics":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"latest_commit_sha":null,"homepage":"https://docs.devcycle.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DevCycleHQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-17T16:24:01.000Z","updated_at":"2025-03-06T19:56:46.000Z","dependencies_parsed_at":"2024-01-03T21:24:32.919Z","dependency_job_id":"22448853-4ce6-437e-8d0d-e6b5dc17a175","html_url":"https://github.com/DevCycleHQ/cli","commit_stats":{"total_commits":199,"total_committers":9,"mean_commits":22.11111111111111,"dds":0.592964824120603,"last_synced_commit":"47a4a89135972a2b141dde9d37851a1b03a219ce"},"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevCycleHQ%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevCycleHQ","download_url":"https://codeload.github.com/DevCycleHQ/cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745203,"owners_count":20503040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-delivery","continuous-deployment","devcycle","devops","feature-flags","feature-toggles","openfeature"],"created_at":"2025-03-21T05:29:42.411Z","updated_at":"2026-04-03T21:10:45.334Z","avatar_url":"https://github.com/DevCycleHQ.png","language":"TypeScript","readme":"DevCycle CLI \u0026 MCP Server\n=========================\n\nThis repository contains the DevCycle CLI for managing feature flags from the command line, plus an MCP (Model Context Protocol) server that enables AI coding assistants to interact with DevCycle.\n\nMajor features include:\n\n- Fully manage your Features, Variables, Variations and Targeting Rules from the command line\n- Detect and list DevCycle Variable usages in your codebase\n- Manage your Self-Targeting Overrides to quickly switch between Variable values\n- Generate type definitions for type-safe usage of DevCycle (Typescript only)\n- MCP (Model Context Protocol) server for AI-powered feature flag management with Cursor and Claude\n\nThe CLI can be customized in several ways using command-line args or by creating a [configuration file](#repo-configuration).\n\n[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![Version](https://img.shields.io/npm/v/@devcycle/cli.svg)](https://www.npmjs.com/package/@devcycle/cli)\n[![License](https://img.shields.io/npm/l/@devcycle/cli.svg)](https://github.com/DevCycleHQ/cli/blob/main/package.json)\n\n\u003c!-- toc --\u003e\n* [Command Topics](#command-topics)\n* [Pattern captures the key including surrounding quotes](#pattern-captures-the-key-including-surrounding-quotes)\n* [Pattern strips quotes, capturing only the content](#pattern-strips-quotes-capturing-only-the-content)\n\u003c!-- tocstop --\u003e\n\n## MCP Server for AI Assistants\n\nThe DevCycle MCP (Model Context Protocol) server enables AI coding assistants like Cursor and Claude to manage feature flags directly from your development environment. DevCycle offers a hosted MCP server that requires no local installation.\n\n### Quick Setup (No Installation Required)\n\n1. **Configure your AI assistant to use the hosted MCP server:**\n\n   - **Cursor**: Add to `.cursor/mcp_settings.json`:\n\n     ```json\n     {\n       \"mcpServers\": {\n         \"devcycle\": {\n           \"url\": \"https://mcp.devcycle.com/mcp\"\n         }\n       }\n     }\n     ```\n\n   - **Claude Desktop**: Add to your Claude config file:\n\n     ```json\n     {\n       \"mcpServers\": {\n         \"devcycle\": {\n           \"command\": \"npx\",\n           \"args\": [\n             \"mcp-remote\",\n             \"https://mcp.devcycle.com/mcp\"\n           ]\n         }\n       }\n     }\n     ```\n\n2. **That's it!** The server will guide you through OAuth authentication when you first use it.\n\nYour AI assistant can now create, update, and manage feature flags on your behalf.\n\nFor local installation options, detailed configuration, available tools, and advanced usage, see the [complete MCP documentation](docs/mcp.md).\n\n## CLI Documentation\n\n## Setup\n\n### Install the CLI\n\nUsing NPM\n\n```sh-session\n$ npm install -g @devcycle/cli\n```\n\nOr alternatively, using homebrew\n\n```sh-session\n$ brew tap devcyclehq/cli\n$ brew install devcycle\n```\n\n## Authentication\n\nMany of the CLI commands require DevCycle API authorization. There are several ways to provide these credentials.\n\n### Using Access Tokens (preferred)\n\n#### Login Command\n\nBy using the [`login sso` command](docs/login.md#dvc-login-sso), the CLI will retrieve and store an access token, which is valid for 24 hours.\n\nThe [`login again` command](docs/login.md#dvc-login-again) can be used to retrieve a new access token using the saved project and organization without prompting for them.\n\nThis process will open browser windows to interact with the DevCycle universal login page. It will first obtain a personal access token, then prompt you to choose an organization. A second browser window is used to authenticate the CLI with your chosen organization.\n\nTo switch organizations once logged in, the [`organizations select` command](docs/organizations.md) can be used.\n\nIf executing the CLI in a containerized environment, please ensure one of the following PORTs can be accessed via Port Forwarding: 2194 (default), 2195, 2196 or 8080. This will allow the authentication process to complete and set the access token appropriately.\n\n#### Repo Init Command\n\nThe [`repo init` command](docs/repo.md#dvc-repo-init) behaves in the same way as `login sso`, but creates a [repo configuration file](#repo-configuration) and stores the project and organization choices there instead.\n\n### Using Client Credentials\n\n#### Client Credentials in Auth File\n\nUse the [`dvc status` command](docs/status.md#dvc-status) to find the configuration file location for your platform. The credentials can be stored in the file pointed to by the Auth config path. Create the file if it does not exist, with the following contents.\n\n```yaml\nclientCredentials:\n  client_id: \u003cyour client id\u003e\n  client_secret: \u003cyour client secret\u003e\n```\n\nThis file should **not** be checked in to version control.\n\nThe default location is based on the [oclif configDir](https://oclif.io/docs/config)\n\nIf you intend to run the CLI using options that override config file locations, the [`dvc status` command](docs/status.md#dvc-status) command can be run with those options to confirm that the file locations are as expected.\n\n### Project Selection\n\nYou also need to specify the default project ID for the CLI to use.\n\nIf there is a repo configuration file, the [`dvc diff`](docs/diff.md) and [`dvc usages`](docs/usages.md) commands will use the project defined there.\n\nOtherwise, this is chosen during login or set using the [project select command](docs/projects.md#dvc-projects-select)\n\n### Environment Variables\n\nSet the following environment variables:\n\n```sh-session\n$ export DEVCYCLE_CLIENT_ID=\u003cyour client id\u003e\n$ export DEVCYCLE_CLIENT_SECRET=\u003cyour client secret\u003e\n$ export DEVCYCLE_PROJECT_KEY=\u003cyour project key\u003e\n```\n\n### Command-Line Arguments\n\nThe CLI can be run with the following arguments:\n\n```sh-session\n$ dvc --client-id=\u003cyour client id\u003e --client-secret=\u003cyour client secret\u003e --project=\u003cyour project key\u003e\n```\n\n### Github Action\n\nThe Devcycle Github actions are configured with auth information through the `project-key`, `client-id` and `client-secret` configuration parameters. This is passed to the CLI via command line arguments.\n\n## Usage\n\n\u003c!-- usage --\u003e\n```sh-session\n$ npm install -g @devcycle/cli\n$ dvc COMMAND\nrunning command...\n$ dvc (--version)\n@devcycle/cli/6.3.0 linux-x64 node-v22.22.2\n$ dvc --help [COMMAND]\nUSAGE\n  $ dvc COMMAND\n...\n```\n\u003c!-- usagestop --\u003e\n\n\u003c!-- commands --\u003e\n# Command Topics\n\n* [`dvc alias`](docs/alias.md) - Manage repository variable aliases.\n* [`dvc autocomplete`](docs/autocomplete.md) - display autocomplete installation instructions\n* [`dvc cleanup`](docs/cleanup.md) - Replace a DevCycle variable with a static value in the current version of your code. Currently only JavaScript is supported.\n* [`dvc diff`](docs/diff.md) - Print a diff of DevCycle variable usage between two versions of your code.\n* [`dvc environments`](docs/environments.md) - Create a new Environment for an existing Feature.\n* [`dvc features`](docs/features.md) - Create, view, or modify Features with the Management API.\n* [`dvc generate`](docs/generate.md) - Generate Devcycle related files.\n* [`dvc help`](docs/help.md) - Display help for dvc.\n* [`dvc identity`](docs/identity.md) - View or manage your DevCycle Identity.\n* [`dvc keys`](docs/keys.md) - Retrieve SDK keys from the Management API.\n* [`dvc login`](docs/login.md) - Log in to DevCycle.\n* [`dvc logout`](docs/logout.md) - Discards any auth configuration that has been stored in the auth configuration file.\n* [`dvc organizations`](docs/organizations.md) - List or switch organizations.\n* [`dvc overrides`](docs/overrides.md) - Create, view, or modify Overrides for a Project with the Management API.\n* [`dvc projects`](docs/projects.md) - Create, or view Projects with the Management API.\n* [`dvc repo`](docs/repo.md) - Manage repository configuration.\n* [`dvc status`](docs/status.md) - Check CLI status.\n* [`dvc targeting`](docs/targeting.md) - Create, view, or modify Targeting Rules for a Feature with the Management API.\n* [`dvc usages`](docs/usages.md) - Print all DevCycle variable usages in the current version of your code.\n* [`dvc variables`](docs/variables.md) - Create, view, or modify Variables with the Management API.\n* [`dvc variations`](docs/variations.md) - Create a new Variation for an existing Feature.\n\n\u003c!-- commandsstop --\u003e\n## Repo Configuration\n\nThe following commands can only be run from the root of a configured repository\n\n- [`dvc diff`](docs/diff.md)\n- [`dvc usages`](docs/usages.md)\n- [`dvc alias`](docs/alias.md)\n- [`dvc cleanup`](docs/cleanup.md)\n\nMany of the options available as command-line args can also be specified using a repo configuration file. The default\nlocation for this file is `\u003cREPO ROOT\u003e/.devcycle/config.yml`.\n\nThis location can be overridden using the `--repo-config-path` flag.\n\nThe configuration file format is documented below:\n\n```yml\n## the project and organization to use when connecting to the DevCycle Rest API for this repo\nproject: \"project-key\"\norg:\n  id: \"org_xxxxxx\"\n  name: \"unique-org-key\"\n  display_name: \"Human Readable Org Name\"\n## block for configuring \"code insights\" features like diff and variable usage scanning\n## use this section to improve the detection of DevCycle usage within your code\ncodeInsights:\n  ## add additional names to check for when looking for instances of DVCClient from an SDK\n  clientNames:\n    - \"dvcClient\"\n  ## map the values used in your code to the corresponding variable key in DevCycle\n  variableAliases:\n    \"VARIABLES.ENABLE_V1\": \"enable-v1\"\n  ## additional regex patterns used to match variables for a specific file extension\n  matchPatterns:\n    ## file extension to override for, containing a list of patterns to use\n    js:\n      - dvcClient\\.variable\\(\\s*[\"']([^\"']*)[\"']\n  ## an array of file glob patterns to include in usage scan\n  includeFiles:\n    - \"*.[jt]s\"\n  ## an array of file glob patterns to exclude from usage scan\n  excludeFiles:\n    - \"dist/*\"\n```\n\n### Match Patterns and Aliases\n\nWhen identifying variable usages in the code, the CLI will identify DevCycle SDK methods by default. To capture\nother usages you may define match patterns. Match patterns are defined by file extension.\n\n:::note\nEach pattern must include exactly one capture group for the variable key. Capture the entire key value\n(including surrounding quotes if you choose the “with quotes” pattern).\n:::\n\nMatch patterns can be defined in the configuration file, for example:\n\n```yml\ncodeInsights:\n  matchPatterns:\n    js:\n      - customVariableGetter\\(\\s*[\"']([^\"']*)[\"']\n    ts:\n      - customVariableGetter\\(\\s*[\"']([^\"']*)[\"']\n    jsx:\n      - customVariableHook\\(\\s*[\"']([^\"']*)[\"']\n      - customVariableGetter\\(\\s*[\"']([^\"']*)[\"']\n    tsx:\n      - customVariableHook\\(\\s*[\"']([^\"']*)[\"']\n      - customVariableGetter\\(\\s*[\"']([^\"']*)[\"']\n```\n\n#### Capturing with or without quotes\n\nMatch patterns can capture variable keys with or without quotes, which affects whether aliases are needed:\n\nWith quotes:\n\n```yml\n# Pattern captures the key including surrounding quotes\n- dvcClient\\.variable\\(\\s*([\"'][^\"']*[\"'])\\s*,\n```\n\n- Matches: `dvcClient.variable('my-variable', default)`\n- Captures: `'my-variable'` (with quotes)\n\nWithout quotes (aliases or generated constants required):\n\n```yml\n# Pattern strips quotes, capturing only the content\n- dvcClient\\.variable\\(\\s*[\"']([^\"']*)[\"']\n```\n\n- Matches: `dvcClient.variable('my-variable', default)`\n- Captures: `my-variable`\n\nMatch patterns can also be passed directly to relevant commands using the `--match-pattern` flag:\n\n```bash\ndvc usages --match-pattern ts=\"customVariableGetter\\(\\s*[\"']([^\"']*)[\"']\" js=\"customVariableGetter\\(\\s*[\"']([^\"']*)[\"']\"\n```\n\nWhen testing your regex the `--show-regex` flag can be helpful. This will print all patterns used to find matches in your codebase.\n\n```bash\ndvc usages --show-regex\n```\n\n#### Custom Wrapper Functions\n\nIf you use wrapper functions around the SDK, add patterns for them.\n\n**Example: Custom wrapper functions**\n\n```yml\ncodeInsights:\n  matchPatterns:\n    ts:\n      # Matches: getFeatureFlag('my-variable', defaultValue)\n      - getFeatureFlag\\(\\s*([^,)]*)\\s*,\n      # Matches: isFeatureEnabled('my-variable')\n      - isFeatureEnabled\\(\\s*([^,)]*)\\s*\\)\n    tsx:\n      # Matches: useFeatureFlag('my-variable', defaultValue)\n      - useFeatureFlag\\(\\s*([^,)]*)\\s*,\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevcyclehq%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevcyclehq%2Fcli/lists"}