npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aispritegenerator-cli

v1.0.0

Published

Standalone CLI for generating AI sprites with Google Vertex AI.

Downloads

29

Readme

AISpriteGenerator CLI

Generate game-ready sprite images from prompts, directly from the command line.

Who This Is For

  • Game devs who want fast art iteration.
  • Teams scripting image generation in CI or local tooling.
  • AI agents that need a simple CLI contract.

Install

npm install -g aispritegenerator-cli

Both command names are available after install:

  • aispritegenerator-cli (primary)
  • spritegen-agent (alias)

Install Codex Skill

Install the bundled image-generation skill into your current repo:

aispritegenerator-cli install --skills

Install globally into $CODEX_HOME/skills (or ~/.codex/skills):

aispritegenerator-cli install --skills --global

Custom destination and overwrite:

aispritegenerator-cli install --skills --target /path/to/skills --force

Create Vertex Credentials (Service Account Key)

  1. Create or select a Google Cloud project in the Google Cloud Console.
  2. Enable the Vertex API for that project: https://console.cloud.google.com/apis/library/aiplatform.googleapis.com
  3. Go to IAM & Admin -> Service Accounts, create a service account for this CLI.
  4. Grant roles to that service account:
  • Vertex AI User (roles/aiplatform.user)
  • Service Usage Consumer (roles/serviceusage.serviceUsageConsumer)
  1. Open the service account, go to Keys, and create a new JSON key.
  2. Save the JSON file somewhere safe on your machine (never commit it to git).
  3. Point the CLI at it with --credentials, GOOGLE_APPLICATION_CREDENTIALS, or auth login.

60-Second Quickstart

  1. Save your Vertex defaults once:
spritegen-agent auth login \
  --project-id your-gcp-project-id \
  --credentials /absolute/path/to/service-account.json \
  --location global \
  --model-id gemini-3-pro-image-preview
  1. Generate one image:
spritegen-agent generate \
  --prompt "top-down pixel art copper ore icon" \
  --count 1 \
  --width 256 \
  --height 256 \
  --output-dir ./out \
  --prefix copper-ore

If this works, you are ready to batch generate.

Example Gallery

These were generated with this CLI and committed as examples:

| Characters | Characters | |---|---| | Knight | Ranger | | Mech Pilot | Mage |

| Terrain Tiles | Terrain Tiles | |---|---| | Grass Tile | Cobblestone Tile |

Use these prompts as a starting point:

  • Full-body 2D game sprite of a heroic fantasy knight in steel armor with blue tabard, idle pose, centered, clean silhouette, high detail, no text.
  • Full-body 2D game sprite portrait of a fantasy ranger wearing green hood and leather armor, centered subject, clean silhouette, game art, no text.
  • 2D game sprite portrait of a dieselpunk mech pilot with glowing visor and metal shoulder pads, centered subject, clean silhouette, game art, no text.
  • Full-body 2D game sprite portrait of an arcane mage with long robe and glowing staff, idle pose, centered, clean silhouette, game art, no text.
  • Seamless top-down painted grass terrain tile texture for strategy game map, no objects, no text, no border seams.
  • Seamless top-down cobblestone terrain tile texture for fantasy town map, no objects, no text, no border seams.

Common Workflows

Generate one icon:

spritegen-agent generate \
  --prompt "isometric iron ore game icon" \
  --count 1 \
  --width 128 \
  --height 128 \
  --output-dir ./out \
  --prefix iron-ore

Generate 20 variations:

spritegen-agent generate \
  --prompt "fantasy potion bottle icon, game UI style" \
  --count 20 \
  --seed-start 1000 \
  --output-dir ./out \
  --prefix potion

Generate transparent sprites:

spritegen-agent generate \
  --prompt "2d game tree stump, centered subject" \
  --count 8 \
  --transparent \
  --formats png,webp \
  --output-dir ./out \
  --prefix tree-stump

--transparent enables two-pass transparent-background extraction. Without it, generation is single-pass and opaque by default.

What You See While It Runs

  • Live progress is emitted as JSON lines on stderr (stream: "progress").
  • Final run result is emitted as JSON on stdout.
  • Exit code is non-zero if any item failed.

Progress event types:

  • run-start
  • item-start
  • item-heartbeat
  • item-retry
  • item-done
  • item-failed
  • run-complete

Split streams if you are automating:

spritegen-agent generate ... 1>run-report.json 2>run-progress.log

Agent/Automation Notes

  • Treat stdout JSON as source of truth.
  • Check summary.failed; if > 0, treat the run as failed.
  • Use items[].outputs[].path to collect generated files.
  • Use items[].error for per-item diagnostics.

Configuration

Environment variables:

  • SPRITEGEN_AGENT_PROFILE
  • VERTEX_PROJECT_ID
  • GOOGLE_APPLICATION_CREDENTIALS
  • VERTEX_LOCATION (default: global)
  • VERTEX_MODEL_ID (default: gemini-3-pro-image-preview)

Resolution order:

  • CLI flags
  • Environment variables
  • Saved profile (auth login)
  • Built-in defaults (global, gemini-3-pro-image-preview)

Common Failures

| Symptom | Likely cause | Fix | |---|---|---| | Missing project id error | VERTEX_PROJECT_ID not set and no saved profile | Pass --project-id or run auth login | | Credentials path missing/unreadable | Invalid GOOGLE_APPLICATION_CREDENTIALS or missing --credentials | Point to a valid service account JSON file | | Permission denied from Vertex | Service account lacks required IAM permissions | Update IAM roles on the project | | Long retries / overload | Vertex transient capacity issues | Increase timeout/retry options and let backoff continue |

Command Reference

aispritegenerator-cli --help
aispritegenerator-cli --version
aispritegenerator-cli install --skills
aispritegenerator-cli auth status
aispritegenerator-cli auth logout

Development

npm install
npm run lint
npm test
npm run build

Publishing

npm login
npm run lint
npm test
npm run build
npm publish --access public

License

MIT