godelcli
v0.1.1
Published
npx installer for the verification compiler: uv, elan, the repository, its Python environment, the Lean corpus and the Claude Code recorder hooks
Readme
godelcli (the npx installer)
Note: The old scoped package name
@polymorphic-search/godel-cliis deprecated. Usegodelcliinstead.
One command puts everything on a machine that verifying a coding agent's work needs:
npx godelcli@latestNothing else is asked of you: no Python to pick, no Lean toolchain to install, no
settings file to edit by hand. The installer needs node >= 18 (npx brings it),
git, curl and a POSIX shell — macOS or Linux, or Windows inside WSL.
What it does, step by step
Each step is skipped, out loud, when its result is already there, so running the command twice is safe and the second run tells you what it found.
- platform check.
linuxordarwin. On Windows the whole plan is refused by name and points at WSL: every step below is a POSIX shell command and the recorder installs its hooks into~/.claude/settings.json. - uv —
curl -LsSf https://astral.sh/uv/install.sh | sh. uv then downloads its own managed Python 3.12, so no system Python is touched. The shell rc is not modified;~/.local/binand~/.cargo/binare put on the PATH of the later steps that need them. - elan —
curl -sSf https://elan.lean-lang.org/elan-init.sh | sh -s -- -y --default-toolchain none --no-modify-path.--default-toolchain noneon purpose: the only Lean that gets installed is the one the repository pins inlean-toolchain, and elan'slakeshim installs exactly that in step 6. - the repository at
<home>/verification-compiler:git clone --branch <ref> <url> <dir>when the directory is absent, elsegit -C <dir> fetch origin <ref>followed bygit -C <dir> checkout --detach FETCH_HEAD. The checkout is always detached atFETCH_HEAD: one rule for a branch, a tag and a bare commit alike, and a detached checkout cannot quietly diverge from the ref you asked for. uv syncin the checkout — the Python environment, test tools included, so the checkout can run its own suite.lake buildin the checkout, with~/.elan/binon PATH. This is where the pinned toolchain is downloaded and the Lean corpus is built. It is the longest step of the install.- the recorder hooks —
uv run python scripts/install_recorder.py --harness claude-code(plus--allow-agent-planswhen you asked for it). This writes thevc-hook/vc-inject/vc-guardentries into~/.claude/settings.json. The hook command isuv run --project <checkout> vc-hook, which is why the checkout has to stay where it is: move or delete it and the recorder stops recording. <home>/tracesis created, and<home>/install.jsonis written:{repoUrl, ref, commit, home, allowAgentPlans, lean, installedAt}. Thecommitis read back out of git after the checkout exists — the installer records the commit it got, never the one it hoped for, and writesnullwith a printed warning when git cannot say.
Flags
| flag | what it does |
| --- | --- |
| --allow-agent-plans | install the hooks in the mode that asks the agent for its plan before its first edit. Passed straight through to scripts/install_recorder.py. |
| --dry-run | print every step's command and run nothing. Writes nothing, creates nothing. |
| --home DIR | where everything goes (default $VC_HOME, else ~/.vc): the checkout at DIR/verification-compiler, traces at DIR/traces, the manifest at DIR/install.json. |
| --ref REF | branch, tag or commit to check out (default main). |
| --repo-url URL | where to clone from (default the repository named in package.json's config.repoUrl). |
| --skip-lean | skip elan and lake build. No verdict can be produced then — the verdict comes from the Lean kernel, so this leaves an installation that records a session and cannot check one. |
| --yes | accepted and ignored; this installer never prompts. |
| --help | the same list, from the binary. |
Subcommands: install (the default) and doctor.
Exit codes: 0 done, 1 a step failed (the message names the step and says to
re-run — finished steps are skipped), 3 a refusal (unknown flag, unsupported
platform). doctor exits 1 when a component is missing.
What it writes, and where
~/.vc/ (or $VC_HOME, or --home DIR)
verification-compiler/ the checkout: the hooks point at it by path
traces/ the recorder's hash-chained session traces
install.json what was installed, from where, at which commit
~/.claude/settings.json the vc-hook / vc-inject / vc-guard hook entries
~/.local/bin, ~/.cargo/bin uv (its own installer's choice)
~/.elan/ elan and the pinned Lean toolchainYour shell's rc files are not touched.
One consequence of that, if you pass --home something other than ~/.vc: the
recorder's own default trace directory is ~/.vc/traces and a hook entry carries
no environment, so export VC_TRACE_DIR=<home>/traces in your shell. The
installer prints exactly that line when your home is not the default, rather than
leaving you with a trace directory nothing writes to.
Checking an installation
npx godelcli@latest doctorOne line per component — node, uv, elan and the pinned toolchain, lake, the
repository and its commit, .venv, the Lean build, the hook entries in
~/.claude/settings.json, the trace directory — each ok or missing with the
path it looked at. Exit 0 when every line is ok, else 1, so CI can gate on it.
The lake line is asked of PATH only, and it is the one line this installer
cannot fix for you. Every verdict and every re-check spawns a bare
lake env lean with the environment it inherited, so a toolchain installed under
~/.elan/bin and absent from the shell's PATH is a machine that can neither
produce a verdict nor recheck a certificate somebody else produced. When the shim
is in elan's own directory the detail prints the line that fixes it
(export PATH="$HOME/.elan/bin:$PATH"); this installer never edits a shell rc.
After installing
Work with Claude Code as usual; the hooks record the session. Then:
uv run --project ~/.vc/verification-compiler \
verify-work --repo /path/to/your/project --session <session_id>Exit codes there are the verifier's: 0 proved, 1 refuted, 2 unknown, 4
conditional.
Uninstalling
There is no uninstall command, because there is nothing to be clever about:
- Delete the
vc-hook,vc-injectandvc-guardentries from~/.claude/settings.json(they are thehooksentries whosecommandcontains those names; everything else in that file is yours and the installer never touched it). rm -rf ~/.vc(or your--home), which removes the checkout, the traces and the manifest.- uv and elan are general-purpose tools installed in their own standard way;
remove them with
rm -rf ~/.elanand uv's ownuv self uninstallif you want them gone too.
Trust
The verification-compiler enforces four trust rules:
- Agent never grades itself — recording and validation are independent processes.
- Traces live outside the repo — default
~/.vc/tracesprevents self-modification. - vc-validate ≠ verify-work —
vc-validateindependently re-checks certificates, sharing no code with the producer. Validation proves the obligations were checked by the kernel against the recorded trace; it does not prove the work is correct or complete, only that it satisfies the plan's stated constraints. - --skip-lean cannot produce kernel verdicts — verdicts come from the Lean kernel, so
--skip-leaninstallations can record sessions but cannot check them.
Publishing
For maintainers with npm publish access:
The package is configured for publication to the npm registry. To publish a new version:
- Update the version in
package.jsonfollowing semantic versioning. - Ensure all tests pass:
npm test - Publish to npm:
npm publish --access=public
The NPM_TOKEN secret is required for automated publishing via GitHub Actions (see .github/workflows/npm-publish.yml).
Deprecating the old scoped package
After successfully publishing godelcli, maintainers with access to the old scoped package should deprecate it:
npm deprecate @polymorphic-search/godel-cli@"*" "Use npx godelcli@latest instead"Developing this package
cd npm
node --test "test/**/*.test.js"The tests spawn nothing except node bin/vc.js --help, one dry run of the real
binary, npm pack --dry-run and a two-line sh that kills itself (the case where
a command dies by signal): the planner (lib/plan.js) and the doctor
(lib/doctor.js) are pure functions over a probed state, and the executor
(lib/run.js) takes its spawn and its file write as parameters, so every branch
of the installer is checked without installing anything. tests/test_npm_package.py
runs that suite from the repository's Python suite as well.
