Skip to content

08 · update-cli-without-cli

本场景验证什么

--without={module} 标志(及其等价的 agent prompt 形式)在 update 时真的会移除一个可选模块——包括删除该模块在磁盘上的文件, 而不仅仅是把它标记为"今后跳过"。

这是针对最常见用户诉求的回归测试:

"我上周安装 Archon 时带上了 cli 模块,但我们的 CI 镜像不能装 Node。能不能只把 CLI 卸掉,而不必把 Archon 整个卸载?"

可以。本场景就是证明。

测试环境

Fixture场景 01 的产物(已安装 cli 模块)
IDECursor
OS与场景 01 相同
Archon 来源https://aaep.site/manifest.json
受测 manifest 版本v0.1.0(不需要版本号上调)

前置条件

  1. 场景 01 ✅,且包含 cli 模块(默认)。
  2. tools/archon-cli/ 已在磁盘上存在。
  3. git status 干净。

操作步骤

text
1. In Cursor, paste exactly:
     hi archon, update yourself but without the cli module
2. Or equivalently via CLI:
     npx @archon/cli@latest update --without=cli --yes
3. The agent / CLI prints a planned-changes table that should include:
     - REMOVE  tools/archon-cli/...        (every cli file)
     - KEEP    .archon/...                  (core unchanged)
     - KEEP    .cursor/...                  (binding unchanged)
4. Confirm.
5. Verify tools/archon-cli/ no longer exists.
6. Verify .archon/manifest.md or wherever opted-in modules are
   tracked reflects "cli: not installed".

预期结果

检查项期望
tools/archon-cli/ 已被移除yes
其他模块未被触动yes
.archon/drift.md未变化
.archon/VERSION未变化
后续 archon sync(场景 09)将 cli 报告为 "not installed"——而不是 "0/N ok"yes
python3 scripts/archon-check.py --root . 退出码0
npm run validate 退出码0

Demo 录制

Will be replaced by docs/public/videos/update-cli-without-cli.mp4 once recorded. See videos/README for upload conventions.
Will be replaced by docs/public/asciinema/update-cli-without-cli.cast embedded via the asciinema-player web component. See asciinema/README for the recording command.

运行记录

下表由 sandbox runner (scripts/sandbox-run.mjs) 写入 docs/testing/sandbox/runs/update-cli-without-cli/ 的 JSON 实时渲染。要新增一行,请运行

bash
node scripts/sandbox-run.mjs --only=update-cli-without-cli
Started (UTC)ManifestRunnerResultDurationNotesRecord
2026-05-06 10:24:37 UTCv0.1.0cli❌ failing345 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-06 06:10:26 UTCv0.1.0cli❌ failing349 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-06 00:55:45 UTCv0.1.0cli❌ failing345 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-06 00:40:11 UTCv0.1.0cli❌ failing353 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 15:00:36 UTCv0.1.0cli❌ failing298 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 14:55:20 UTCv0.1.0cli❌ failing354 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 14:22:55 UTCv0.1.0cli❌ failing351 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 14:04:55 UTCv0.1.0cli❌ failing339 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 14:00:02 UTCv0.1.0cli❌ failing329 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 13:59:14 UTCv0.1.0cli❌ failing348 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON
2026-05-05 13:55:06 UTCv0.1.0cli❌ failing346 msfailed assertions: dir_exists: tools/archon-cli: missing dir: tools/archon-cli file_exists: tools/archon-cli/bin/archon.mjs: missing: tools/archon-cli/bin/archon.mjsJSON

已知局限

  • 未测试稍后通过 --with=cli 把 cli 加回来。这是一个值得单独添加的 场景(update-add-cli-back),等基础的移除路径绿了再补。
  • 未测试移除一个 required(必需)模块——那种情况应当大声失败。 负向场景 update-without-required-fails 是不错的后续补充。

交叉引用

json
{
  "runnable": "cli",
  "fixture": "fixtures/sandbox-node-ts",
  "ide_platform": "cursor",
  "prerequisites": [
    {
      "name": "archon install (no cli)",
      "cli": "install",
      "flags": [
        "--without=cli"
      ]
    }
  ],
  "steps": [
    {
      "name": "archon update with cli",
      "cli": "update",
      "flags": [
        "--with=cli"
      ]
    }
  ],
  "assertions": [
    {
      "dir_exists": "tools/archon-cli"
    },
    {
      "file_exists": "tools/archon-cli/bin/archon.mjs"
    }
  ]
}

依据 Apache-2.0 许可证发布。