railway flag adds feature flag management
Introduced 2026-07-07 · score 0.98
HOW TO USE IT
When managing feature flags for a linked Railway project workspace, use `railway flag` to list flags, set defaults or targeting rules, re-type flags, delete flags, and remove rules.
railway flag list --fullrailway flag set <name> <value> --when '<CEL expression>'railway flag set <name> <value> --type <bool|string|number|json> --forceWHY THIS HELPS
Manage feature flags for a linked Railway project workspace from the CLI.
REQUIREMENTS AND LIMITATIONS
- Version: v5.24.0
- name (required): Flag name.
- value (required): Default value, or rule value when `--when` is passed. Type is inferred when `--type` is omitted.
- --when <expression>: CEL expression subset for a targeting rule; raw JSON is also accepted.
- --rule-id <id>: Stable rule ID for `--when`; defaults to a hash of flag name and expression. Required by `unset` to identify the rule to remove.
- --type <type>: Flag type: `bool`, `string`, `number`, or `json`; inferred from value if omitted.
- --force: Allow replacing an existing flag's type; rules are cleared when the type changes.
- --full: For list output, show rule IDs and empty rule sections.
- --owner <owner>: Select flag scope, such as `workspace:<id>` or `project:<id>`; defaults to the linked project's workspace.
- Prerequisite: Link a Railway project with `railway link` to use its workspace as the default flag scope.
- Prerequisite: A targeting rule requires the named flag to exist; create it with `railway flag set <name> <value>` first.
- The `--when` CEL-style syntax supports a subset of predicates; raw JSON is also accepted as an escape hatch.
- Values are inferred from values such as `true`, `42`, `"blue"`, and JSON objects.
- Re-typing an existing flag with `--force --type` clears its rules when the type changes.
FIRST-PARTY EVIDENCE
- https://github.com/railwayapp/cli/releases/tag/v5.24.0
- https://github.com/railwayapp/cli/pull/997
- https://github.com/railwayapp/cli/blob/v5.24.0/src/commands/flag.rs
Check the installed version and the source before using it. Entry JSON