From f21422bf5e255c839bf3761a8d99ad1186cca061 Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Tue, 13 Oct 2026 12:56:07 -0700 Subject: [PATCH 1/2] Use sprite login instead of sprite org auth to authenticate the CLI --- cli/authentication.mdx | 37 ++++++++++++------------------------- quickstart.mdx | 8 ++------ working-with-sprites.mdx | 2 +- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/cli/authentication.mdx b/cli/authentication.mdx index fba961e..beb341a 100644 --- a/cli/authentication.mdx +++ b/cli/authentication.mdx @@ -11,33 +11,25 @@ Sprites uses your Fly.io account for authentication. This guide covers setting u The simplest way to authenticate: ```bash -sprite org auth +sprite login ``` -This opens a browser window to authenticate with Fly.io. Once complete, you're ready to use Sprites. +This opens a browser window where you sign in to Fly.io and approve the CLI. Once complete, you're ready to use Sprites. ## Authentication Flow ### 1. Authenticate with Fly.io -If you're already logged into `flyctl`, the Sprites CLI can use your existing session: - ```bash -sprite org auth +sprite login ``` -If you're not logged in or encounter issues: - -```bash -# First, ensure you're logged into fly -fly auth logout -fly auth login +This signs you in to Fly.io in the browser, then adds an API token for your organization. You don't need to be logged into `flyctl` first. If the browser doesn't open, open the link the command prints. -# Verify your flyctl session works -fly apps list +To log in to a specific organization: -# Then authenticate with Sprites -sprite org auth +```bash +sprite login -o my-team ``` ### 2. Select an Organization @@ -123,7 +115,7 @@ When using file-based storage, `~/.sprites/sprites.json` contains: ### Adding Organizations -Add tokens for multiple organizations: +After you log in with `sprite login`, add tokens for more organizations: ```bash # Add another organization @@ -216,12 +208,7 @@ export SPRITES_API_URL="https://api.sprites.dev" # Override API endpoint ```bash # Re-authenticate -sprite org auth - -# If that fails, reset and try again -fly auth logout -fly auth login -sprite org auth +sprite login ``` ### Token Not Found @@ -236,7 +223,7 @@ sprite org keyring disable cat ~/.sprites/sprites.json | grep api_token # Re-authenticate if needed -sprite org auth +sprite login ``` ### Browser Doesn't Open @@ -253,8 +240,8 @@ If the authentication browser doesn't open automatically: If you get permission errors after authentication: 1. Verify your Fly.io account has access to the organization -2. Check that your `flyctl` session is valid: `fly apps list` -3. Try re-authenticating: `sprite org auth` +2. Check which organizations the CLI has tokens for: `sprite org list` +3. Try re-authenticating: `sprite login` ## Security Best Practices diff --git a/quickstart.mdx b/quickstart.mdx index c1b12a3..1e4671b 100644 --- a/quickstart.mdx +++ b/quickstart.mdx @@ -34,14 +34,10 @@ sprite --help Sprites uses your Fly.io account for authentication: ```bash -sprite org auth +sprite login ``` -This opens a browser window to authenticate with Fly.io. - - -If authentication fails, try running `fly auth logout` followed by `fly auth login` first, then retry `sprite org auth`. - +This opens a browser window where you sign in to Fly.io and approve the CLI. If the browser doesn't open, open the link the command prints. ## Create Your First Sprite diff --git a/working-with-sprites.mdx b/working-with-sprites.mdx index 25249fd..771060a 100644 --- a/working-with-sprites.mdx +++ b/working-with-sprites.mdx @@ -297,7 +297,7 @@ umount /tmp/sprite-mount ### Common Error Scenarios **Connection errors:** -- Check auth: `sprite org auth` +- Re-authenticate: `sprite login` - Verify Sprite exists: `sprite list` - Wait a moment and retry From d5542ce8b46b402fd8e1e57e369aa292171e8188 Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Wed, 14 Oct 2026 01:00:12 -0700 Subject: [PATCH 2/2] Fix sprite org auth labels and use org set-default for default org --- cli/authentication.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/authentication.mdx b/cli/authentication.mdx index beb341a..e39a337 100644 --- a/cli/authentication.mdx +++ b/cli/authentication.mdx @@ -48,7 +48,7 @@ Organizations: another-org ``` -To switch organizations: +To add another organization: ```bash sprite org auth --org my-team @@ -132,7 +132,7 @@ sprite org list sprite -o my-team list # Set default organization -sprite org auth --org my-team +sprite org set-default my-team ``` ### Per-Directory Organization