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

@karelx/ti-pic-cli

v0.0.12

Published

Ti-Pic-Cli — AI 生图终端工具,一行命令出图

Readme

@karelx/ti-pic-cli

AI 生图终端工具 · 一行命令出图

npm install -g @karelx/ti-pic-cli
tpc gen "一只橘猫在阳光下打盹"

✨ 特性

  • 一行命令出图 — 输入提示词,自动生成并下载到本地
  • 多模型可选 — 支持 GPT Image、Nano Banana 等多个 AI 模型
  • 零配置 — 首次运行自动注册设备,赠送免费次数,即装即用
  • 卡密充值 — 免费次数用完后,用卡密激活获取更多次数
  • 本地历史 — 生图记录自动保存,随时回查

📦 安装

# 全局安装(推荐)
npm install -g @karelx/ti-pic-cli

# 或免安装直接用
npx @karelx/ti-pic-cli gen "提示词"

系统要求:Node.js >= 20

🎯 快速开始

# 1. 自检环境(可选)
tpc doctor

# 2. 直接出图(首次运行自动注册 + 赠送免费次数)
tpc gen "一只橘猫在阳光下打盹"

# 3. 指定模型和比例
tpc gen "赛博朋克街景" -m nano-banana-fast -r 16:9

# 4. 查看可用模型
tpc models

📖 命令总览

生图

tpc gen <prompt>                       # 生成图片
  -m, --model <name>                   # 模型(默认 gpt-image-2)
  -r, --ratio <a:b>                    # 比例(1:1 / 3:4 / 4:3 / 16:9 / 9:16)
  -s, --size <size>                    # 图像尺寸(Nano 系:1K / 2K / 4K)
  -n, --count <num>                    # 批量张数(最多 4)
  -o, --out <dir>                      # 输出目录(默认 ./output)
  --seed <n>                           # 随机种子
  --no-download                        # 只返回 URL,不下载到本地

查询

tpc models                             # 列出可用模型
tpc credits                            # 查询剩余次数
tpc history list [-n 20]               # 最近 N 条生图记录
tpc history show <id>                  # 单条详情
tpc history clear --yes                # 清空历史
tpc doctor                             # 环境自检

充值

tpc activate TPC-XXXX-YYYY-ZZZZ       # 激活卡密,获取更多次数

配置

tpc config get [key]                   # 查看配置
tpc config set <key> <value>           # 修改配置
tpc config reset [key]                 # 恢复默认
tpc config path                        # 配置文件路径

可配置项:

| 配置项 | 默认值 | 说明 | |--------|--------|------| | tpcServerUrl | https://tpc.aigcmax.club | 服务端地址 | | defaultModel | gpt-image-2 | 默认模型 | | defaultRatio | 1:1 | 默认比例 | | defaultImageSize | 1K | 默认尺寸(Nano 系) | | outDir | ./output | 默认输出目录 |

全局选项

--data-dir <path>    指定数据目录(或环境变量 TPC_DATA_DIR)
--no-banner          关闭启动 logo
--no-color           关闭终端色彩
-v, --verbose        详细日志
--json               JSON 输出(脚本友好)

🗂️ 数据目录

默认走 OS 标准目录:

| 平台 | 默认路径 | |------|---------| | Windows | %APPDATA%\ti-pic-cli-nodejs\Config\ | | macOS | ~/Library/Preferences/ti-pic-cli-nodejs/ | | Linux | ~/.config/ti-pic-cli-nodejs/ |

自定义位置(优先级:CLI 参数 > 环境变量 > 默认):

# CLI 参数(一次性)
tpc --data-dir ./my-data gen "test"

# 环境变量(长期生效)
$env:TPC_DATA_DIR = "D:\tpc-data"    # PowerShell
export TPC_DATA_DIR=/opt/tpc-data     # bash

运行 tpc doctor 可查看当前数据目录路径。

📜 License

MIT © Ti