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
docs: update CLI README for clarity and migration instructions (#480)
- Revised installation instructions to specify installing the CLI as a
development dependency.
- Enhanced clarity in the migration section from Bucket CLI, detailing
changes in command names, file names, and environment variables.
- Improved overall readability by consolidating and rephrasing sentences
for better understanding.
- Added emphasis on updating scripts and configuration files to reflect
the new changes.
Then running the `new` command from your project's root directory,
20
-
initializing the CLI, creating a flag, and generating the types all at once:
19
+
Run the `new` command from your project's root directory to initialize the CLI, create a flag, and generate TypeScript types in one step:
21
20
22
21
```bash
23
22
# npm
@@ -29,20 +28,20 @@ yarn reflag new
29
28
30
29
## Migrating from Bucket SDK
31
30
32
-
If you have been using the Bucket CLI, the following list will help you migrate to Reflag CLI:
31
+
If you're migrating from the Bucket CLI, here are the key changes to be aware of:
33
32
34
-
-The command has been renamed from `bucket` to `reflag`
35
-
-The default name of the file that contains the type definitions has been renamed to `flags.d.ts`from `features.d.ts`. You will need to manually remove `features.d.ts`if it was checked into the repository
36
-
-The name of the file that stores personal authentication details has been changed to `.reflag-auth`from`.bucket-auth`. You will need to rename or remove `.bucket-auth`
37
-
-The name of the file that stores CLI configuration has been changed to `reflag.config.json`from `bucket.config.json`. You will need to rename or remove `bucket.config.json`
38
-
-The`features` command has been renamed to`flags`
39
-
-The API key should now be supplied through `REFLAG_API_KEY` environment variable instead of `BUCKET_API_KEY`
33
+
-**Command name**: Changed from `bucket` to `reflag`
34
+
-**Type definitions file**: Renamed from `features.d.ts`to `flags.d.ts` (manually remove the old file if it was committed)
35
+
-**Authentication file**: Changed from `.bucket-auth`to`.reflag-auth` (rename or remove the old file)
36
+
-**Configuration file**: Changed from `bucket.config.json`to `reflag.config.json` (rename or remove the old file)
37
+
-**Command**:`features` command is now`flags`
38
+
-**Environment variable**: Use `REFLAG_API_KEY` instead of `BUCKET_API_KEY`
40
39
41
-
Do not forget to update your scripts, build steps and `.gitignore` patterns
40
+
**Important**: Update your scripts, build steps, and `.gitignore` patterns to reflect these changes.
42
41
43
-
### Individual commands
42
+
### Individual Commands
44
43
45
-
Instead of running `new`you can call each step individually.
44
+
For more control, you can run each command individually:
46
45
47
46
```bash
48
47
# Initialize Reflag in your project (if not already setup)
@@ -57,12 +56,11 @@ npx reflag flags types
57
56
58
57
## Configuration
59
58
60
-
The CLI creates a `reflag.config.json` file in your project directory when you run `reflag init`.
61
-
This file contains all the necessary settings for your Reflag integration.
59
+
The CLI creates a `reflag.config.json` file in your project directory when you run `reflag init`. This file contains all the necessary settings for your Reflag integration.
62
60
63
61
### Configuration File Structure
64
62
65
-
Here's a comprehensive list of configuration options available in the `reflag.config.json` file:
63
+
Here are all the configuration options available in the `reflag.config.json` file:
66
64
67
65
```json
68
66
{
@@ -93,8 +91,7 @@ You can override these settings using command-line options for individual comman
93
91
94
92
### `reflag init`
95
93
96
-
Initialize a new Reflag configuration in your project.
97
-
This creates a `reflag.config.json` file with your settings and prompts for any required information not provided via options.
94
+
Initialize a new Reflag configuration in your project. This creates a `reflag.config.json` file with your settings and prompts for any required information not provided via options.
98
95
99
96
```bash
100
97
npx reflag init [--overwrite]
@@ -108,8 +105,7 @@ Options:
108
105
109
106
### `reflag new [flagName]`
110
107
111
-
All-in-one command to get started quickly. This command combines `init`, flag creation,
112
-
and type generation in a single step. Use this for the fastest way to get up and running with Reflag.
108
+
All-in-one command to get started quickly. This command combines `init`, flag creation, and type generation in a single step. Use this for the fastest way to get up and running with Reflag.
113
109
114
110
```bash
115
111
npx reflag new "My Flag" [--app-id ap123456789] [--key my-flag] [--key-format custom] [--out gen/flags.ts] [--format react]
@@ -127,28 +123,27 @@ If you prefer more control over each step, you can use the individual commands (
127
123
128
124
### `reflag login`
129
125
130
-
Log in to your Reflag account. This will authenticate your CLI for subsequent operations and store credentials securely.
126
+
Authenticate with your Reflag account. This stores your credentials securely for subsequent operations.
131
127
132
128
```bash
133
129
npx reflag login
134
130
```
135
131
136
132
### `reflag logout`
137
133
138
-
Log out from your Reflag account, removing stored credentials.
134
+
Sign out from your Reflag account and remove stored credentials.
139
135
140
136
```bash
141
137
npx reflag logout
142
138
```
143
139
144
140
### `reflag flags`
145
141
146
-
Manage your Reflag flags with the following subcommands.
142
+
Manage your Reflag flags with these subcommands:
147
143
148
144
#### `reflag flags create [flagName]`
149
145
150
-
Create a new flag in your Reflag app.
151
-
The command guides you through the flag creation process with interactive prompts if options are not provided.
146
+
Create a new flag in your Reflag app. The command guides you through the flag creation process with interactive prompts if options are not provided.
@@ -204,11 +197,11 @@ These options can be used with any command:
204
197
205
198
## AI-Assisted Development
206
199
207
-
Reflag provides powerful AI-assisted development capabilities through rules and Model Context Protocol (MCP). These flags help your AI development tools better understand your flags and provide more accurate assistance.
200
+
Reflag provides powerful AI-assisted development capabilities through rules and Model Context Protocol (MCP). These features help your AI development tools better understand your flags and provide more accurate assistance.
208
201
209
202
### Reflag Rules (Recommended)
210
203
211
-
The `rules` command helps you set up AI-specific rules for your project. These rules enable AI tools to better understand how to work with Reflag and flags and how they should be used in your codebase.
204
+
The `rules` command helps you set up AI-specific rules for your project. These rules enable AI tools to better understand how to work with Reflag flags and how they should be used in your codebase.
-`copilot`: Adds rules to `.github/copilot-instructions.md` for GitHub Copilot integration.
222
215
-`--yes`: Skip confirmation prompts and overwrite existing files without asking.
223
216
224
-
This command will add rules to your project that provide AI tools with context about how to setup and use Reflag flags. For the copilot format, the rules will be added to a dedicated section in the file, allowing you to maintain other copilot instructions alongside Reflag's rules.
217
+
This command adds rules to your project that provide AI tools with context about how to set up and use Reflag flags. For the copilot format, the rules are added to a dedicated section in the file, allowing you to maintain other copilot instructions alongside Reflag's rules.
225
218
226
219
## Model Context Protocol
227
220
228
-
The Model Context Protocol (MCP) is an open protocol that provides a standardized way to connect AI models to different data sources and tools. In the context of Reflag, MCP enables your code editor to understand your flags, their states, and their relationships within your codebase. This creates a seamless bridge between your flag management workflow and AI-powered development tools. The MCP server is hosted by Reflag, so it's very easy to get started.
221
+
The Model Context Protocol (MCP) is an open protocol that provides a standardized way to connect AI models to different data sources and tools. In the context of Reflag, MCP enables your code editor to understand your flags, their states, and their relationships within your codebase. This creates a seamless bridge between your flag management workflow and AI-powered development tools. The MCP server is hosted by Reflag, making it easy to get started.
229
222
230
223
_\*\*Note: The Reflag `mcp` CLI command was previously used for a \_local_ server. However, in recent versions of the Reflag CLI, the `mcp` command has been repurposed to help you connect to the new remote MCP server.\*\*\_
231
224
@@ -234,12 +227,11 @@ _\*\*Note: The Reflag `mcp` CLI command was previously used for a \_local_ serve
234
227
The `mcp` command helps you configure your editor or AI client to connect with Reflag's remote MCP server. This allows your AI tools to understand your flags and provide more contextual assistance.
-`--app-id`: App ID to use for the MCP connection.
243
235
-`--editor`: The editor/client to configure:
244
236
-`cursor`: [Cursor IDE](https://www.cursor.com/)
245
237
-`vscode`: [Visual Studio Code](https://code.visualstudio.com/)
@@ -258,8 +250,7 @@ _**Note: The setup uses [mcp-remote](https://github.com/geelen/mcp-remote) as a
258
250
259
251
## Using in CI/CD Pipelines (Beta)
260
252
261
-
The Reflag CLI is designed to work seamlessly in CI/CD pipelines. For automated environments where interactive login is not possible, use the `--api-key` option,
262
-
or specify the API key in `REFLAG_API_KEY` environment variable.
253
+
The Reflag CLI is designed to work seamlessly in CI/CD pipelines. For automated environments where interactive login is not possible, use the `--api-key` option or specify the API key in the `REFLAG_API_KEY` environment variable.
263
254
264
255
```bash
265
256
# Generate types in CI/CD
@@ -268,11 +259,10 @@ npx reflag apps list --api-key $REFLAG_API_KEY
268
259
269
260
**Important restrictions:**
270
261
271
-
- When using `--api-key`, the `login` and `logout` commands are disabled.
272
-
- API keys bypass all interactive authentication flows.
273
-
- Only _read-only_ access to Reflag API is granted at the moment.
274
-
- API keys are bound to one app only. Commands such as `apps list` will only return the bound app.
275
-
- Store API keys securely using your CI/CD platform's secret management.
262
+
- When using `--api-key`, the `login` and `logout` commands are disabled
263
+
- API keys bypass all interactive authentication flows
264
+
- API keys are bound to one app only. Commands such as `apps list` will only return the bound app
265
+
- Store API keys securely using your CI/CD platform's secret management
0 commit comments