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

@image-gen/cli

v1.0.1

Published

CLI tool for generating images

Readme

Image Gen CLI

图片生成 CLI 工具,通过 API 接口生成图片并管理任务。

安装

npm i @image-gen/cli -g

命令

设置 API Key

image-gen set-key <your-api-key>

查看状态

image-gen status

显示当前 API Key 配置和用户权益信息。

生成图片

image-gen generate <prompt> <image_gen_type> [-s <size>]

参数:

  • <prompt> - 图片描述文本
  • <image_gen_type> - 文生图类型
    • 1 - 质量高,构图能力强,ai味低
    • 2 - 风格适配比较好,比如动漫、水墨风格

选项:

  • -s, --img-size <size> - 图片尺寸比例,默认 1:1
    • 可选值:1:1 | 16:9 | 9:16 | 4:3 | 3:4 | 3:2 | 2:3

示例:

image-gen generate "一只可爱的猫咪在草地上玩耍" 1
image-gen generate "未来城市" 1 -s 16:9
image-gen generate "水墨山水画" 2 --img-size 9:16

获取任务状态

image-gen get-task <taskId>

根据任务 ID 查询图片生成任务的状态和结果。

上传图片

image-gen upload <filePath>

上传本地图片文件,返回文件名、文件大小、URL 和路径信息。

示例:

image-gen upload ./my-image.png

移除图片背景

image-gen removebg <imageUrl>

传入线上图片地址,调用去背景接口,返回任务 ID,可通过 get-task 查询结果。

示例:

image-gen removebg "https://example.com/my-photo.png"

以图生图

image-gen image-edit <description> <imageUrls...>

传入编辑描述和一张或多张线上图片地址(最多 3 张),返回任务 ID,可通过 get-task 查询结果。

参数:

  • <description> - 图片编辑描述
  • <imageUrls...> - 线上图片地址(支持多张,空格分隔,最多 3 张)

示例:

image-gen image-edit "让他大笑起来" "https://example.com/photo.png"
image-gen image-edit "合并这两张图" "https://example.com/a.png" "https://example.com/b.png"

全局配置

全局配置文件存储位置:

  • Windows: %APPDATA%\image-gen\config.json
  • macOS/Linux: ~/.config/image-gen/config.json