SpriteSmith

Docs

Setup

Choose a workflow

The browser studio combines references, chat, animation preview, and exports. The CLI connects to your service account and saves one pose per command. Install it for shell scripts and repeatable text-to-image jobs.

Configure a service and token

SPRITESMITH_API_BASE points at a hosted HTTPS service. Use --api URL to override it for one command. The default address is http://127.0.0.1:8080 for local development.

SPRITESMITH_API_TOKEN takes precedence over the token file. SPRITESMITH_CONFIG_DIR can select the directory containing that file.

Usage

Refine a sprite

Start by naming the subject and the intended motion. In the app, preview the animation before adding detail. Make one change at a time, such as adjusting the cadence or holding the first pose longer, so you can judge the effect.

Export a pose or animation

Choose PNG for a raster image or SVG to keep vector paths editable. The CLI exports the default pose in either format. Use the browser studio for animation sheets and individual frames.

Select the generation model

The CLI uses Haiku by default. Use --model opus before the prompt to select Opus. The service keeps the model choice with the operation record. Keep the same selection when retrying the same operation.

Read a result in a script

Place --json before the command or before the prompt text. A successful result reports the saved path, format, and operation ID. Diagnostics go to stderr. Exit status 2 indicates invalid usage, and 1 indicates a failed operation.

Terminal
spritesmith --json version

Testing

Check the installed client

Terminal
spritesmith --version
spritesmith --help

Check these before using an API key. They report the installed build and available flags.

Verify a source checkout

From the cloned repository, run the pinned Mise tasks in order. The integration suite uses disposable fixtures to exercise the client and installer.

Terminal
mise run setup
mise run build
mise run test

Architecture

Follow a generation job

From prompt to file
  1. PromptDescribe the sprite
  2. GenerationThe API creates and runs a job
  3. ReviewThe client waits for completion
  4. ExportSave the supported format

The CLI submits text and downloads the finished pose through the API. It waits for the server to complete the operation before creating the requested output file.

Resume after an interruption

Keep the operation ID, prompt, and generation options. Use the same ID and input when retrying an interrupted request. An existing output file is preserved. If the service says the job needs reconciliation, check its state before starting a new request.

Examples

Save a transparent PNG

Use PNG when you need a raster asset with transparency. This example uses the default vector generation mode and saves the resulting default pose as PNG. The lantern illustration shows the kind of subject the prompt describes.

spritesmith prompt --operation-id lantern-v1 --out lantern.png 'A walking lantern with warm amber glass'
An illustrated amber lantern sprite with small feet and glowing glass

Save an editable SVG

Select SVG when you want to edit the paths after export. This leaf is an illustration of an SVG asset.

spritesmith prompt --format svg --operation-id leaf-v1 --out leaf.svg 'A tiny forest spirit shaped like a leaf'
An illustrated green leaf sprite built from vector shapes