Skip to main content
Sprites uses your Fly.io account for authentication. This guide covers setting up authentication and managing API tokens.

Quick Setup

The simplest way to authenticate:
This opens a browser window to authenticate with Fly.io. 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:
If you’re not logged in or encounter issues:

2. Select an Organization

If you belong to multiple Fly.io organizations, select one:
Output:
To switch organizations:

Token Management

You can also create and manage tokens at sprites.dev/account.

Viewing Your Token

Your Sprites API token is stored securely. To view it:
The token is used for API and SDK authentication.

Token Storage

By default, tokens are stored in your system keyring for security. You can switch to file-based storage:

Config File Structure

When using file-based storage, ~/.sprites/sprites.json contains:

Multiple Organizations

Adding Organizations

Add tokens for multiple organizations:

Switching Organizations

Per-Directory Organization

Use different organizations in different directories:
The organization is saved in the local .sprite file.

Logging Out

Remove a Single Organization

Remove All Credentials

This removes all stored tokens and configuration.

CI/CD Authentication

For CI/CD or automated environments, use sprite auth setup --token to configure authentication:
You can generate tokens at sprites.dev/account.

GitHub Actions Example

Environment Variables

After authentication is configured, you can use environment variables to override settings:

Troubleshooting

”Not authenticated” Error

Token Not Found

If the CLI can’t find your token:

Browser Doesn’t Open

If the authentication browser doesn’t open automatically:
  1. Look for the URL printed in the terminal
  2. Copy and paste it into your browser
  3. Complete authentication
  4. Return to the terminal

Permission Errors

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

Security Best Practices

  1. Use keyring storage (default) for interactive use
  2. Use sprite auth setup --token for CI/CD pipelines with tokens stored as secrets
  3. Never commit .sprites/ or .sprite files to version control
  4. Rotate tokens periodically by re-authenticating
  5. Use organization-specific tokens rather than personal tokens in shared environments

Next Steps

Commands Reference

Full CLI documentation and command examples

Quickstart

Create your first Sprite in minutes