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

@bytetrue/pi-image-gen

v0.3.0

Published

Pi TUI configuration and an on-demand Skill/CLI for image generation.

Readme

Forked from @amaster.ai/pi-image-gen. Redistribution details are preserved in NOTICE.

The package deliberately has two surfaces:

  • /image-gen gives people a complete TUI setup flow.
  • The pi-image-gen Skill and bundled CLI load only when the Agent needs to create or edit an image.

No permanent image_generate tool schema is added to every request.

Install

pi install npm:@bytetrue/pi-image-gen

Restart Pi and run:

/image-gen

Choose a built-in or custom provider, select a model, configure credentials, and set an output directory. Normal setup never requires editing JSON by hand.

Generate from Pi

Ask normally:

Generate a cinematic 16:9 image of a lunar research station.

For an edit or a consistent character/style, attach a local reference image or mention a previously generated path. The Skill invokes the bundled CLI and returns generated files as inline Markdown.

The configured defaultModel is always used; the CLI does not accept a model override.

Providers

| Protocol | Built-in routing | Standard environment variable | | --- | --- | --- | | OpenAI | gpt-image-2 | OPENAI_API_KEY | | Google Gemini | Gemini image models and Nano Banana aliases | GEMINI_API_KEY | | Alibaba DashScope | Qwen Image models | DASHSCOPE_API_KEY | | Volcengine Ark | Seedream models and aliases | ARK_API_KEY | | OpenRouter | openrouter/<vendor>/<model> | OPENROUTER_API_KEY |

Custom providers select one of these wire protocols and supply their own endpoint and model id.

Configuration

/image-gen can write either the active global settings or a trusted project's <cwd>/.pi/settings.json. All fields stay under pi-image-gen; unrelated Pi settings are preserved.

Credential choices include:

  • the provider's standard environment variable;
  • another $ENV_VAR reference;
  • a literal key entered in a masked field; or
  • no key for a local or keyless endpoint.

Writes use an atomic 0600 path and refuse to overwrite malformed settings. Selecting No API key writes apiKey: "", blocking lower-layer and standard-environment credentials. Selecting No extra headers writes headers: {}, blocking inherited headers.

Relative output directories resolve from the Pi session working directory. The default is .pi/images.

{
  "pi-image-gen": {
    "defaultModel": "my-sd/sd-3-large",
    "outputDir": ".pi/images",
    "providers": {
      "openai": {
        "baseUrl": "https://proxy.example.com/v1",
        "apiKey": "$OPENAI_API_KEY"
      }
    },
    "customProviders": {
      "my-sd": {
        "api": "openai",
        "baseUrl": "https://api.example.com/v1",
        "apiKey": "$SD_KEY",
        "models": [{ "id": "sd-3-large", "alias": "sd3" }]
      }
    }
  }
}

apiKey, baseUrl, and header values support $VAR, ${VAR}, and ${VAR:-fallback} interpolation.

Skill CLI

The bundled Skill sends one JSON object to skills/pi-image-gen/scripts/image-gen.mjs:

{
  "prompt": "A watercolor lighthouse in a winter storm",
  "image": ["/optional/reference.png"],
  "n": 1,
  "size": "1024x1024",
  "filename": "winter-lighthouse"
}

prompt is required. image, n (1–8), size, filename, and outputDir are optional. Image inputs may be local paths or HTTP(S) URLs. The CLI never prints configured credentials.

[!IMPORTANT] Project settings participate only when the running Pi session trusts that exact working directory. This prevents an untrusted repository from changing the endpoint while inheriting a global or environment credential during normal Skill use.

Development

This package builds dist because the extension and Skill CLI share one production core:

npm --workspace @bytetrue/pi-image-gen test
npm --workspace @bytetrue/pi-image-gen run typecheck
node packages/pi-image-gen/scripts/pack-smoke.mjs