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 the CLI
Section titled “Install the CLI”Install with our install script (macOS/Linux):
curl -fsSL https://sprites.dev/install.sh | shThis 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:
sprite --helpAuthenticate
Section titled “Authenticate”Sprites uses your Fly.io account for authentication:
sprite org authThis 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.
Create Your First Sprite
Section titled “Create Your First Sprite”sprite create my-first-spriteThis 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:
sprite use my-first-spriteRun Commands
Section titled “Run Commands”Execute commands in your Sprite:
# Run a simple commandsprite exec echo "Hello, Sprites!"
# Run multiple commandssprite exec "cd /tmp && ls -la"
# Open an interactive shellsprite consoleExplore the Environment
Section titled “Explore the Environment”Sprites come pre-configured with common development tools:
# Check available runtimessprite exec "node --version && python3 --version && go version"
# Install packagessprite exec "pip install requests"
# Clone a repositorysprite exec "git clone https://github.com/your/repo.git"Persistence in Action
Section titled “Persistence in Action”Your Sprite’s filesystem persists between commands:
# Create a filesprite exec "echo 'Hello' > /home/sprite/greeting.txt"
# Later, it's still theresprite exec "cat /home/sprite/greeting.txt"View Your Sprite’s URL
Section titled “View Your Sprite’s URL”Every Sprite has a unique HTTP URL:
sprite urlManage Sprites
Section titled “Manage Sprites”# List all spritessprite list
# Destroy when donesprite destroy my-first-spriteUsing the SDKs
Section titled “Using the SDKs”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 commandconst result = await sprite.execFile('python', ['-c', "print('hello')"]);console.log(result.stdout);
// Stream output from long-running commandsconst 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();package main
import ( "context" "fmt" "io" "os"
sprites "github.com/superfly/sprites-go")
func main() { ctx := context.Background() client := sprites.New(os.Getenv("SPRITE_TOKEN"))
sprite, _ := client.CreateSprite(ctx, "my-sprite", nil) defer client.DeleteSprite(ctx, "my-sprite")
// Execute a command cmd := sprite.Command("python", "-c", "print('hello')") output, _ := cmd.Output() fmt.Println(string(output))
// Stream output from long-running commands cmd = sprite.Command("bash", "-c", "for i in {1..10}; do date +%T; sleep 0.5; done") stdout, _ := cmd.StdoutPipe() cmd.Start() io.Copy(os.Stdout, stdout) cmd.Wait()}Next Steps
Section titled “Next Steps”- Working with Sprites - Find out about sessions, ports, persistence, and everything beyond the basics
- Core concepts: Lifecycle - Take a deeper dive into Sprites core concepts, beginning with Lifecyle and Persistence
- Billing and Cost Optimization - Learn how Sprites are billed, estimate your costs, and try cost optimization strategies