Skip to content

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

Closed
asib wants to merge 1 commit intosuperfly:masterfrom
asib:tokens-readonly-org-flag
Closed

feat(tokens): add -o/--org flag to tokens create readonly#4875
asib wants to merge 1 commit intosuperfly:masterfrom
asib: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.

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
Copy link
Copy Markdown
Contributor Author

asib commented Apr 29, 2026

Superseded by #4876 (re-opened from a branch in this repo so preflight CI has access to secrets).

@asib asib closed this Apr 29, 2026
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