CLI Commands Reference
Complete reference for all sprite CLI commands.
Global Options
Section titled “Global Options”These options work with any command:
| Option | Description |
|---|---|
--debug[=<file>] | Enable debug logging (optionally to file) |
-o, --org <name> | Specify organization |
-s, --sprite <name> | Specify sprite |
-h, --help | Show help |
Authentication Commands
Section titled “Authentication Commands”sprite login
Section titled “sprite login”Simplified authentication with Fly.io.
sprite loginsprite logout
Section titled “sprite logout”Remove all Sprites configuration.
sprite logoutsprite org auth
Section titled “sprite org auth”Add API tokens for an organization.
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
sprite org list
Section titled “sprite org list”Show configured organizations and tokens.
sprite org listsprite org logout
Section titled “sprite org logout”Remove tokens for a specific organization.
sprite org logout [options]Options:
--org <name>- Organization to log out from
sprite org keyring disable
Section titled “sprite org keyring disable”Disable keyring storage, store tokens in config file.
sprite org keyring disablesprite org keyring enable
Section titled “sprite org keyring enable”Enable keyring storage for tokens.
sprite org keyring enableSprite Management
Section titled “Sprite Management”sprite create
Section titled “sprite create”Create a new sprite.
sprite create [sprite-name]Examples:
sprite create my-spritesprite create dev-envsprite use
Section titled “sprite use”Set the active sprite for the current directory.
sprite use [sprite]Without arguments, opens an interactive selector to choose a sprite. Creates a .sprite file in the current directory.
Examples:
sprite use my-spritesprite use # Opens interactive sprite selectorsprite list
Section titled “sprite list”List all sprites.
sprite list [options]Options:
--prefix <string>- Filter by name prefix
Alias: sprite ls
Examples:
sprite listsprite list --prefix "dev-"sprite destroy
Section titled “sprite destroy”Destroy a sprite.
sprite destroy [name]Without a name, destroys the current sprite.
Examples:
sprite destroy my-spritesprite destroy # Destroy current spriteCommand Execution
Section titled “Command Execution”sprite exec
Section titled “sprite exec”Execute a command in the sprite environment.
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:
sprite exec echo "hello"sprite exec -dir /home/sprite npm testsprite exec -env NODE_ENV=production npm startsprite exec -tty bashsprite exec -detachable "npm run dev"sprite console
Section titled “sprite console”Open an interactive shell in the sprite.
sprite consoleAlias: sprite c
This opens /.sprite/bin/sprite-console, which selects a login shell based on your local environment and installs terminfo if needed.
Checkpoints
Section titled “Checkpoints”sprite checkpoint create
Section titled “sprite checkpoint create”Create a checkpoint of the current sprite state.
sprite checkpoint createsprite checkpoint list
Section titled “sprite checkpoint list”List all checkpoints for the current sprite.
sprite checkpoint listAliases: sprite checkpoint ls, sprite checkpoints ls
sprite checkpoint info
Section titled “sprite checkpoint info”Show details about a checkpoint.
sprite checkpoint info <id>sprite checkpoint delete
Section titled “sprite checkpoint delete”Delete a checkpoint.
sprite checkpoint delete <id>Alias: sprite checkpoint rm
Example:
sprite checkpoint delete v3This performs a soft delete. You cannot delete the currently active checkpoint.
sprite restore
Section titled “sprite restore”Restore a sprite from a checkpoint.
sprite restore <checkpoint-id>Alias: sprite checkpoint restore <id>
Networking
Section titled “Networking”sprite proxy
Section titled “sprite proxy”Forward local ports to the sprite.
sprite proxy <port1> [port2...]Examples:
sprite proxy 3000sprite proxy 3000 8080 5432sprite url
Section titled “sprite url”Show or update the sprite’s URL.
sprite url [subcommand]Subcommands:
sprite url- Show sprite URLsprite url update --auth <type>- Update URL authentication
Auth Types:
public- No authentication requireddefault- Require sprite authentication (default)
Examples:
sprite urlsprite url update --auth publicsprite url update --auth defaultSessions
Section titled “Sessions”List active exec sessions by running sprite exec with no command:
sprite execAPI Access
Section titled “API Access”sprite api
Section titled “sprite api”Make authenticated API calls.
sprite api [options] <path>Uses curl with authentication headers automatically set.
Examples:
sprite api /v1/spritessprite api -X POST /v1/sprites -d '{"name": "test"}'Utility Commands
Section titled “Utility Commands”sprite upgrade
Section titled “sprite upgrade”Upgrade the CLI to the latest version.
sprite upgrade [options]Options:
--check- Check for updates without installing
Examples:
sprite upgradesprite upgrade --checkExit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Command not found |
| 126 | Command cannot execute |
| 127 | Command not found (in sprite) |
| 128+ | Command terminated by signal |
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
SPRITE_TOKEN | API token override (legacy; falls back if no stored token) |
SPRITE_URL | Direct sprite URL (for local/dev direct connections) |
SPRITES_API_URL | API URL override (default: https://api.sprites.dev) |
Configuration Files
Section titled “Configuration Files”Global Config
Section titled “Global Config”~/.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": {} } } } }}Local Context
Section titled “Local Context”.sprite (in project directory):
{ "organization": "personal", "sprite": "my-project-sprite"}Examples
Section titled “Examples”Development Workflow
Section titled “Development Workflow”# Create a sprite for a projectsprite create my-projectsprite use my-project
# Clone repo and install dependenciessprite exec "git clone https://github.com/user/repo.git"sprite exec -dir /home/sprite/repo "npm install"
# Run development serversprite exec -detachable -dir /home/sprite/repo "npm run dev"
# Forward port locallysprite proxy 3000
# Open interactive shellsprite consoleCI/CD Usage
Section titled “CI/CD Usage”# Create ephemeral spritesprite create "ci-${CI_JOB_ID}"
# Run testssprite exec -dir /home/sprite/repo "npm test"EXIT_CODE=$?
# Cleanupsprite destroy "ci-${CI_JOB_ID}"
exit $EXIT_CODECheckpoint Workflow
Section titled “Checkpoint Workflow”# Set up environmentsprite create clean-envsprite exec "pip install -r requirements.txt"
# Save clean statesprite checkpoint create
# Run experimentssprite exec "python experiment.py"
# Restore to clean statesprite restore <checkpoint-id>