# @quick-game/cli

> Command line interface for rapid qg development

Latest version **1.9.0** (published 2026-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @quick-game/cli
pnpm add @quick-game/cli
yarn add @quick-game/cli
bun add @quick-game/cli
```

Provides the command `qg`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support; large bundle.

## Facts

| | |
|---|---|
| Version | 1.9.0 |
| Published | 2026-08-04 |
| First published | 2025-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.9 |
| Dependencies | 69 |
| Unpacked size | 88.8 MB |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | yes |
| Author | lianmeng |
| Maintainers | lcs247793796, yuebai008 |
| Keywords | vivo, OPPO, mi, rongyao, minigame, quickgame, quick-game, quickgame-cli, cli |

## Links

- npm: https://www.npmjs.com/package/@quick-game/cli
- Homepage: https://www.quickapp.cn/openness/quickGame
- npm.io page: https://npm.io/package/@quick-game/cli

## Dependencies (69)

- [koa](https://npm.io/package/koa.md) ^2.7.0
- [md5](https://npm.io/package/md5.md) ^2.2.1
- [ora](https://npm.io/package/ora.md) ^3.4.0
- [http](https://npm.io/package/http.md) ^0.0.1-security
- [open](https://npm.io/package/open.md) ^7.0.0
- [pixi](https://npm.io/package/pixi.md) ^0.3.1
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [execa](https://npm.io/package/execa.md) ^2.0.4
- [jszip](https://npm.io/package/jszip.md) ^3.2.2
- [fflate](https://npm.io/package/fflate.md) ^0.7.4
- [hasbin](https://npm.io/package/hasbin.md) ^1.2.3
- [qrcode](https://npm.io/package/qrcode.md) ^1.5.4
- [semver](https://npm.io/package/semver.md) ^6.2.0
- [request](https://npm.io/package/request.md) ^2.88.2
- [webpack](https://npm.io/package/webpack.md) 5.98.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^8.1.0
- [inquirer](https://npm.io/package/inquirer.md) ^6.4.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [prettier](https://npm.io/package/prettier.md) ^2.8.8
- [qr-image](https://npm.io/package/qr-image.md) ^3.2.0
- [readline](https://npm.io/package/readline.md) ^1.3.0
- [commander](https://npm.io/package/commander.md) ^2.20.0
- [ipaddr.js](https://npm.io/package/ipaddr.js.md) ^1.9.1
- [jsrsasign](https://npm.io/package/jsrsasign.md) ^11.1.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^5.1.1
- [socket.io](https://npm.io/package/socket.io.md) ^4.8.1
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.25.9
- [didyoumean](https://npm.io/package/didyoumean.md) ^1.2.1
- [koa-router](https://npm.io/package/koa-router.md) ^7.4.0
- [koa-static](https://npm.io/package/koa-static.md) ^5.0.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.7.0
- [node-forge](https://npm.io/package/node-forge.md) ^1.3.1
- [portfinder](https://npm.io/package/portfinder.md) ^1.0.21
- [prettyjson](https://npm.io/package/prettyjson.md) ^1.2.5
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.25.9
- [@babel/node](https://npm.io/package/@babel/node.md) ^7.25.9
- [file-loader](https://npm.io/package/file-loader.md) ^6.2.0
- [internal-ip](https://npm.io/package/internal-ip.md) ^4.3.0
- [webpack-cli](https://npm.io/package/webpack-cli.md) 4.10.0
- [babel-loader](https://npm.io/package/babel-loader.md) 8.4.1
- [chrome-paths](https://npm.io/package/chrome-paths.md) ^0.1.0
- [koa-compress](https://npm.io/package/koa-compress.md) ^5.1.1
- [adb-commander](https://npm.io/package/adb-commander.md) ^0.1.9
- [child_process](https://npm.io/package/child_process.md) ^1.0.2
- [import-global](https://npm.io/package/import-global.md) ^0.1.0
- [webpack-merge](https://npm.io/package/webpack-merge.md) ^5.9.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.25.9
- [@qgame/adapter](https://npm.io/package/@qgame/adapter.md) ^1.1.11
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.2.1
- [latest-version](https://npm.io/package/latest-version.md) ^9.0.0
- [xmlhttprequest](https://npm.io/package/xmlhttprequest.md) ^1.8.0
- [abort-controller](https://npm.io/package/abort-controller.md) ^3.0.0
- [enhanced-resolve](https://npm.io/package/enhanced-resolve.md) ^5.15.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.25.9
- [adb-devices-emitter](https://npm.io/package/adb-devices-emitter.md) ^0.1.9
- [copy-webpack-plugin](https://npm.io/package/copy-webpack-plugin.md) ^13.0.0
- [terser-webpack-plugin](https://npm.io/package/terser-webpack-plugin.md) ^5.3.14
- [webpack-inject-plugin](https://npm.io/package/webpack-inject-plugin.md) ^1.5.5
- [@babel/runtime-corejs2](https://npm.io/package/@babel/runtime-corejs2.md) ^7.25.9
- [chrome-simple-launcher](https://npm.io/package/chrome-simple-launcher.md) ^0.1.4
- [acorn-import-assertions](https://npm.io/package/acorn-import-assertions.md) ^1.9.0
- [string.prototype.padstart](https://npm.io/package/string.prototype.padstart.md) ^3.0.0
- [compression-webpack-plugin](https://npm.io/package/compression-webpack-plugin.md) ^11.1.0
- [node-polyfill-webpack-plugin](https://npm.io/package/node-polyfill-webpack-plugin.md) ^2.0.1
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.25.9
- [@babel/plugin-transform-modules-commonjs](https://npm.io/package/@babel/plugin-transform-modules-commonjs.md) ^7.25.9
- [@babel/plugin-transform-optional-chaining](https://npm.io/package/@babel/plugin-transform-optional-chaining.md) ^7.25.9
- [@babel/plugin-transform-nullish-coalescing-operator](https://npm.io/package/@babel/plugin-transform-nullish-coalescing-operator.md) ^7.25.9

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.9.0 (latest) — 2026-08-04
- 1.7.5 (beta) — 2026-01-27
- 1.8.6 — 2026-04-24
- 1.6.4 — 2025-12-08
- 1.6.3 — 2025-12-08
- 1.6.2 — 2025-11-05
- 1.6.1 — 2025-11-03
- 1.6.0 — 2025-11-03
- 1.5.0 — 2025-10-16
- 1.4.7 — 2025-09-25
- 1.4.6 — 2025-09-25
- 1.4.5 — 2025-09-11
- 1.4.4 — 2025-09-11
- 1.4.3 — 2025-09-04
- 1.4.2 — 2025-08-15
- … 46 more at https://npm.io/package/@quick-game/cli/versions

## README

# `@quick-game/cli`

> 为开发者提供的联盟快游戏命令行工具

安装 [@quick-game/cli](https://www.npmjs.com/package/@quick-game/cli) 后，便可使用 `qg` 命令。安装方法如下：

```bash
npm install -g @quick-game/cli
```

## 命令行使用

### 1、创建联盟快游戏工程

```
qg init <project-name> [-t <template>] [-c <cwd dir>] [-f]
```

#### 参数

### `project-name`

要创建的联盟快游戏工程的名称。可以为 `.` ，当 `project-name` 为`.`时表示在当前目录创建联盟快游戏工程。

### `-t`

指定创建联盟快游戏工程使用的模板，默认为`default`，表示使用默认的模板。不指定该参数时就使用默认的模板。

> 目前只有`default`模板，所以该参数可以不指定，使用默认值即可

### `-c`

指定创建联盟快游戏工程的目录，不指定该参数时，使用`process.cwd()`也就是当前执行目录来创建，如果指定 了路径，就在指定路径创建。

### `-f`

如果指定的 `project-name` 目录已经存在，会提示用户是 '覆盖' 还是 '合并'，指定 -f 或者 --force 可以忽略提示，直接强制覆盖

#### 示例


```
//在当前路径创建名为abc的联盟快游戏工程
qg init abc
//在当前路径创建名为abc的联盟快游戏工程，如果已经存在 abc 则强制覆盖
qg init abc -f
//在当前路径直接创建联盟快游戏工程，假设当前路径为`/usr/name/demoGame/`，联盟快游戏工程名为demoGame
qg init .             
// 在 `/usr/name/documents/`路径创建名为abc的联盟快游戏工程
qg init abc -c /usr/name/documents/
// 在 `/usr/name/demoGame/`路径直接创建联盟快游戏工程，即联盟快游戏工程名为 demoGame
qg init . -c /usr/name/demoGame/
```

命令执行后，会在当前目录下创建文件夹，作为项目根目录，这个项目已经包含了项目配置与游戏入口的初始代码，项目根目录主要结构如下：

```
├── sign                      rpk包签名模块
│   └── debug                 调试环境
│       ├── certificate.pem   证书文件
│       └── private.pem       私钥文件
├── src
│   ├── image                 图片资源目录
│   │   └── logo.png          游戏图标
│   ├── js                    游戏业务逻辑目录
│   |   └── main.js           游戏业务逻辑代码
│   ├── game.js               游戏入口js
│   └── manifest.json         项目配置文件，配置游戏图标、包名等
└── package.json              定义项目需要的各种模块及配置信息Copy to clipboardErrorCopied
```

目录的简要说明如下：

- src：项目源文件夹

- sign：签名模块，当前仅有debug签名，**如果内测上线，请添加release文件夹，增加release签名**；**签名生成**:

  ```js
  openssl req -newkey rsa:2048 -nodes -keyout private.pem -x509 -days 3650 -out certificate.pem
  ```

### 2、构建联盟快游戏RPK包体

#### debug打包

```js
qg build
```

#### release打包

```js
qg release
```

编译打包成功后，项目根目录下会生成文件夹：build、dist：

- build：临时产出，包含编译后的页面js，图片等
- dist：最终产出，包含rpk文件。其实是将build目录下的资源打包压缩为一个文件，后缀名为rpk，这个rpk文件就是项目编译后的最终产出
- 若本地没有release签名，会自动根据本地的包名和配置生成`release签名`，建议cp提前生成好。签名需要保存的其他地方，用于后续更新打包。

### 3、启动调试服务

```js
qg server
```

- 将dist目录下的rpk包体创建http服务，使用快游戏调试器扫码可以进行下载安装rpk包体
- 游戏启动后，会自动打开chrome调试能力

---
_Source: https://npm.io/package/@quick-game/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
