You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DevCycle CLI for interacting with DevCycle features from the command line.
4
+
This 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.
5
5
6
6
Major features include:
7
+
7
8
- Fully manage your Features, Variables, Variations and Targeting Rules from the command line
8
9
- Detect and list DevCycle Variable usages in your codebase
9
10
- Manage your Self-Targeting Overrides to quickly switch between Variable values
@@ -17,34 +18,84 @@ The CLI can be customized in several ways using command-line args or by creating
-[MCP Server for AI Assistants](#mcp-server-for-ai-assistants)
22
+
-[CLI Documentation](#cli-documentation)
23
+
-[Setup](#setup)
24
+
-[Authentication](#authentication)
25
+
-[Usage](#usage)
26
+
-[Command Topics](#command-topics)
27
+
-[Repo Configuration](#repo-configuration)
28
28
<!-- tocstop -->
29
-
# Setup
30
29
31
-
## Install the CLI
30
+
## MCP Server for AI Assistants
31
+
32
+
The 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.
33
+
34
+
### Quick Setup (No Installation Required)
35
+
36
+
1.**Configure your AI assistant to use the hosted MCP server:**
37
+
38
+
-**Cursor**: Add to `.cursor/mcp_settings.json`:
39
+
40
+
```json
41
+
{
42
+
"mcpServers": {
43
+
"devcycle": {
44
+
"url": "https://mcp.devcycle.com/mcp"
45
+
}
46
+
}
47
+
}
48
+
```
49
+
50
+
- **Claude Desktop**: Add to your Claude config file:
51
+
52
+
```json
53
+
{
54
+
"mcpServers": {
55
+
"devcycle": {
56
+
"command": "npx",
57
+
"args": [
58
+
"mcp-remote",
59
+
"https://mcp.devcycle.com/mcp"
60
+
]
61
+
}
62
+
}
63
+
}
64
+
```
65
+
66
+
2. **That's it!** The server will guide you through OAuth authentication when you first use it.
67
+
68
+
Your AI assistant can now create, update, and manage feature flags on your behalf.
69
+
70
+
For local installation options, detailed configuration, available tools, and advanced usage, see the [complete MCP documentation](docs/mcp.md).
71
+
72
+
## CLI Documentation
73
+
74
+
## Setup
75
+
76
+
### Install the CLI
77
+
32
78
Using NPM
79
+
33
80
```sh-session
34
81
$ npm install -g @devcycle/cli
35
82
```
83
+
36
84
Or alternatively, using homebrew
37
85
38
86
```sh-session
39
87
$ brew tap devcyclehq/cli
40
88
$ brew install devcycle
41
89
```
42
-
# Authentication
90
+
91
+
## Authentication
92
+
43
93
Many of the CLI commands require DevCycle API authorization. There are several ways to provide these credentials.
44
94
45
-
## Using Access Tokens (preferred)
95
+
### Using Access Tokens (preferred)
96
+
97
+
#### Login Command
46
98
47
-
### Login Command
48
99
By 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.
49
100
50
101
The [`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.
@@ -55,12 +106,14 @@ To switch organizations once logged in, the [`organizations select` command](doc
55
106
56
107
If 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.
57
108
58
-
### Repo Init Command
109
+
#### Repo Init Command
110
+
59
111
The [`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.
60
112
61
-
## Using Client Credentials
113
+
### Using Client Credentials
114
+
115
+
#### Client Credentials in Auth File
62
116
63
-
### Client Credentials in Auth File
64
117
Use 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.
65
118
66
119
```yaml
@@ -75,15 +128,16 @@ The default location is based on the [oclif configDir](https://oclif.io/docs/con
75
128
76
129
If 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.
77
130
78
-
## Project Selection
131
+
### Project Selection
79
132
80
133
You also need to specify the default project ID for the CLI to use.
81
134
82
135
If 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.
83
136
84
137
Otherwise, this is chosen during login or set using the [project select command](docs/projects.md#dvc-projects-select)
The 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.
* [`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.
129
-
* [`dvc diff`](docs/diff.md) - Print a diff of DevCycle variable usage between two versions of your code.
130
-
* [`dvc environments`](docs/environments.md) - Create a new Environment for an existing Feature.
131
-
* [`dvc features`](docs/features.md) - Create, view, or modify Features with the Management API.
132
-
* [`dvc generate`](docs/generate.md) - Generate Devcycle related files.
133
-
* [`dvc help`](docs/help.md) - Display help for dvc.
134
-
* [`dvc identity`](docs/identity.md) - View or manage your DevCycle Identity.
135
-
* [`dvc keys`](docs/keys.md) - Retrieve SDK keys from the Management API.
136
-
* [`dvc login`](docs/login.md) - Log in to DevCycle.
137
-
* [`dvc logout`](docs/logout.md) - Discards any auth configuration that has been stored in the auth configuration file.
138
-
* [`dvc organizations`](docs/organizations.md) - List or switch organizations.
139
-
* [`dvc overrides`](docs/overrides.md) - Create, view, or modify Overrides for a Project with the Management API.
140
-
* [`dvc projects`](docs/projects.md) - Create, or view Projects with the Management API.
-[`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.
183
+
-[`dvc diff`](docs/diff.md) - Print a diff of DevCycle variable usage between two versions of your code.
184
+
-[`dvc environments`](docs/environments.md) - Create a new Environment for an existing Feature.
185
+
-[`dvc features`](docs/features.md) - Create, view, or modify Features with the Management API.
186
+
-[`dvc generate`](docs/generate.md) - Generate Devcycle related files.
187
+
-[`dvc help`](docs/help.md) - Display help for dvc.
188
+
-[`dvc identity`](docs/identity.md) - View or manage your DevCycle Identity.
189
+
-[`dvc keys`](docs/keys.md) - Retrieve SDK keys from the Management API.
190
+
-[`dvc login`](docs/login.md) - Log in to DevCycle.
191
+
-[`dvc logout`](docs/logout.md) - Discards any auth configuration that has been stored in the auth configuration file.
192
+
-[`dvc organizations`](docs/organizations.md) - List or switch organizations.
193
+
-[`dvc overrides`](docs/overrides.md) - Create, view, or modify Overrides for a Project with the Management API.
194
+
-[`dvc projects`](docs/projects.md) - Create, or view Projects with the Management API.
-[`dvc targeting`](docs/targeting.md) - Create, view, or modify Targeting Rules for a Feature with the Management API.
198
+
-[`dvc usages`](docs/usages.md) - Print all DevCycle variable usages in the current version of your code.
199
+
-[`dvc variables`](docs/variables.md) - Create, view, or modify Variables with the Management API.
200
+
-[`dvc variations`](docs/variations.md) - Create a new Variation for an existing Feature.
147
201
148
202
<!-- commandsstop -->
203
+
## Repo Configuration
149
204
150
-
# MCP Server for AI Assistants
151
-
152
-
The DevCycle CLI includes an MCP (Model Context Protocol) server that enables AI coding assistants like Cursor and Claude to manage feature flags directly. This allows you to create, update, and manage feature flags without leaving your coding environment.
153
-
154
-
## Installation
155
-
156
-
### Option 1: Global Installation (Recommended)
157
-
```bash
158
-
npm install -g @devcycle/cli
159
-
# This installs both 'dvc' CLI and 'dvc-mcp' server
160
-
```
161
-
162
-
### Option 2: Project-Specific Installation
163
-
```bash
164
-
npm install --save-dev @devcycle/cli
165
-
# Access via: npx dvc-mcp
166
-
```
167
-
168
-
### Verify Installation
169
-
```bash
170
-
dvc-mcp --version # Should display the DevCycle CLI version
0 commit comments