pxlb is a thin Go CLI for the PixelLab v2 API. It exposes PixelLab routes directly, keeps request fields as simple flags, supports async job polling, and can save returned images or binary downloads.
Add pxlb to your .mise.toml as a GitHub release tool. Pick the asset for your OS and CPU architecture.
Linux x86_64 example:
[tools]
"github:aviorstudio/pixellab-cli" = { version = "v0.0.1", asset_pattern = "pxlb_Linux_x86_64.tar.gz", bin = "pxlb" }Then install and verify:
mise install
pxlb --versionCommon asset patterns:
pxlb_Linux_x86_64.tar.gz
pxlb_Linux_arm64.tar.gz
pxlb_Darwin_x86_64.tar.gz
pxlb_Darwin_arm64.tar.gz
pxlb_Windows_x86_64.zip
pxlb_Windows_arm64.zip
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/aviorstudio/pixellab-cli/main/install.sh | shInstall a specific version:
curl -fsSL https://raw.githubusercontent.com/aviorstudio/pixellab-cli/main/install.sh | VERSION=0.0.1 shInstall to a specific directory:
curl -fsSL https://raw.githubusercontent.com/aviorstudio/pixellab-cli/main/install.sh | INSTALL_DIR="$HOME/.local/bin" shWindows builds are available from GitHub Releases.
pxlb --help
pxlb --versionSet your API key:
export PIXELLAB_API_KEY="..."
pxlb balanceYou can also put PIXELLAB_API_KEY=... in a .env file in the directory where you run pxlb, or pass --token <key> for a single command.
Use the API route without the leading slash:
pxlb <api-route> [flags]Examples:
pxlb balance
pxlb create-image-pixen --description "cute dragon" --image-size 128x128 --out ./out
pxlb generate-image-v2 --description "crystal sword" --image-size 128x128 --wait --out ./out
pxlb objects/<object_id>/animations --animation-description "heavy sword slash" --frame-count 16 --waitpxlb infers the HTTP method from the route:
- Unique routes use their only supported method.
- Path parameters go directly in the route, such as
objects/abc123; do not pass the same id again as--object-id. GET/DELETEcollisions default to safeGET.- Use
--http-method deletefor destructive delete routes. /tilesetshas bothGETandPOST; body flags or--body-jsonselectPOST, otherwise it lists tilesets withGET.
Collision examples:
pxlb objects/<object_id>
pxlb objects/<object_id> --http-method delete
pxlb tilesets --limit 50 --offset 0
pxlb tilesets --lower-description "ocean" --upper-description "beach"Show all routes with one-sentence descriptions:
pxlb --helpShow build metadata:
pxlb --version| Flag | Purpose |
|---|---|
--token <key> |
PixelLab API key. Overrides PIXELLAB_API_KEY and .env. |
--base-url <url> |
API base URL. Defaults to https://api.pixellab.ai/v2. |
--http-method <method> |
Override inferred method for colliding routes. Usually only needed for delete. |
--json |
Print raw JSON response. |
--out <path> |
Save binary responses or returned base64 images. |
--wait |
Poll returned background jobs until completion. |
--poll-interval <duration> |
Polling interval for --wait, for example 5s. |
--timeout <duration> |
Max wait duration, for example 10m. |
--body-json <json-or-file> |
Send raw JSON from an inline JSON string or file. |
--quiet |
Suppress normal JSON output. |
Request body fields become kebab-case flags:
pxlb create-image-pixen \
--description "crystal sword" \
--image-size 128x128 \
--outline "selective outline" \
--no-background \
--seed 123Common conversions:
- API
snake_casefields become CLI--kebab-caseflags. - Size values use
WIDTHxHEIGHT, such as128x128. - Image flags accept local file paths and are encoded as PixelLab
Base64Imageobjects. - Repeated flags create arrays, such as
--tag enemy --tag boss. - Complex request bodies can always use
--body-json.
Raw JSON escape hatch:
pxlb objects/<object_id>/animations \
--body-json ./animation-request.json \
--waitMany generation routes return a background job. Add --wait to poll until completion:
pxlb generate-image-v2 \
--description "crystal sword" \
--image-size 128x128 \
--wait \
--out ./outCheck a job manually:
pxlb background-jobs/<job_id>Save binary downloads:
pxlb characters/<character_id>/zip --out character.zippxlb balancepxlb create-image-pixen --description "cute dragon" --image-size 128x128 --out ./out
pxlb create-image-bitforge --description "ancient shield" --image-size 128x128
pxlb create-image-pixflux --description "fire spell icon" --image-size 128x128
pxlb generate-image-v2 --description "crystal sword" --image-size 128x128 --wait --out ./out
pxlb generate-with-style-v2 --style-image style.png --description "wooden chest" --image-size 128x128 --waitpxlb remove-background --image input.png --image-size 128x128 --out out.png
pxlb image-to-pixelart --image input.png --image-size 512x512 --output-size 128x128
pxlb resize --description "resize cleanly" --reference-image input.png --reference-image-size 64x64 --target-size 128x128
pxlb inpaint-v3 --description "golden crown" --inpainting-image image.png --mask-image mask.png
pxlb edit-image --image input.png --image-size 128x128 --description "make it golden" --width 128 --height 128pxlb create-1-direction-object --description "wooden barrel" --size 128 --view sidescroller
pxlb create-8-direction-object --description "stone fountain" --size 128 --view "low top-down"
pxlb objects --limit 50 --offset 0
pxlb objects/<object_id>
pxlb objects/<object_id> --http-method delete
pxlb objects/<object_id>/tags --tag barrel --tag propReview-pack object workflow:
pxlb create-1-direction-object --description "forest mushroom" --size 128 --wait
pxlb objects/<object_id>/select-frames --index 0 --index 3 --common-tag props
pxlb objects/<object_id>/dismiss-reviewObject states:
pxlb objects/<object_id>/states --edit-description "make it golden"pxlb objects/<object_id>/animations \
--animation-description "heavy sword slash" \
--display-name attack \
--frame-count 16 \
--waitFor combat animations, we found that 16-frame v3 generations plus manual downselection usually work best. See Attack Animation Experiments for prompt lessons and examples.
pxlb create-character-v3 --description "blue wizard" --image-size 64x64
pxlb create-character-pro --description "armored knight" --image-size 96x96
pxlb create-character-with-4-directions --description "goblin" --image-size 64x64
pxlb create-character-with-8-directions --description "goblin" --image-size 64x64
pxlb characters --limit 50 --offset 0
pxlb characters/<character_id>
pxlb characters/<character_id>/zip --out character.zip
pxlb characters/<character_id> --http-method deleteCharacter states and animations:
pxlb create-character-state --character-id <uuid> --edit-description "wearing red armor"
pxlb animate-character --character-id <uuid> --mode v3 --action-description "walking" --frame-count 8
pxlb characters/animations --character-id <uuid> --action-description "walking"pxlb animate-with-text-v3 --first-frame idle.png --action "heavy sword slash" --frame-count 16
pxlb animate-with-text-v2 --reference-image sprite.png --reference-image-size 128x128 --action "attack" --image-size 128x128
pxlb animate-with-skeleton --reference-image sprite.png --image-size 64x64 --skeleton-keypoints-json poses.json
pxlb interpolation-v2 --start-image start.png --end-image end.png --action "slash" --image-size 128x128
pxlb edit-animation-v2 --description "add glow" --frames-json frames.json --image-size 128x128pxlb create-isometric-tile --description "grass on dirt" --image-size 32x32
pxlb isometric-tiles --limit 50 --offset 0
pxlb isometric-tiles/<tile_id>
pxlb create-tiles-pro --description "1). grass 2). dirt 3). stone" --tile-type isometric --tile-size 32
pxlb tiles-pro/<tile_id>
pxlb tilesets --lower-description "ocean" --upper-description "beach"
pxlb tilesets --limit 50 --offset 0
pxlb tilesets/<tileset_id>
pxlb tilesets-sidescroller --lower-description "stone bricks" --transition-description "moss"
pxlb create-tileset-sidescroller --lower-description "stone bricks" --transition-description "moss"pxlb enhance-pixen-prompt --description "dragon" --image-size 128x128
pxlb enhance-character-v3-prompt --description "blue wizard" --image-size 64x64
pxlb enhance-animation-v3-prompt --first-frame idle.png --action "walking"- Full CLI endpoint map: every PixelLab v2 route, flags, schemas, async behavior, and implementation notes.
- Attack animation experiments: practical lessons from dialing in readable melee attack frames.
- PixelLab API docs: upstream API reference.
- PixelLab OpenAPI spec: upstream machine-readable schema.
- PixelLab LLM docs: condensed upstream docs for agents and LLMs.
make test
make build
./bin/pxlb --helpThe built binary is written to bin/pxlb, and bin/ is ignored by git.
Releases use v* tags. The manual GitHub Actions release workflow must run from main, accepts a patch, minor, or major bump, starts at v0.0.1 when no release tags exist, runs Go tests, injects version/build metadata, and builds pxlb binaries for Linux, macOS, and Windows with checksums.