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

@zhoujinandrew/gpt-image-cli

v1.1.0

Published

CLI for OpenAI gpt-image-2 generation and editing, with a companion Claude Code SKILL

Readme

gpt-image-cli

CLI for OpenAI gpt-image-2 — text-to-image and image editing — with an accompanying SKILL for Claude Code / AI agents.

Install

# CLI (global):
npm install -g @zhoujinandrew/gpt-image-cli

# Companion SKILL for Claude Code:
npx skills add zjandrew/gpt-image-cli -g -y

Local development:

git clone https://github.com/zjandrew/gpt-image-cli.git
cd gpt-image-cli
npm install
npm run build
npm link

Configure

# Interactive wizard (creates ~/.gpt-image-cli/config.json, chmod 600):
gpt-image-cli config init

# Or env vars:
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1   # optional

# Or programmatic:
gpt-image-cli config set api_key sk-...
gpt-image-cli config set endpoint https://proxy.example.com/v1

Priority: CLI flag > env var > config file > default.

Multiple endpoints / profiles

gpt-image-cli supports multiple named profiles — public OpenAI, OpenAI-compatible proxies, and Azure OpenAI deployments side-by-side.

# List all saved profiles
gpt-image-cli config list

# Add a new Azure profile (interactive wizard)
gpt-image-cli config add azure-prod --type azure
# prompts:
#   Azure endpoint:    https://<resource>.openai.azure.com
#   Deployment name:   gpt-image-2
#   api-version:       2024-02-01
#   API key:           ********
#   auth_style:        api-key       (default; or "bearer")

# Switch active profile
gpt-image-cli config use azure-prod

# Per-invocation override without switching active
gpt-image-cli --profile azure-prod generate -p "..." --out a.png

The resulting config (~/.gpt-image-cli/config.json, chmod 600):

{
  "version": 2,
  "active": "azure-prod",
  "profiles": {
    "default": {
      "type": "openai",
      "api_key": "sk-...",
      "endpoint": "https://api.openai.com/v1"
    },
    "azure-prod": {
      "type": "azure",
      "endpoint": "https://<resource>.openai.azure.com",
      "api_key": "...",
      "api_version": "2024-02-01",
      "deployment": "gpt-image-2",
      "auth_style": "bearer"
    }
  }
}

Legacy single-endpoint configs are auto-migrated to a default profile on first read.

Profile selection precedence: --profile <name> flag > GPT_IMAGE_PROFILE env > config file's active. --endpoint / --api-key flags override the resolved profile's fields without changing its type.

Notes on Azure profiles:

  • output_format=webp is rejected — Azure only supports png and jpeg.
  • auth_style: "bearer" sends Authorization: Bearer <key> (matches the format some Azure gateways accept). Default api-key sends api-key: <key> per Microsoft's standard.
  • endpoint is the bare resource URL (https://<resource>.openai.azure.com) — do not include /openai/deployments/...; the SDK appends that.

Usage

Generate

gpt-image-cli generate -p "a tabby cat wearing a red scarf" -s 1024x1024 -q high --out cat.png

Edit

gpt-image-cli edit --image cat.png -p "add a top hat" --out hatted.png
gpt-image-cli edit --image a.png --image b.png -p "combine them" --out combined.png
gpt-image-cli edit --image scene.png --mask mask.png -p "replace the sky" --out new.png

Pipe base64

gpt-image-cli generate -p "..." --stdout-base64 2>/dev/null | base64 -d > out.png

Dry-run

gpt-image-cli generate -p "..." --dry-run

SKILL

The skill lives at skills/gpt-image/SKILL.md. Install to your Claude Code skills:

npx skills add zjandrew/gpt-image-cli -g -y

Exit codes

| Code | Meaning | |---|---| | 0 | success | | 2 | INVALID_INPUT / CONFIG_MISSING | | 3 | IO_ERROR | | 4 | OPENAI_API_ERROR | | 5 | NETWORK_ERROR | | 10 | INTERNAL |

License

MIT