@gamecrate/cli

中文文档
3.13.1发布于 2026/11/13MITTypeScriptES Module构建来源已验证近 30 天下载 3920

Run a modded game in a container, with mods resolved from your local checkouts.

原始使用文档
文档目录5 节
  1. Before you start
  2. Set up your first profile
  3. Where a mod id comes from
  4. Launch it
  5. Where to go next

@gamecrate/cli

npm npm downloads MIT license Discord

Run a modded game in a Docker container. Describe your profiles, then launch it by name. Each profile gets its own settings, logs, and mod lists. Once a profile is set up, that is the whole command:

gamecrate run <profile>

Before you start

Right now, this only works on Linux. It may work in WSL, but it hasn't been tested. You'll also need Docker running, and a copy of the game.

gamecrate doctor checks all three and reports every problem together.

Set up your first profile

npm install -g @gamecrate/cli
gamecrate init

init installs the plugin for the game you want to use, and writes ~/.config/gamecrate/config.yml. It also offers to create a local .gamecrate.yml too, for a directory that holds a mod you are working on.

The global file holds the general configuration and defaults, and a project's .gamecrate.yml gives the specific configurations and profiles you use for a particular mod.

Where the game comes from is the one choice you have to make:

The game is installed here

gamecrate read-only binds your install into the container at /game. The image supplies a few extra things around it: a virtual display, the graphics drivers, and the system libraries the engine links. Point gameFiles.host at the install directory, and the runtime image takes care of itself:

plugins: ['@gamecrate/rimworld']
games:
  rimworld:
    gameFiles:
      host: ~/.steam/steam/steamapps/common/RimWorld
    profiles:
      dev:
        mods: [concordlib.concord, yourname.yourmod] # more info on this coming later

With no image block (the runtime), gamecrate pulls ghcr.io/rimworks/gamecrate/runtime-base:1. That is about 160 MB, so this path needs no multi-gigabyte download and no registry of your own. Steam keeps the game itself up to date. You are welcome to create your own runtime image if you need to add more to it, or just want your own.

OR
The game is not installed here, or you want isolated installs

You can also build an image containing the entire game, based on the gamecrate runtime image. Run the commands below and gamecrate builds one for you:

gamecrate steam login
gamecrate steam build --game rimworld

The game lives inside that image, so drop gameFiles.host and set source: image instead:

plugins: ['@gamecrate/rimworld']
games:
  rimworld:
    gameFiles:
      source: image
    image:
      ref: rimworld:1.6
      acquire: pull
    profiles:
      dev:
        mods: [concordlib.concord, yourname.yourmod] # more info on this coming later

It tags the image with the game's own version, and with :latest

run pulls only when the image is missing, so a locally loaded image is left alone. gamecrate run dev --image <ref> does the same thing for one run without touching the config.

Configuration covers every key, and Game images covers the build.

Where a mod id comes from

A name like concordlib.concord is the mod's own package id, read out of its manifest. gamecrate builds an index of every mod it can see, then matches each name in mods against it. It looks in four places:

SourceHolds
The Data directory in your installThe core game and its official DLC
workshopRootEverything Steam downloaded for you
scanRootsDirectories of your own, like a folder of checkouts
The download directoryAnything gamecrate mods add pulled down for you

The config here names none of the last three, so only the core game resolves. Add the ones you have:

    workshopRoot: ~/.steam/steam/steamapps/workshop/content/294100
    scanRoots:
      - path: ~/projects/mods
        maxDepth: 2

gamecrate mods <profile> lists what a profile resolves to and names anything it cannot find. To pin a mod gamecrate downloads itself, by workshop id or git URL, run gamecrate mods add. Mod sources covers every way to name one, and which copy wins when two match.

Launch it

gamecrate doctor              # every reason a launch could fail, reported together
gamecrate run dev --print-plan  # every path, mod and bind, without starting anything
gamecrate run dev

You can also run it detached, and have commands to manage the container after it is detached:

gamecrate run dev --detach
gamecrate ps                  # what is running, and how long it has been up
gamecrate logs dev -f         # follow this run's log
gamecrate stop dev            # free the profile

To point one mod at a working checkout and compile it first:

gamecrate run dev --use yourname.yourmod=~/projects/yourmod --build

You can use the gamecrate help command to find more info on the command-line tool itself. It also takes subcommands as arguments.

Where to go next

Read thisWhen you want to
ConfigurationWrite the config file, load a plugin, define profiles, or set per-repository defaults
Mod sourcesPin a mod to a directory, a git repository, or a workshop item gamecrate downloads, and learn which copy wins
RunningLaunch, run in the background, read the result, close a window, and clean up
Game imagesBuild a launchable image from a game you own on Steam
ReferenceEvery subcommand, flag, environment variable, and exit code
Writing a pluginTeach gamecrate a new game

@gamecrate/rimworld is the RimWorld plugin, and the one complete example of the plugin contract.

版本与发布记录

@gamecrate/cli 共发布 51 个版本,首次发布于 2026/09/17;过去 12 个月发布了 51 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.13.1latest2026/11/133 天前
3.13.02026/11/124 天前
3.12.02026/11/0610 天前
3.11.12026/11/0213 天前
3.11.02026/11/0114 天前
3.10.02026/11/0115 天前

关于 @gamecrate/cli 的常见问题

@gamecrate/cli 是什么?

Run a modded game in a container, with mods resolved from your local checkouts.

如何安装 @gamecrate/cli?

在项目目录运行 npm install @gamecrate/cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 gamecrate,可以用 npx gamecrate 直接运行。

@gamecrate/cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gamecrate/cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@gamecrate/cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@gamecrate/cli 可以商用吗?

@gamecrate/cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@gamecrate/cli 的下载量有多少?

根据 npm 官方下载统计,@gamecrate/cli 在 2026/10/16 – 2026/11/14 这 30 天内被下载 3,920 次,日均约 131 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gamecrate/cli 还在维护吗?

最新版本 3.13.1 发布于 2026/11/13(3 天前);至今共发布 51 个版本,其中过去 12 个月发布了 51 个;首次发布于 2026/09/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。