An Elixir SDK for the Sprites code container runtime - a remote code execution platform for interactive development.
# Install dependencies
mix deps.get
# Compile
mix compile
# Run tests
mix test
# Format code (REQUIRED before committing)
mix format
# Generate docs
mix docscd test_cli
mix deps.get
mix escript.build
# Usage
export SPRITES_TOKEN=your-token
./test-cli create my-sprite
./test-cli -sprite my-sprite -output stdout echo hello
./test-cli destroy my-spriteexport SPRITES_TEST_TOKEN=your-token
export SDK_TEST_COMMAND=/path/to/sprites-ex/test_cli/test-cli
# Run from the Go SDK directory
go test -vlib/sprites/
├── sprites.ex # Main public API (entry point)
├── client.ex # HTTP client for REST API (uses Req)
├── sprite.ex # Sprite instance representation
├── command.ex # Command execution via WebSocket (GenServer, uses gun)
├── protocol.ex # Binary protocol codec for WebSocket messages
├── stream.ex # Lazy Stream interface for command output
└── errors.ex # Custom exceptions (APIError, CommandError, etc.)
- req - HTTP client for REST API calls
- gun - Erlang WebSocket/HTTP client for command execution
- jason - JSON encoding/decoding
SPRITES_TOKEN- Authentication token for Sprites APISPRITES_TEST_TOKEN- Authentication token for testing
- Elixir: 1.18.4-otp-27
- Erlang: 27.0.1
(See .tool-versions for asdf configuration)
- Base URL:
https://api.sprites.dev - HTTP timeout: 30 seconds
- Create sprite timeout: 120 seconds
- WebSocket upgrade timeout: 10 seconds
- Always run
mix formatbefore committing - All public functions should have
@docand@spec - Follow standard Elixir conventions