Skip to content

Add railway flag command for feature flag management#997

Merged
futurepastori merged 6 commits into
masterfrom
victor/signals-v0
Jul 7, 2026
Merged

Add railway flag command for feature flag management#997
futurepastori merged 6 commits into
masterfrom
victor/signals-v0

Conversation

@futurepastori

@futurepastori futurepastori commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds CLI support for Railway Feature Flags — define flags, set default values, attach targeting rules, delete flags, and inspect registered flags for a workspace.

  • railway flag is the primary command
  • Set defaults with railway flag set <name> <value>
  • Targeting rules use the same set command with --when
  • CEL-style --when subset for common predicates, plus raw JSON as an escape hatch
  • Tree-style list output shows flag values and rule predicates; --full includes rule IDs and empty rule sections
  • Delete flags with railway flag delete <name>
  • Remove rules with railway flag unset <name> --rule-id <id>
  • Type safety — values are inferred (true, 42, "blue", JSON objects); explicit --type supported on set
  • Re-type existing flags with railway flag set --force --type (clears rules when the type changes)

Owner scope defaults to the linked project's workspace (railway link), or can be set with --owner / RAILWAY_SIGNALS_OWNER.

Examples

railway flag list
railway flag list --full
railway flag set checkout.v2 true
railway flag set theme "blue"
railway flag set checkout.v2 true --when 'workspace_plan == "enterprise"'
railway flag set checkout.v2 true --when 'bucket(workspace_id) < 0.25'
railway flag delete checkout.v2
railway flag unset checkout.v2 --rule-id enterprise-on
railway flag set checkout.v2 "yes" --force --type string
railway flag list --json

--when supports a CEL-shaped subset for comparisons, &&, ||, !, receiver calls like source_repo.contains("miner"), list membership, and bucket rollouts. Raw JSON expressions are still accepted for full-fidelity use cases.

Test plan

  • cargo fmt
  • cargo test signals --quiet
  • cargo test flag_list_tests --quiet
  • cargo build
  • railway flag list against a linked project with flags configured
  • Create a flag, add a rule, verify with list --full and list --json
  • Confirm type-mismatch error and --force --type re-type flow

Made with Cursor

futurepastori and others added 6 commits June 25, 2026 22:11
Introduces list/create/set/unset subcommands with workspace-scoped owner resolution and a local GraphQL schema for signal operations.

Co-authored-by: Cursor <cursoragent@cursor.com>
The commands! macro already registers signals as an alias; remove the redundant visible_alias from the Parser struct.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduces flag as the primary command for upserting defaults, listing
flags, and managing targeting rules, with signal kept as an alias.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the public --owner flag with --scope (workspace:<id> or project:<id>) while keeping a hidden owner alias for compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
@futurepastori futurepastori added the release/minor Author minor release label Jul 7, 2026
@futurepastori futurepastori merged commit c22aaed into master Jul 7, 2026
6 of 7 checks passed
@futurepastori futurepastori deleted the victor/signals-v0 branch July 7, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/minor Author minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant