verify-10x-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVerify 10x-cli
验证10x-cli
The surface is a short-lived CLI (), not a server. Every run gets its own
fake delivery API on an OS-assigned free port, its own , and its own
throwaway project dir — so several agents can verify in parallel on one machine and nothing
touches production, real email, your or this checkout's .
10x <command>XDG_CONFIG_HOME~/.config/10x-cli.claude/Everything goes through one helper (run from the repo root):
bash
V=.claude/skills/verify-10x-cli/scripts/verify.sh
$V help其表层是一个短期运行的CLI(),而非服务器。每次运行都会在操作系统分配的空闲端口上启动专属的模拟交付API,拥有独立的和临时项目目录——因此多个Agent可以在同一台机器上并行执行验证,且不会影响生产环境、真实邮箱、你的或当前检出代码的目录。
10x <command>XDG_CONFIG_HOME~/.config/10x-cli.claude/所有操作都通过一个辅助脚本完成(在仓库根目录运行):
bash
V=.claude/skills/verify-10x-cli/scripts/verify.sh
$V helpLaunch
启动
bash
bun install --frozen-lockfile # once per checkout
$V up # prints run=<id> api=http://127.0.0.1:<port> pid=<pid> project=<dir> evidence=<dir>
$V seed-auth # optional: logged-in state without driving the login flowuprun=…scripts/fake-api.tsapi.jsonBUNDLE_PUBLIC_KEYSETsrc/lib/signing.tsAPI_BASE_URLlocalhost127.0.0.1bun run src/index.tsbun run buildVERIFY_ENTRY=distFixture served by the fake API (course , id ):
10xdevs310xdevs-3| Lesson | Module state | Content |
|---|---|---|
| unlocked | skill |
| unlocked | skill |
| locked (403) | — |
$V bump <lessonId>v1v2contentHashsyncbash
bun install --frozen-lockfile # 每个检出版本只需执行一次
$V up # 输出 run=<id> api=http://127.0.0.1:<port> pid=<pid> project=<dir> evidence=<dir>
$V seed-auth # 可选:无需驱动登录流程即可获得已登录状态当命令输出时即表示就绪:只有在开始监听后才会写入。它会生成一个全新的Ed25519密钥;CLI通过接受该密钥,而仅在为/时才会启用此逻辑。CLI从源码运行();若要验证发布的Node包,请先执行,并在命令前加上前缀。
uprun=…scripts/fake-api.tsapi.jsonBUNDLE_PUBLIC_KEYSETsrc/lib/signing.tsAPI_BASE_URLlocalhost127.0.0.1bun run src/index.tsbun run buildVERIFY_ENTRY=dist模拟API提供的测试固件(课程,ID为):
10xdevs310xdevs-3| 课时 | 模块状态 | 内容 |
|---|---|---|
| 已解锁 | skill |
| 已解锁 | skill |
| 已锁定(403) | — |
$V bump <lessonId>v1v2contentHashsyncDoctor
诊断
bash
$V doctor # exit 0 = worth drivingRead-only. Checks: the fake API pid is alive and was started by this run,
answers, the URL is loopback, config/project dirs are this run's, the checkout revision has
not changed since (rebuild/re- if it did), and the CLI starts (). Run it
first, and again whenever output looks wrong. Not the same as (a feature, see
the map).
/healthupup--version10x doctorbash
$V doctor # 退出码0 = 可正常驱动验证只读操作。检查项包括:模拟API的pid仍在运行且由本次运行启动、接口可正常响应、URL为回环地址、配置/项目目录属于本次运行、自执行以来检出的代码版本未发生变化(若有变化需重新构建/重新执行),以及CLI可正常启动(命令)。请先运行此命令,当输出看起来有问题时也可再次运行。它与不同(后者是一项功能,详见功能地图)。
/healthupup--version10x doctorDrive
驱动操作
Non-TTY (JSON envelope mode — the CLI implies when stdout is not a TTY):
--jsonbash
$V cli <label> -- <10x args> # e.g. $V cli get -- get m1l1 --tool claude-codeRuns in the run's project dir; saves ; prints them. The
helper always exits 0 — the CLI's exit code is data ( ok, error, usage, auth,
forbidden, not found). Always pass to / in a fresh
project, or tool detection prompts / fails.
NN-<label>.cmd|stdout|stderr|exit012345--tool claude-codegetsyncTTY (human output, menus) in a private tmux server (,
never your default tmux):
@clack/prompts-L 10x-verify-<run>bash
$V tty <label> -- <10x args> # start
$V wait-screen '<regex>' [seconds] # wait for a prompt string, never a fixed sleep
$V keys Down Enter # tmux key names, or literal text
$V screen <label> # save the screen as evidence
$V wait-screen '10x exited' # the PTY prints "[10x exited <code>]" when doneFake-world actions: (the learner clicks the newest magic link), ,
(publish a newer toolkit release; remove / restore the
changelog route).
State proof: (sha256 of every file in project + config dirs).
Narrative: appends to the run's .
$V click$V bump <lesson>$V changelog release|off|on$V snapshot <label>$V note "<text>"notes.mdThe feature map in has the exact recipe per feature.
Read its README first; a proof that drives one convenient entry point is incomplete when
the map lists others.
features/非TTY模式(JSON封装模式——当stdout不是TTY时,CLI会默认启用参数):
--jsonbash
$V cli <label> -- <10x args> # 例如 $V cli get -- get m1l1 --tool claude-code在本次运行的项目目录中执行;保存文件;并打印这些内容。辅助脚本始终以0退出——CLI的退出码会作为数据记录( 成功, 错误, 用法错误, 认证错误, 禁止访问, 未找到)。在新项目中执行/命令时请务必传入,否则工具检测会提示/失败。
NN-<label>.cmd|stdout|stderr|exit012345getsync--tool claude-codeTTY模式(人类可读输出,菜单)运行在私有tmux服务器中(,绝不会使用你的默认tmux):
@clack/prompts-L 10x-verify-<run>bash
$V tty <label> -- <10x args> # 启动
$V wait-screen '<regex>' [seconds] # 等待提示字符串出现,不要使用固定时长等待
$V keys Down Enter # tmux 按键名称,或直接输入文本
$V screen <label> # 保存当前屏幕作为证据
$V wait-screen '10x exited' # 执行完成时PTY会输出 "[10x exited <code>]"模拟场景操作:(模拟学习者点击最新的魔法链接)、、(发布更新的工具包版本;移除/恢复更新日志接口)。
状态证明:(项目+配置目录中所有文件的sha256哈希)。
记录说明: 会将内容追加到本次运行的文件中。
$V click$V bump <lesson>$V changelog release|off|on$V snapshot <label>$V note "<text>"notes.mdfeatures/Evidence
证据
All proof lands in (gitignored, survives ):
numbered , , , ,
, and (every HTTP request the CLI made, copied at ).
.quality-local/verify-10x-cli/<run>/down.cmd/.stdout/.stderr/.exit.screen.txt.tree.txtnotes.mdfake-api.logrequests.logdownProof standards:
- Drive the real user path (in a project dir). No importing
10x …functions, no writing the manifest by hand.src/is the one allowed shortcut, and only for features other than auth.seed-auth - Capture the action and the resulting state: the command output and a (or file contents) showing what was written, kept or removed.
snapshot - Verify side effects, not just the envelope: files on disk, ,
.claude/.10x-cli-manifest.json,.10x-cli.jsonrule block,CLAUDE.md, andauth.jsonfor which endpoints were hit.requests.log - was observed to write nothing (compare
--dry-runbefore/after) but still fetch over the network (seesnapshot). Re-check that when you change it; do not trust the flag name.requests.log - calls the real npm registry (
10x doctor, read-only GET) for its version check. Everything else stays on the fake API.registry.npmjs.org - Report skipped entry points as skipped, with the unmet precondition.
所有证明材料都存放在目录下(已加入gitignore,执行后仍会保留):编号的文件、、、、以及(CLI发出的所有HTTP请求,在执行时复制)。
.quality-local/verify-10x-cli/<run>/down.cmd/.stdout/.stderr/.exit.screen.txt.tree.txtnotes.mdfake-api.logrequests.logdown证明标准:
- 驱动真实用户路径(在项目目录中执行命令)。不得导入
10x …下的函数,不得手动编写清单文件。src/是唯一允许的快捷方式,且仅可用于非认证相关的功能验证。seed-auth - 同时捕获操作和结果状态:既要记录命令输出,也要有(或文件内容)展示哪些内容被写入、保留或删除。
snapshot - 验证副作用,而非仅验证封装内容:包括磁盘上的文件、、
.claude/.10x-cli-manifest.json、.10x-cli.json的规则块、CLAUDE.md,以及通过auth.json查看调用了哪些接口。requests.log - 经观察,模式不会写入任何内容(可对比执行前后的
--dry-run),但仍会发起网络请求(见snapshot)。修改该功能时请重新验证此行为;不要仅凭参数名称判断其作用。requests.log - 会调用真实的npm registry(
10x doctor,只读GET请求)进行版本检查。其余所有请求都指向模拟API。registry.npmjs.org - 对于跳过的入口点,需明确标注为已跳过,并说明未满足的前置条件。
Cleanup
清理
bash
$V downKills only the fake API pid recorded by (after checking its command line contains this
run's scratch dir) and this run's private tmux server, deletes the scratch dir
(), and keeps the evidence dir. Never /:
other sessions run on this machine. After a failed attempt, still run . To target an
older run: .
up$TMPDIR/10x-verify-<run>.*pkill bunpkill tmuxdownVERIFY_RUN=<id> $V downbash
$V down仅会终止记录的模拟API pid(会先检查其命令行包含本次运行的临时目录)和本次运行的私有tmux服务器,删除临时目录(),并保留证据目录。切勿使用/:机器上可能还有其他会话在运行。即使验证失败,也请执行命令。若要清理旧的运行实例:。
up$TMPDIR/10x-verify-<run>.*pkill bunpkill tmuxdownVERIFY_RUN=<id> $V downHelpers
辅助脚本
| Script | Invocation |
|---|---|
| |
| started by |
Both are verification scaffolding, not product code. When the API contract changes
( updates ), update to
match or verification will lie.
bun run generate-typessrc/generated/api-types.tsfake-api.ts| 脚本 | 调用方式 |
|---|---|
| |
| 由 |
两者都是验证脚手架,而非产品代码。当API契约发生变化时(会更新),请同步更新以保持一致,否则验证结果会失真。
bun run generate-typessrc/generated/api-types.tsfake-api.ts