Skip to content

feat(tokens): add -o/--org flag to tokens create readonly#4876

Merged
asib merged 1 commit intomasterfrom
tokens-readonly-org-flag
Apr 29, 2026
Merged

feat(tokens): add -o/--org flag to tokens create readonly#4876
asib merged 1 commit intomasterfrom
tokens-readonly-org-flag

Conversation

@asib
Copy link
Copy Markdown
Contributor

@asib asib commented Apr 29, 2026

Summary

  • Adds the standard -o/--org flag to fly tokens create readonly so it can be used non-interactively (e.g. in CI).
  • The underlying org resolver (OrgFromEnvVarOrFirstArgOrSelect) already reads flag.GetOrg(ctx) and only falls back to the interactive picker when empty — the flag just wasn't registered on this subcommand. The sibling tokens create org and tokens create litefs-cloud already register it.

Before: fly tokens create readonly always opened the org picker, so it couldn't be scripted (besides via the FLY_ORG env var).
After: fly tokens create readonly -o my-org works.

(Re-opens #4875 from a branch in the main repo so preflight CI can access secrets.)

Test plan

  • fly tokens create readonly -o <slug> returns a token without prompting
  • fly tokens create readonly (no flag, no FLY_ORG) still falls back to the interactive picker
  • FLY_ORG=<slug> fly tokens create readonly still works (env-var path unchanged)
  • fly tokens create readonly --help shows -o, --org in the flag list

🤖 Generated with Claude Code

Allows non-interactive use of `fly tokens create readonly`. The
underlying org resolver already reads the flag value; it just wasn't
registered on this subcommand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@asib asib merged commit 8fd589d into master Apr 29, 2026
32 of 56 checks passed
@asib asib deleted the tokens-readonly-org-flag branch April 29, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant