@idlekit/cli

中文文档
0.7.0发布于 2026/11/01MITES Module构建来源已验证

Bun-first idk CLI for idle game scenario validation, simulation, tuning, and reporting.

原始使用文档
文档目录3 节
  1. Large monetary values
  2. Runtime
  3. Documentation

@idlekit/cli

idk is the command-line interface for idle game design evaluation. Use it to validate scenarios, run simulations, inspect pacing, compare variants, and tune strategies. Official support in v1: Bun >=1.4.2 only. Node.js and browser runtimes are not part of the v1 compatibility contract.

This registry install requires a published package. If it returns 404, use the repository local-pack workflow, including its overrides for unpublished internal dependencies, in a separate consumer project.

bun add -g @idlekit/cli

Requires Bun >=1.4.2.

Typical flow:

idk init scenario --track personal --preset builder --out ./my-game-v1.json --name "Space Miner"
idk validate ./space-miner-v1.json
idk simulate ./space-miner-v1.json --format json
idk experience ./space-miner-v1.json --format json
idk evaluate ./space-miner-v1.json --format md

Interactive scaffold and review:

idk init scenario --wizard true --track personal --preset builder --out ./my-game-v1.json
idk review doctor
idk review evaluate ./space-miner-v1.json
idk review compare ./space-miner-v1.json ./space-miner-v1-compare-b.json
idk tune ./space-miner-v1.json --wizard true
idk experiment ./experiment-spec.json

Shell completion and health check:

source <(idk completions zsh)
idk doctor --format md
idk doctor --fix true --shell zsh
idk review doctor
idk setup plugin-trust --plugin ./custom-econ-plugin.ts --out ./.idk/plugin-trust.json

Worked real-game example in this repository:

bun run --cwd packages/cli dev -- experience ../../examples/tutorials/14-orbital-foundry-v1.json \
  --plugin ../../examples/plugins/custom-econ-plugin.ts \
  --allow-plugin true \
  --session-pattern twice-daily \
  --days 7 \
  --format json

Large monetary values

compare, tune and balance support --engine breakInfinity, alongside the existing simulation commands. Number remains the default; scenario.engine does not choose the runtime. Use the explicit flag when scenario amounts exceed Number's range, and use engine operations in custom models and objectives.

Construct plugin amounts with the supplied ctx.E. When adapting a game that uses its own Decimal library, convert amounts through decimal text with ctx.E.from(text) at the boundary, including costs, rewards and returned state. Separate game SDK and CLI bundles can contain different Decimal constructors.

idk compare ./a.json ./b.json --engine breakInfinity --metric endNetWorth
idk tune ./a.json --tune ./tune.json --engine breakInfinity
idk balance ./workflow.json --engine breakInfinity --format md

Compare preserves monetary text, while tuning objectives such as endNetWorthLog10 produce finite logarithmic scores. Replay artifacts retain the selected engine. Balance supports decimal-string currency targets and results; CSV parameter edits, time/count metrics and sensitivity knobs remain finite Numbers. See the balance guide for target syntax and engine-specific freshness checks. breakEternity remains experimental.

Runtime

@idlekit/cli is maintained as a Bun-first CLI package.

  • automation path: evaluate, compare --format json, experience --format md|json
  • human review path: review evaluate, review compare, review doctor
  • guided setup path: init scenario --wizard, tune --wizard, doctor --fix, setup completions
  • recommended human sequence: init scenario --wizard -> review doctor -> review evaluate -> review compare -> tune --wizard

Documentation

版本与发布记录

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

版本发布日期距今
0.7.0latest2026/11/012 天前
0.6.02026/10/1816 天前
0.5.12026/10/1717 天前
0.5.02026/10/1618 天前
0.4.02026/10/1519 天前
0.3.12026/10/1321 天前

关于 @idlekit/cli 的常见问题

@idlekit/cli 是什么?

用于空闲游戏场景验证、模拟、调优和报告的idk CLI。

如何安装 @idlekit/cli?

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

@idlekit/cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/idlekit__cli 是否存在。

@idlekit/cli 支持 ESM 还是 CommonJS?

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

@idlekit/cli 可以商用吗?

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

@idlekit/cli 还在维护吗?

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