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

@taobao-minigame/cli

v0.0.2

Published

淘宝开放 CI、CD命令行工具

Readme

@taobao-minigame/cli

淘宝开放平台 CI/CD 命令行工具,支持小程序、小游戏、小部件等应用的预览与上传发布。安装后提供 tbgame 命令。

安装

npm install -g @taobao-minigame/cli

安装完成后验证:

tbgame -v
tbgame -h

快速开始

# 1. 设置调用凭证 Token(在开放平台后台「小游戏开发 → 开发设置」获取)
tbgame config set token <token>

# 2. 在项目根目录生成预览二维码
tbgame preview --appId <appId> --type minigame

# 3. 上传发布版本
tbgame upload --appId <appId> --type minigame --version 1.0.0

推荐使用 Token 认证:在开放平台后台「小游戏开发 → 开发设置」创建/查看 CLI Token,再通过 tbgame config set token <token> 写入本地。 tbgame login(Chrome 扫码登录)仍可用,但后续会下线,请尽快迁移到 Token 方式。

命令

tbgame preview

生成预览链接/二维码。

tbgame preview [options]

| 参数 | 说明 | 默认值 | | --- | --- | --- | | -i, --input <input> | 应用根目录(mini.project.jsonapp.json/package.json 所在目录) | 当前目录 | | -a, --appId <appId> | 指定应用 appId | - | | -t, --type <open_type> | 应用类型,见下方应用类型 | - | | -d, --debug | 开启真机调试 | false | | -c, --cloud | 开启云构建 | false | | --copy | 复制预览码到剪贴板 | false | | --renderMode <mode> | 小游戏渲染模式:highPerformance | normal | highPerformance | | --noBuild | 跳过云构建,使用本地缓存的上一次构建结果生成二维码(无缓存时报错,与 --cloud 互斥) | false | | --autoOpenDevtools | 真机调试拿到 DevTools 地址后自动用本地 Chrome 打开(路径取 PUPPETEER_PATH 配置,无则用系统默认 Chrome) | false |

示例:

# 最少参数:在项目根目录执行
tbgame preview --appId 1234567 --type minigame

# 最全参数:显式目录 + 真机调试 + 云构建 + 复制二维码 + 渲染模式 + 自动打开 DevTools
tbgame preview --input /path/to/project --appId 1234567 --type minigame --debug --cloud --copy --renderMode highPerformance --autoOpenDevtools

# --noBuild 与 --cloud 互斥:跳过构建,复用上次缓存生成二维码
tbgame preview --appId 1234567 --type minigame --noBuild

tbgame upload

上传发布应用。

tbgame upload [options]

| 参数 | 说明 | 默认值 | | --- | --- | --- | | -i, --input <input> | 应用根目录 | 当前目录 | | -a, --appId <appId> | 指定应用 appId | - | | -t, --type <open_type> | 应用类型,见下方应用类型 | - | | -v, --version <version> | 指定上传的应用版本号,不传时基于线上最新版本自动递增 | - | | --renderMode <mode> | (小游戏)渲染模式:highPerformance | normal | highPerformance |

示例:

# 最少参数:项目根目录执行,不传 --version 时基于线上最新版本自动递增
tbgame upload --appId 1234567 --type minigame

# 最全参数:显式指定项目目录、版本号、渲染模式
tbgame upload --input /path/to/project --appId 1234567 --type minigame --version 1.0.0 --renderMode highPerformance

tbgame app

获取开放平台应用的基础信息(应用名称、最新线上版本)。

tbgame app [options]

| 参数 | 说明 | 默认值 | | --- | --- | --- | | -a, --appId <appId> | 指定应用 appId | - |

示例:

# 本命令仅一个参数,最少即最全
tbgame app --appId 1234567

tbgame config

管理工具本地配置。

tbgame config set <key> <value>
tbgame config get <key>
tbgame config show

| 子命令 | 说明 | | --- | --- | | config set <key> <value> | 设置配置项 | | config get <key> | 读取配置项 | | config show | 查看全部配置 |

常用配置项:

| key | 说明 | 可选值 | | --- | --- | --- | | env | 服务环境 | prod(默认) / pre / daily | | PUPPETEER_PATH | 本地 Chrome 可执行文件路径,login--autoOpenDevtools 使用 | 绝对路径 | | token | 调用凭证,从开放平台后台「小游戏开发 → 开发设置」获取(推荐认证方式);login 也会写入此项 | - |

示例:

# 最少参数:查看全部配置
tbgame config show

# 读取单个配置项
tbgame config get env

# 最全参数:设置配置项
tbgame config set env daily
tbgame config set PUPPETEER_PATH /path/to/chrome

tbgame login

⚠️ 即将下线:请优先使用 Token 认证(tbgame config set token <token>),login 后续版本会移除。

获取淘宝登录态。会通过本地 Chrome 打开登录页,登录成功后凭证保存在本地,供后续命令使用。

tbgame login

| 参数 | 说明 | 默认值 | | --- | --- | --- | | 无 | 本命令不接受命令行选项 | - |

登录依赖本地 Chrome。若无法自动定位,先用 tbgame config set PUPPETEER_PATH <路径> 指定。

示例:

# 最少参数:本命令无参数,直接执行
tbgame login

# 最全参数:先设置本地 Chrome 路径,再登录
tbgame config set PUPPETEER_PATH /path/to/chrome
tbgame login

应用类型

--type 参数取值(后续将专注于小游戏 minigame,其余类型逐步不再支持):

| 应用类型 | type 取值 | 支持状态 | | --- | --- | --- | | 小游戏 | minigame | ✅ 主力支持 | | 小程序 | miniapp | ⚠️ 后续不再支持 | | 小部件 | widget | ⚠️ 后续不再支持 | | 标准化应用 | standardizedApp | ⚠️ 后续不再支持 | | 商家后台应用 | isvCMS | ⚠️ 后续不再支持 | | 配置应用 | webapp | ⚠️ 后续不再支持 |

常见问题

  • 提示"当前路径没有绑定 appId":通过 --appId 显式指定。
  • 命令执行报错想看详细日志:在命令上追加 --showProcess 查看完整执行过程日志。
  • 登录失败或无法拉起浏览器:先通过 tbgame config set PUPPETEER_PATH <chrome路径> 指定本地 Chrome。