Skip to content

CLI Commands Reference

Complete reference for all sprite CLI commands.

These options work with any command:

OptionDescription
--debug[=<file>]Enable debug logging (optionally to file)
-o, --org <name>Specify organization
-s, --sprite <name>Specify sprite
-h, --helpShow help

Simplified authentication with Fly.io.

Terminal window
sprite login

Remove all Sprites configuration.

Terminal window
sprite logout

Add API tokens for an organization.

Terminal window
sprite org auth [options]

Options:

  • --org <name> - Specify organization

If an organization requires an invite code, the CLI will prompt you during the flow.

Aliases: sprite orgs, sprite organizations, sprite o

Show configured organizations and tokens.

Terminal window
sprite org list

Remove tokens for a specific organization.

Terminal window
sprite org logout [options]

Options:

  • --org <name> - Organization to log out from

Disable keyring storage, store tokens in config file.

Terminal window
sprite org keyring disable

Enable keyring storage for tokens.

Terminal window
sprite org keyring enable

Create a new sprite.

Terminal window
sprite create [sprite-name]

Examples:

Terminal window
sprite create my-sprite
sprite create dev-env

Set the active sprite for the current directory.

Terminal window
sprite use [sprite]

Without arguments, opens an interactive selector to choose a sprite. Creates a .sprite file in the current directory.

Examples:

Terminal window
sprite use my-sprite
sprite use # Opens interactive sprite selector

List all sprites.

Terminal window
sprite list [options]

Options:

  • --prefix <string> - Filter by name prefix

Alias: sprite ls

Examples:

Terminal window
sprite list
sprite list --prefix "dev-"

Destroy a sprite.

Terminal window
sprite destroy [name]

Without a name, destroys the current sprite.

Examples:

Terminal window
sprite destroy my-sprite
sprite destroy # Destroy current sprite

Execute a command in the sprite environment.

Terminal window
sprite exec [options] [command...]

Options:

  • -dir <path> - Working directory
  • -env <KEY=VALUE,KEY2=VALUE2> - Environment variables (comma-separated)
  • -tty - Allocate pseudo-terminal
  • -id <session-id> - Attach to existing session
  • -detachable - Create detachable tmux session
  • -http-post - Use HTTP/1.1 fallback instead of WebSocket (non-TTY only)

Alias: sprite x

Examples:

Terminal window
sprite exec echo "hello"
sprite exec -dir /home/sprite npm test
sprite exec -env NODE_ENV=production npm start
sprite exec -tty bash
sprite exec -detachable "npm run dev"

Open an interactive shell in the sprite.

Terminal window
sprite console

Alias: sprite c

This opens /.sprite/bin/sprite-console, which selects a login shell based on your local environment and installs terminfo if needed.

Create a checkpoint of the current sprite state.

Terminal window
sprite checkpoint create

List all checkpoints for the current sprite.

Terminal window
sprite checkpoint list

Aliases: sprite checkpoint ls, sprite checkpoints ls

Show details about a checkpoint.

Terminal window
sprite checkpoint info <id>

Delete a checkpoint.

Terminal window
sprite checkpoint delete <id>

Alias: sprite checkpoint rm

Example:

Terminal window
sprite checkpoint delete v3

Restore a sprite from a checkpoint.

Terminal window
sprite restore <checkpoint-id>

Alias: sprite checkpoint restore <id>

Forward local ports to the sprite.

Terminal window
sprite proxy <port1> [port2...]

Examples:

Terminal window
sprite proxy 3000
sprite proxy 3000 8080 5432

Show or update the sprite’s URL.

Terminal window
sprite url [subcommand]

Subcommands:

  • sprite url - Show sprite URL
  • sprite url update --auth <type> - Update URL authentication

Auth Types:

  • public - No authentication required
  • default - Require sprite authentication (default)

Examples:

Terminal window
sprite url
sprite url update --auth public
sprite url update --auth default

List active exec sessions by running sprite exec with no command:

Terminal window
sprite exec

Make authenticated API calls.

Terminal window
sprite api [options] <path>

Uses curl with authentication headers automatically set.

Examples:

Terminal window
sprite api /v1/sprites
sprite api -X POST /v1/sprites -d '{"name": "test"}'

Upgrade the CLI to the latest version.

Terminal window
sprite upgrade [options]

Options:

  • --check - Check for updates without installing

Examples:

Terminal window
sprite upgrade
sprite upgrade --check
CodeMeaning
0Success
1General error
2Command not found
126Command cannot execute
127Command not found (in sprite)
128+Command terminated by signal
VariableDescription
SPRITE_TOKENAPI token override (legacy; falls back if no stored token)
SPRITE_URLDirect sprite URL (for local/dev direct connections)
SPRITES_API_URLAPI URL override (default: https://api.sprites.dev)

~/.sprites/sprites.json (managed by the CLI; format may evolve):

{
"version": "1",
"current_selection": {
"url": "https://api.sprites.dev",
"org": "personal"
},
"urls": {
"https://api.sprites.dev": {
"url": "https://api.sprites.dev",
"orgs": {
"personal": {
"name": "personal",
"keyring_key": "sprites-cli:<user-id>",
"use_keyring": true,
"sprites": {}
}
}
}
}
}

.sprite (in project directory):

{
"organization": "personal",
"sprite": "my-project-sprite"
}
Terminal window
# Create a sprite for a project
sprite create my-project
sprite use my-project
# Clone repo and install dependencies
sprite exec "git clone https://github.com/user/repo.git"
sprite exec -dir /home/sprite/repo "npm install"
# Run development server
sprite exec -detachable -dir /home/sprite/repo "npm run dev"
# Forward port locally
sprite proxy 3000
# Open interactive shell
sprite console
Terminal window
# Create ephemeral sprite
sprite create "ci-${CI_JOB_ID}"
# Run tests
sprite exec -dir /home/sprite/repo "npm test"
EXIT_CODE=$?
# Cleanup
sprite destroy "ci-${CI_JOB_ID}"
exit $EXIT_CODE
Terminal window
# Set up environment
sprite create clean-env
sprite exec "pip install -r requirements.txt"
# Save clean state
sprite checkpoint create
# Run experiments
sprite exec "python experiment.py"
# Restore to clean state
sprite restore <checkpoint-id>