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

@rongyan/image-gen-cli

v1.1.0

Published

适配多个模型厂商的图片生成命令行工具

Readme

@rongyan/image-gen-cli

适配多个模型厂商的图片生成命令行工具,支持 npx 一键运行,也支持全局安装。

支持的服务商

| 服务商 | 模型 | 状态 | |--------|------|------| | MiniMax | image-01 | ✅ 已支持 |

安装

方式一:npx 一键运行(无需安装)

npx @rongyan/image-gen-cli@latest "a beautiful sunset"

方式二:全局安装

npm install -g @rongyan/image-gen-cli@latest

安装后使用 image-gen 命令:

image-gen "a beautiful sunset"

配置

首次运行时,工具会自动检测配置文件,若未配置则提示你交互式输入 API Key:

⚠ 未找到 minimax 的 API Key 配置

配置 minimax API Key
配置将保存到: ~/.@rongyan/image-gen-env.json

? MiniMax API Key: **********************

✓ minimax 配置已保存

配置保存在 ~/.@rongyan/image-gen-env.json

{
  "minimax": {
    "apiKey": "your-api-key-here"
  }
}

手动配置 / 更新 API Key

image-gen config

# 指定服务商
image-gen config --provider minimax

MiniMax API Key 获取地址:https://platform.minimaxi.com

使用

基本用法

image-gen "a cat sitting on a windowsill, watercolor style"

生成的图片默认保存到当前目录,文件名格式为 image-gen-2026-03-28T12-00-00.jpg

指定输出目录

image-gen "a beautiful sunset" --output ./images

指定输出文件路径

image-gen "a beautiful sunset" --output ./images/sunset.jpg

指定宽高比

image-gen "a wide landscape" --aspect-ratio 16:9

支持的宽高比:1:116:99:164:33:43:22:3

指定模型

image-gen "a portrait" --model image-01

完整参数说明

Usage: image-gen [options] [command] [prompt]

Arguments:
  prompt                      图片描述文字

Options:
  -V, --version               版本号
  -p, --provider <provider>   图片生成服务商 (default: "minimax")
  -o, --output <path>         输出路径(目录或完整文件路径)
  -r, --aspect-ratio <ratio>  宽高比 (default: "1:1")
  -m, --model <model>         模型名称
  -h, --help                  显示帮助

Commands:
  config [options]            配置 API Key

示例

# 生成头像(1:1)
image-gen "a professional headshot of a young engineer"

# 生成壁纸(16:9)
image-gen "futuristic city at night, cyberpunk style" -r 16:9 -o ./wallpapers

# 生成手机壁纸(9:16)
image-gen "cherry blossom forest, anime style" -r 9:16 -o ~/Pictures/phone-wallpaper.jpg

# 使用 npx 生成并保存到指定目录
npx @rongyan/image-gen-cli "a cozy coffee shop" -o ./output

系统要求

  • Node.js >= 18.0.0