Skip to content

Use sprite login instead of sprite org auth to authenticate the CLI - #270

Open
mlr wants to merge 2 commits into
superfly:mainfrom
mlr:sprite-login-auth
Open

mlr wants to merge 2 commits into
superfly:mainfrom
mlr:sprite-login-auth

Conversation

@mlr

@mlr mlr commented Oct 13, 2026 •

Copy link
Copy Markdown

The quickstart and the CLI authentication page tell new users to run sprite org auth. On a machine that has never run sprite login, it fails:

Error: no Fly.io token found. Please run 'sprite login' first

This happens even when flyctl is logged in, because sprite org auth doesn't read the flyctl session. The fallback the docs suggest (fly auth logout, fly auth login, then retry) doesn't fix it either.

This PR switches first-time setup and re-authentication to sprite login:

  • quickstart.mdx: the Authenticate step uses sprite login. The flyctl fallback note is gone.
  • cli/authentication.mdx: Quick Setup, Authentication Flow and Troubleshooting use sprite login. The claim that the CLI reuses the flyctl session is gone, and "Adding Organizations" now says to log in first.
  • working-with-sprites.mdx: the connection-error tip uses sprite login.

Aligns with the agent skill

The Sprites agent skill at https://fly.io/agent-skills/sprites-quickstart/SKILL.md already uses sprite login, and so do the agent-readable pages at fly.io/sprites. With this change, the docs give people the same instructions that agents already get.

The CLI agrees too. sprite org --help says: "After logging in with sprite login, use org to manage your organization tokens and defaults."

Unchanged

  • sprite org auth --org my-team in the multiple-organization sections. That's a correct use: it adds a token for another org after sprite login.
  • cli/commands.mdx, which is generated from the CLI help.

Testing

I ran the quickstart with coding agents against a Fly.io account that had never used Sprites:

Run Auth step Result
Claude Code sprite login 40 s, 10 tool calls, 1 browser approval
Claude Code sprite org auth Failed with the error above, then fell back to sprite login: about 90 s, 22 tool calls, 2 browser approvals plus a pasted code
opencode sprite login 7 tool calls, 1 browser approval
opencode sprite org auth Failed with the error above, then fell back to sprite login: 11 tool calls

Every sprite org auth run ended up on sprite login anyway.

@alexleventer
alexleventer requested a review from kcmartin October 13, 2026 20:09

@kcmartin kcmartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced the error with an empty config: sprite org auth prints "no Fly.io token found. Please run 'sprite login' first". sprite login -o matches the CLI help, and Vale is clean on the changed lines.

Optional, since you're already reworking this page: under "Select an Organization", "To switch organizations: sprite org auth --org my-team" actually adds a token for another org rather than switching. "To add another organization:" would be more accurate.

This branch has not been deployed

No deployments
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.

2 participants