Skip to main content

crewship feature-flag

Manage feature flags for the current workspace. The CLI surfaces the flag definition lifecycle (create/update/delete) plus the override layer (per-workspace on/off) and a list view that includes the instance default. The web app has no feature-flag screen; besides the CLI, definitions can be created through direct API calls or a manifest apply — see the API reference below. A flag key cannot be renamed. Which keys the server actually reads, and what each one gates, is listed in Flags the server checks.
The command accepts the alias crewship flag.

Subcommands


crewship feature-flag create

Creates a new instance-global flag definition — the row that list’s DEFAULT column reads and that enable/disable/inherit target with a per-workspace override. Instance-wide: the flag becomes visible to every workspace on the instance, not only the one the CLI is pointed at. You must be an instance administrator and OWNER or ADMIN of the selected workspace (see Who may change a definition).

crewship feature-flag update

Updates one or more fields of an existing flag definition — the instance-wide default, not this workspace’s override (use enable/disable for that). Only the flags you pass are sent as a partial PATCH, so omitting --percentage leaves the stored value untouched rather than resetting it to 0. At least one of the three is required — running update <key> with no flags exits 2 (ExitValidation) without contacting the server. Same permission as create; a <key> that doesn’t exist returns 404.

crewship feature-flag list

Lists every flag the instance knows about with three columns of state plus the resolved effective value:
The global --format flag is honoured (table, json, yaml, ndjson, quiet). Any workspace role can run list.

crewship feature-flag enable / disable

Writes a per-workspace override. Idempotent — repeating the command is a no-op. The override always wins over the instance default, so use these to opt a single workspace into or out of a flag regardless of the instance-wide setting. Requires OWNER or ADMIN of the workspace.

crewship feature-flag inherit

Removes the override. The next read of the flag reverts to the instance default. Use this when you want a previously-pinned workspace to follow the instance default again. Succeeds (no change) when the workspace had no override; requires OWNER or ADMIN of the workspace.

crewship feature-flag delete

Deletes the flag definition itself, not just this workspace’s override — the delete cascades to every workspace’s override row for the key, instance-wide. This is a stronger operation than inherit; prefer inherit if you only want to stop overriding for the current workspace. Same permission as create; prompts for confirmation unless --yes / -y is passed.

API

The CLI is a thin wrapper over six endpoints. Each request carries the selected workspace (--workspace / CREWSHIP_WORKSPACE / crewship workspace use) as the workspace_id query parameter. Every route in the family has a CLI wrapper. create/update/delete require an instance administrator who is also OWNER/ADMIN of the selected workspace, and they are instance-wide — a definition change is visible to every workspace, not only the one the CLI is currently pointed at.

Common errors

  • API error (404): Feature flag not found — the <key> you passed doesn’t exist on this instance. Run crewship feature-flag list to see the catalog.
  • API error (409): feature flag with this key already exists — create was given a --key already in use. Pick a different key, or update the existing one.
  • API error (401) — authenticate with crewship login (or configure a CLI token) and select a workspace.
  • API error (403): Only an instance administrator can do this — create/update/delete were run by someone who is not an instance administrator.
  • API error (403): Forbidden — override writes (enable/disable/inherit) need OWNER / ADMIN of the workspace; definition writes need that role too, in addition to instance administration, and a CLI token restricted to scopes other than instance:admin is refused the same way. MEMBER and VIEWER roles can only list.
  • API error (400) — the override request is malformed or has no explicit boolean enabled value; inherit and delete also reject an empty key. update with no flags, or create/update with --percentage outside 0-100, is rejected client-side before any request is sent (exit 2).

See also