@flagify/cli 1.7.0 → 2.1.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 +44 -11
  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). If the current repo has a `.flagify/project.json` whose `preferredProfile` points elsewhere, the CLI prompts (TTY only) to rewrite the pin to the profile you just authenticated. If the browser comes back without tokens (expired session / interrupted flow), the CLI auto-reopens the flow on a TTY (up to 3 attempts); non-TTY runs get a single actionable error. |
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`) |
@@ -69,8 +84,13 @@ flagify flags toggle my-flag -p <project-id>
69
84
  | `flagify segments delete <id>` | Delete a segment by ID |
70
85
  | `flagify targeting list <flag-key>` | Show targeting rules for a flag in an environment (`--format json`; returns `{flag, environment, rules}`) |
71
86
  | `flagify targeting set <flag-key>` | Replace all targeting rules for a flag (`--rules '<json>'`, `--format json`) |
87
+ | `flagify webhooks list` | List webhooks in a project; defaults to the aggregate view across environments (`--environment` to scope, `--format json`) |
88
+ | `flagify webhooks create` | Create a webhook subscribed to one or more flag/targeting events. Environment-scoped — the signing secret is printed exactly once |
89
+ | `flagify webhooks get <webhook-id>` | Show a webhook's URL, environment, events, and status (`--format json`) |
90
+ | `flagify webhooks delete <webhook-id>` | Delete a webhook subscription |
91
+ | `flagify webhooks deliveries <webhook-id>` | Show recent delivery attempts with status code and response excerpt (`--format json`, `--limit N`) |
72
92
  | `flagify whoami` | Show current authenticated user (`--format json`) |
73
- | `flagify ai-setup` | Generate AI tool configs (Claude, Cursor, Copilot, Windsurf). Includes the integrations catalogue; use `--include-flags` for a snapshot |
93
+ | `flagify ai-setup` | Generate AI tool configs (Claude Code skill, Cursor, Copilot, Windsurf). Includes the integrations catalogue; use `--include-flags` for a snapshot |
74
94
  | `flagify types` | Generate typed flag key constants (`--typescript` or `--go`) for compile-time safety in application code |
75
95
  | `flagify config` | Show current configuration (`--format json`) |
76
96
  | `flagify config set <key> <value>` | Set a config value (api-url, console-url, workspace, project, environment) |
@@ -97,7 +117,20 @@ flagify completion fish > ~/.config/fish/completions/flagify.fish
97
117
 
98
118
  ## Configuration
99
119
 
100
- The CLI stores credentials in `~/.flagify/config.json`. Use `--project` and `--environment` flags to target specific resources.
120
+ Credentials live under named profiles in `~/.flagify/config.json` (schema v2, migrated automatically from any older flat file with a `.bak` preserved alongside).
121
+
122
+ Scope is resolved per-invocation. Precedence, highest first:
123
+
124
+ 1. CLI flags (`--profile`, `--workspace-id`, `--workspace`, `--project-id`, `--project`, `--environment`).
125
+ 2. Environment variables (`FLAGIFY_PROFILE`, `FLAGIFY_WORKSPACE_ID`, `FLAGIFY_WORKSPACE`, `FLAGIFY_PROJECT_ID`, `FLAGIFY_PROJECT`, `FLAGIFY_ENVIRONMENT`, `FLAGIFY_API_URL`).
126
+ 3. `.flagify/project.json` walked up from the current directory.
127
+ 4. Local binding recorded by `flagify project bind`.
128
+ 5. The active profile's defaults.
129
+ 6. Built-in defaults.
130
+
131
+ 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.
132
+
133
+ > **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
134
 
102
135
  ## Requirements
103
136
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flagify/cli",
3
- "version": "1.7.0",
3
+ "version": "2.1.0",
4
4
  "description": "Flagify CLI — manage feature flags from the terminal",
5
5
  "license": "MIT",
6
6
  "bin": {