Skip to main content
ttr flags reads and writes the runtime feature flag rules described in feature flags. It authenticates like every other ttr command, with the session from ttr login. The server derives the actor from that token and rejects any actor, client or time in a request, so a rule write is attributed to the signed-in operator and recorded with client ttr in the audit log. Reading needs the root view_infrastructure or manage_feature_flags permission. Writing needs manage_feature_flags, and the database checks the controller of the rule’s scope again.
Rules are platform rules unless --workspace or --user names a subject. The default environment is production, so a production write needs --confirm KEY with the flag key; --dry-run prints the request without sending it. --reason is required and kept in the audit log. Never put a secret in a reason. Without --expected-revision the command reads the stored revision first and writes against it, which only guards the gap between that read and the write. A script that must not overwrite a concurrent change passes --expected-revision so a stale write fails with exit code 2. A retry with the same --operation-id is safe: the database replays the stored result. --json prints one object per command:
A saved rule reaches every surface within about a minute. The HTTP contract is GET and POST /api/v1/infrastructure/feature-flags/rules and GET /api/v1/infrastructure/feature-flags/rules/audit; regression coverage is in packages/sdk/src/cli/flags.test.ts, packages/feature-flags/src/rule-api.test.ts and the admin route test. Workspace administrators manage their own workspace rules and workspace secrets through the workspace API, not through this root command group.