@flagify/cli 1.7.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +38 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -26,13 +26,20 @@ echo 'alias flag="flagify"' >> ~/.zshrc && source ~/.zshrc
26
26
  ## Quick Start
27
27
 
28
28
  ```bash
29
- # Login to your account
30
- flagify login
29
+ # Sign in (creates a profile called "default" on first run)
30
+ flagify auth login
31
31
 
32
- # Discover your resources
33
- flagify workspaces list
34
- flagify projects list -w <workspace-id>
35
- flagify projects get <project-id>
32
+ # Or add a named profile — handy when you juggle work and personal accounts
33
+ flagify auth login --profile work
34
+ flagify auth list
35
+ flagify auth switch personal
36
+
37
+ # Pin a repo to a workspace/project/environment in a committable file
38
+ flagify init --workspace-id ws_01J... --project-id pr_01J... --environment development
39
+
40
+ # See the resolved context for this invocation + the source of every field
41
+ flagify status
42
+ flagify status --format json
36
43
 
37
44
  # Manage feature flags
38
45
  flagify flags list -p <project-id>
@@ -46,9 +53,17 @@ flagify flags toggle my-flag -p <project-id>
46
53
 
47
54
  | Command | Description |
48
55
  |---------|-------------|
49
- | `flagify login` | Authenticate with email and password |
50
- | `flagify logout` | Clear stored credentials |
51
- | `flagify whoami` | Show the currently authenticated user |
56
+ | `flagify auth login` | Sign in with the browser flow (`--profile <name>` to add a second identity without signing out of the first) |
57
+ | `flagify auth logout` | Sign out of the active profile (`--profile <name>` or `--all`) |
58
+ | `flagify auth list` | List signed-in profiles (`--format json`) |
59
+ | `flagify auth switch <name>` | Set the active profile |
60
+ | `flagify auth remove <name>` | Delete a profile and any repo bindings that point to it |
61
+ | `flagify auth rename <old> <new>` | Rename a profile and update bindings |
62
+ | `flagify whoami` | Show the current user and pinned profile (`--format json`) |
63
+ | `flagify status` | Show the resolved context for this invocation with `sources` per field (`--format json`) |
64
+ | `flagify init` | Write `.flagify/project.json` for the current repo (`--print` to dry-run, `--force` to overwrite in non-TTY) |
65
+ | `flagify project bind --profile <name>` | Bind this repo to a local profile without touching the project file |
66
+ | `flagify project set <field> <value>` | Update a field in `.flagify/project.json` (environment, project, workspace, preferred-profile, …) |
52
67
  | `flagify workspaces list` | List your workspaces (`--format json`) |
53
68
  | `flagify workspaces pick` | Interactively select a default workspace |
54
69
  | `flagify projects list` | List projects in a workspace (`--format json`) |
@@ -97,7 +112,20 @@ flagify completion fish > ~/.config/fish/completions/flagify.fish
97
112
 
98
113
  ## Configuration
99
114
 
100
- The CLI stores credentials in `~/.flagify/config.json`. Use `--project` and `--environment` flags to target specific resources.
115
+ Credentials live under named profiles in `~/.flagify/config.json` (schema v2, migrated automatically from any older flat file with a `.bak` preserved alongside).
116
+
117
+ Scope is resolved per-invocation. Precedence, highest first:
118
+
119
+ 1. CLI flags (`--profile`, `--workspace-id`, `--workspace`, `--project-id`, `--project`, `--environment`).
120
+ 2. Environment variables (`FLAGIFY_PROFILE`, `FLAGIFY_WORKSPACE_ID`, `FLAGIFY_WORKSPACE`, `FLAGIFY_PROJECT_ID`, `FLAGIFY_PROJECT`, `FLAGIFY_ENVIRONMENT`, `FLAGIFY_API_URL`).
121
+ 3. `.flagify/project.json` walked up from the current directory.
122
+ 4. Local binding recorded by `flagify project bind`.
123
+ 5. The active profile's defaults.
124
+ 6. Built-in defaults.
125
+
126
+ Run `flagify status` to see exactly which signal won for each field. See the full CLI reference at [flagify.dev/docs/cli](https://flagify.dev/docs/cli) for multi-account workflows and project file details.
127
+
128
+ > **Ephemeral tokens**: set `FLAGIFY_ACCESS_TOKEN` (and optionally `FLAGIFY_REFRESH_TOKEN`) to override the stored credentials for a single invocation. The CLI does not persist refreshed tokens when these are set.
101
129
 
102
130
  ## Requirements
103
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flagify/cli",
3
- "version": "1.7.0",
3
+ "version": "2.0.0",
4
4
  "description": "Flagify CLI — manage feature flags from the terminal",
5
5
  "license": "MIT",
6
6
  "bin": {