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

@cp7553479/image-cli

v0.1.1

Published

Unified image generation CLI with provider plugins and shared configuration.

Downloads

191

Readme

Image-Cli: An agent-native image tool

中文说明 / README_CN

image is a local multi-provider image generation CLI.

It standardizes:

  • command surface
  • config layout
  • provider routing
  • output saving
  • provider-specific escape hatches through --extra

Built-in providers:

  • OpenAI
  • OpenRouter
  • Gemini
  • Seedream
  • Qwen
  • MiniMax

It also supports custom providers installed under ~/.image/plugins/.

Install

npm install -g @cp7553479/image-cli

Verify installation:

image --help
image generate --help
image config --help

Quick Start

  1. Initialize local config:
image config init
  1. Open ~/.image/config.json.

  2. Set the top-level defaultModel in provider/modelid form.

  3. Fill each provider's api_key.

  4. Verify configuration:

image config doctor --json
  1. Generate:
image generate "A cinematic fox poster in snowfall"

If --model is omitted, the CLI uses config.defaultModel.

Command Reference

image

Root command.

It exposes:

  • image generate <prompt>
  • image config init
  • image config path
  • image config show
  • image config doctor
  • image config providers

The root help is intentionally concise. Use image generate --help and image config --help for full command details.

image generate

Usage:

image generate "<prompt>" [flags]

Arguments:

  • <prompt> Required. The generation prompt text.

Flags:

  • --model <provider/model> Optional if config.defaultModel is set. Explicitly chooses the provider and the provider-native model id.

  • --size <preset|WIDTHxHEIGHT> Optional. Normalized size input. Supported presets:

    • 2k
    • 4k Explicit dimensions example:
    • 1536x1024
  • --aspect <ratio> Optional. Normalized aspect ratio. Supported values:

    • 1:1
    • 4:3
    • 3:4
    • 16:9
    • 9:16
    • 3:2
    • 2:3
    • 21:9
  • --n <count> Optional. Requested output count. Provider support differs; some providers clamp or ignore it.

  • --image <pathOrUrl> Optional and repeatable. Reference image input. Can be:

    • a local file path
    • an HTTP/HTTPS URL
  • --quality <value> Optional. Provider-native quality hint. Not normalized across all providers.

  • --format <png|jpeg|webp> Optional. Preferred output format when the provider supports it.

  • --background <auto|opaque|transparent> Optional. Provider-native background mode. Most relevant for OpenAI-style image APIs.

  • --seed <integer> Optional. Deterministic seed when the provider supports it.

  • --stream Optional. Enables provider streaming when supported.

  • --output-dir <path> Optional. Directory where generated files and manifest.json are written. Default:

    ./image-output/<timestamp>/
  • --json Optional. Prints the output manifest as JSON instead of plain text.

  • --extra <json> Optional. Provider-specific JSON object for features that are not normalized by the CLI.

--extra

Use --extra for provider-only parameters.

Examples:

--extra '{"watermark":false}'
--extra '{"response_format":"base64"}'
--extra '{"prompt_optimizer":true}'

Rules:

  • must be a JSON object
  • cannot override normalized fields such as prompt, model, size, images, or seed
  • should be used for provider-only features that do not exist consistently across providers

Is negative_prompt a universal CLI flag?

No.

It is not exposed as a top-level normalized flag because official provider support is not consistent.

Provider status from official docs:

If you need negative_prompt for a provider that officially supports it, pass it through --extra.

Example for Qwen:

image generate "A clean drink poster" \
  --model qwen/qwen-image-2.0-pro \
  --extra '{"negative_prompt":"low quality, blurry, distorted text"}'

image config init

Copies the initialization templates into ~/.image/ and the supported skill directories.

Behavior:

  • creates config.json if missing
  • creates config.example.jsonc if missing
  • creates README.md if missing
  • creates missing bundled image-cli skill files under ~/.image/skills/image-cli/
  • creates missing bundled image-cli skill files under ~/.claude/skills/image-cli/
  • creates missing bundled image-cli skill files under ~/.agents/skills/image-cli/
  • creates missing bundled image-cli skill files under ~/.codex/skills/image-cli/
  • creates missing bundled image-cli skill files under ~/antigravity/skills/image-cli/
  • if ~/.image/ already exists, it checks each managed file and only fills the missing ones
  • --force overwrites all managed config and skill files

Flags:

  • --force Overwrite all managed config and skill files.

image config path

Prints the config and skill paths used by the CLI.

No flags.

image config show

Prints sanitized resolved config.

Flags:

  • --json Print JSON output.

What it shows:

  • top-level defaultModel
  • per-provider enablement
  • base URLs
  • timeout and retry settings
  • whether api_key is present

What it does not show:

  • raw secrets

image config doctor

Runs diagnostics.

Flags:

  • --json Print JSON output.

Checks include:

  • config file existence
  • README existence
  • curl availability
  • per-provider credential counts

image config providers

Lists built-in providers and installed plugin providers.

Flags:

  • --json Print JSON output.

Configuration Layout

The CLI uses:

  • ~/.image/config.json
  • ~/.image/config.example.jsonc
  • ~/.image/README.md
  • ~/.image/skills/image-cli/SKILL.md
  • ~/.image/skills/image-cli/README.md
  • ~/.claude/skills/image-cli/SKILL.md
  • ~/.claude/skills/image-cli/README.md
  • ~/.agents/skills/image-cli/SKILL.md
  • ~/.agents/skills/image-cli/README.md
  • ~/.codex/skills/image-cli/SKILL.md
  • ~/.codex/skills/image-cli/README.md
  • ~/antigravity/skills/image-cli/SKILL.md
  • ~/antigravity/skills/image-cli/README.md
  • ~/.image/plugins/<plugin-name>/plugin.json

config.json

Top-level structure:

{
  "version": 1,
  "defaultModel": "openai/gpt-image-1.5",
  "providers": {
    "openai": {
      "enabled": true,
      "apiBaseUrl": "https://api.openai.com/v1",
      "timeoutMs": 120000,
      "retryPolicy": {
        "maxAttempts": 2
      },
      "api_key": ["YOUR_OPENAI_API_KEY"]
    }
  }
}

Top-level fields

  • version Config schema version.

  • defaultModel Default routing target in provider/modelid format. This is what the CLI uses when --model is omitted.

  • providers Provider config map keyed by provider id. This includes both built-in providers and plugin providers.

Per-provider fields

  • enabled
  • apiBaseUrl
  • timeoutMs
  • retryPolicy.maxAttempts
  • api_key

api_key

Supported formats:

Single key:

"api_key": "your-api-key"

Ordered failover keys:

"api_key": ["your-api-key-1", "your-api-key-2"]

If an array is provided, the CLI tries the keys in order for same-provider failover.

Built-in Provider Defaults

Template defaults:

  • defaultModel: openai/gpt-image-1.5
  • openai: https://api.openai.com/v1
  • openrouter: https://openrouter.ai/api/v1
  • gemini: https://generativelanguage.googleapis.com/v1beta
  • seedream: https://ark.cn-beijing.volces.com/api/v3
  • qwen: https://dashscope.aliyuncs.com/api/v1
  • minimax: https://api.minimax.io/v1

Seedream note:

  • depending on your Ark account/model availability, you may need a versioned model id such as doubao-seedream-4-5-251128

Provider IDs, Docs, and API Key Links

OpenAI

OpenRouter

Gemini

Seedream

Qwen

MiniMax

Custom Provider Plugins

You only need this section if you want image to call a provider that is not built in.

For normal use of built-in providers, skip this section.

Why does this feature exist?

The CLI keeps one stable user-facing command surface:

  • image generate "<prompt>"
  • --model provider/modelid
  • --size
  • --aspect
  • --image
  • --extra

But every provider has different implementation details:

  • auth header format
  • request body format
  • sync vs async flow
  • where image results are returned

The built-in providers solve this internally.

The custom plugin system exists so you can add the same kind of adapter for a provider that is not shipped with the CLI, without changing the CLI itself.

How should a beginner think about it?

Do not think of a plugin as "extending the whole CLI".

Think of it as only adding one translator layer:

  • the CLI already knows how to parse commands, load config, rotate keys, and save output
  • the plugin only teaches the CLI how to talk to one extra provider

In practice, that means:

  1. you still run the normal image generate ... command
  2. the provider id still appears in config.json and --model
  3. the plugin only converts between the CLI's normalized request and the provider's real API

Where does a plugin live?

Custom providers are installed under:

~/.image/plugins/<plugin-name>/

Each plugin must contain a registration file:

~/.image/plugins/<plugin-name>/plugin.json

How is a plugin routed?

Once a plugin registers a providerId, the CLI routes it exactly like a built-in provider.

The same provider id appears in:

  • in config.defaultModel
  • in image generate --model <provider/model>
  • in config.providers.<providerId>

What is the minimum mental model?

For a newcomer, this is the shortest accurate explanation:

  • plugin.json says which provider id the plugin owns
  • the plugin script builds the real HTTP request for that provider
  • the plugin script parses the provider response back into the CLI's common result format

If you understand those three lines, you understand the plugin system.

Where is the full developer guide?

For the full explanation, including:

  • the beginner-friendly architecture walkthrough

  • what plugin.json does

  • what build-generate and parse-generate do

  • what JSON comes in and out

  • common beginner mistakes and questions

  • plugins/PLUGINS_README.md

Development

npm install
npm run check
npm test
npm run build