Skip to content

Quickstart

This guide shows you how to install the CLI, create your first Sprite, and start running commands. By the end, you’ll have a working environment that sticks around between runs, serves traffic over HTTP, and wakes up automatically when you need it.

Install with our install script (macOS/Linux):

Terminal window
curl -fsSL https://sprites.dev/install.sh | sh

This auto-detects your platform, downloads the binary with checksum verification, and installs to ~/.local/bin.

For Windows or manual installation, see CLI Installation or download from GitHub Releases.

Verify installation:

Terminal window
sprite --help

Sprites uses your Fly.io account for authentication:

Terminal window
sprite org auth

This opens a browser window to authenticate with Fly.io.

Terminal window
sprite create my-first-sprite

This creates a new Sprite with default configuration, running and ready to accept commands.

Set it as your active Sprite to avoid adding -s my-first-sprite to every command:

Terminal window
sprite use my-first-sprite

Execute commands in your Sprite:

Terminal window
# Run a simple command
sprite exec echo "Hello, Sprites!"
# Run multiple commands
sprite exec "cd /tmp && ls -la"
# Open an interactive shell
sprite console

Sprites come pre-configured with common development tools:

Terminal window
# Check available runtimes
sprite exec "node --version && python3 --version && go version"
# Install packages
sprite exec "pip install requests"
# Clone a repository
sprite exec "git clone https://github.com/your/repo.git"

Your Sprite’s filesystem persists between commands:

Terminal window
# Create a file
sprite exec "echo 'Hello' > /home/sprite/greeting.txt"
# Later, it's still there
sprite exec "cat /home/sprite/greeting.txt"

Every Sprite has a unique HTTP URL:

Terminal window
sprite url
Terminal window
# List all sprites
sprite list
# Destroy when done
sprite destroy my-first-sprite

Beyond the CLI, you can create and manage Sprites programmatically:

import { SpritesClient } from '@fly/sprites';
const client = new SpritesClient(process.env.SPRITE_TOKEN);
const sprite = await client.createSprite('my-sprite');
// Execute a command
const result = await sprite.execFile('python', ['-c', "print('hello')"]);
console.log(result.stdout);
// Stream output from long-running commands
const cmd = sprite.spawn('bash', ['-c', 'for i in {1..10}; do date +%T; sleep 0.5; done']);
for await (const line of cmd.stdout) {
process.stdout.write(line);
}
await sprite.delete();