Skip to content

refactor(minimal): name the CLI binary target min - #737

Merged
norrietaylor merged 3 commits into
mainfrom
refactor/min-bin-name
Jul 14, 2026
Merged

refactor(minimal): name the CLI binary target min#737
norrietaylor merged 3 commits into
mainfrom
refactor/min-bin-name

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Jul 13, 2026

Copy link
Copy Markdown
Member

The user-facing command has been min for a while — clap says so (#[command(name = "min")]), and the installer lays the binary down as bin/min. But cargo still emitted minimal, and min was conjured by a rename at release-staging time. The dev build therefore disagreed with what ships: just up gave you target/debug/minimal while every doc, and every user, typed min.

This declares the binary target explicitly:

[[bin]]
name = "min"
path = "src/main.rs"

Declaring a [[bin]] disables autodiscovery, so src/main.rs now builds only as min. The minimal lib target and the package name are unchanged, so cargo build -p minimal still works.

Callers updated

--bin minimal--bin min and the built-binary paths across all five workflows (ci-linux-kvm, ci-linux-native, ci-macos, nightly-tests, release), the KVM lane's testbed staging that copies the CLI onto PATH, session-e2e.sh's mnl() wrapper, and the justfile's binary variable (minimalmin-bin).

What deliberately did NOT change

The published release asset names (minimal-linux-amd64, minimal-macos-arm64, …). Those are the contract that the install manifest and scripts/install.sh are built around; renaming them would churn the release channel for no user-visible gain, since the manifest already maps them to bin/min. Only the local build-output path feeding those steps moved, so release.yml now reads mv target/release/min target/release/minimal-macos-arm64.

Two other minimal names that are not this binary: the macOS shim (~/.minimal/shim/bin/minimal, a script that runs the CLI inside a VM — it's what just artifacts invokes to materialize the guest kernel), and the minimal crate/lib target.

Verification

Everything that can be run locally, was:

  • cargo build -p minimal emits target/debug/min and no longer emits minimal; cargo metadata confirms the targets are [('minimal', lib), ('min', bin)]. min --version / --help work.
  • Full session e2e on the macOS/HVF VM laneE2E_VM=1 ./scripts/session-e2e.sh, which resolves min from PATH and autospawns minvmd exactly as CI does. Cold activate → list → warm call → destroy → stop, all green. This is the same script the Linux native and KVM lanes run, so it exercises the PATH-based resolution those lanes depend on.
  • Release path simulated: cargo build --release -p minimal --bin min succeeds, and the otool gate release.yml runs against it passes (links only /usr/lib + /System, no libkrun — the default-features = false opt-out still holds).
  • All five workflows parse as YAML; shellcheck scripts/session-e2e.sh is clean; just --list / just --evaluate min-bin resolve; the installer harness is 148/148 green (its bin/min contract is untouched).
  • No Rust code referenced the binary by name — crates/minimal/tests/cli.rs calls library functions, and only the minvmd tests use CARGO_BIN_EXE_* (for minvmd, unchanged).

Follow-up, not done here

docs/reference/cli.md still writes minimal run shell etc., and release.yml names the generated completion files bash/minimal, zsh/_minimal, fish/minimal.fish. Both are pre-existing inconsistencies — the completion contents already register for min, since clap's command name was already min — and neither affects the build. Worth a separate docs pass.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The command-line interface is now provided as min instead of minimal.
    • Development, session, and end-to-end workflows now use the min command consistently.
    • Release builds and downloadable artifacts are aligned with the updated CLI naming.
  • Documentation
    • Updated setup guidance, examples, comments, and troubleshooting messages to use commands such as min activate and min ls.
  • Bug Fixes
    • Improved consistency between the CLI name used during development, testing, and release packaging.

The user-facing command has been `min` for a while — clap says so
(`#[command(name = "min")]`) and the installer lays the binary down as
`bin/min` — but cargo still emitted `minimal`, and `min` was conjured by
a rename at release-staging time. So the dev build disagreed with what
ships: `just up` produced `target/debug/minimal`, while every doc and
every user typed `min`.

Declare the binary target explicitly instead:

    [[bin]]
    name = "min"
    path = "src/main.rs"

Declaring a [[bin]] disables autodiscovery, so `src/main.rs` now builds
ONLY as `min`; the `minimal` lib target (and the package name, hence
`cargo build -p minimal`) are unchanged.

Callers updated: `--bin minimal` -> `--bin min` and the built-binary
paths in all five workflows (ci-linux-kvm, ci-linux-native, ci-macos,
nightly-tests, release), the KVM testbed staging that copies the CLI
onto PATH, session-e2e.sh's `mnl()` wrapper, and the justfile's binary
variable.

The published release ASSET names (minimal-linux-amd64, and so on) are
deliberately left alone: they are the contract the install manifest and
`scripts/install.sh` are built around, and renaming them would churn the
release channel for no user-visible gain. Only the local build-output
path feeding those steps changed.

Two `minimal` names that are NOT this binary and stay put: the macOS
shim (`~/.minimal/shim/bin/minimal`, which runs the CLI inside a VM —
`just artifacts` calls it), and the `minimal` crate/lib target.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87dcfeb0-11d1-4d1d-b957-0c1594a26338

📥 Commits

Reviewing files that changed from the base of the PR and between 8ed6a90 and cda9b33.

📒 Files selected for processing (9)
  • .github/workflows/ci-linux-kvm.yml
  • .github/workflows/ci-linux-native.yml
  • .github/workflows/ci-macos.yml
  • .github/workflows/nightly-tests.yml
  • .github/workflows/release.yml
  • crates/minimal/Cargo.toml
  • crates/sessions/example_project/minimal.toml
  • justfile
  • scripts/session-e2e.sh

📝 Walkthrough

Walkthrough

The minimal crate now explicitly produces a min binary. Local recipes, session tests, CI workflows, and release packaging have been updated to build, invoke, verify, stage, and rename that binary consistently.

Changes

CLI binary rename

Layer / File(s) Summary
Binary target contract
crates/minimal/Cargo.toml, crates/sessions/example_project/minimal.toml
Declares the min binary target and updates the example activation command.
Local CLI and session execution
justfile, scripts/session-e2e.sh
Updates local recipes, session commands, diagnostics, and documentation to use min.
CI and release binary paths
.github/workflows/ci-*.yml, .github/workflows/nightly-tests.yml, .github/workflows/release.yml
Builds, verifies, stages, and renames the min binary across test and release workflows.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: twitchyliquid64

Poem

A rabbit hops where binaries gleam,
“min” now races through each build stream.
CI packs it, releases fly,
Session checks wave it by.
One shorter name, one tidy dream!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: renaming the CLI binary target from minimal to min.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@norrietaylor
norrietaylor marked this pull request as draft July 13, 2026 21:47
@norrietaylor
norrietaylor marked this pull request as ready for review July 14, 2026 16:13
norrietaylor and others added 2 commits July 14, 2026 09:20
Resolve the conflicts from the commits that landed on main since this
branch's merge-base (#721, #732, #734, #735, #722), keeping main's
content and re-applying the `min` binary-target rename on top.

- justfile: main folded `up` into `dm1` (#722), so the branch's older
  `up` recipe is dropped rather than resurrected. Main's `dm1` invoked
  the `{{minimal}}` variable this branch renames, which would have left
  `just` unable to resolve it; it now invokes `{{min-bin}}`.
- CI lanes: keep main's rewritten jobs and steps, renaming only the CLI
  build flags and built-binary paths (`--bin min`, `target/debug/min`).

Also point the sessions example project at `./target/debug/min`; the
binary path it documented no longer exists after the rename.

Published release asset names (`minimal-linux-amd64`, ...), the macOS
`minimal` shim, and the `minimal` crate and lib target are deliberately
left alone.
@twitchyliquid64

Copy link
Copy Markdown
Member

Lets kick off an unstable after this also to see if we broke anything in the release

@norrietaylor
norrietaylor merged commit 7632ba8 into main Jul 14, 2026
28 checks passed
@norrietaylor
norrietaylor deleted the refactor/min-bin-name branch July 14, 2026 21:56
norrietaylor added a commit that referenced this pull request Jul 29, 2026
#1009 split `min completions <shell>` into `completions print` and
`completions install`; the release job still called the flat form, so
`Generate completions` exited 2 on run 30425725370 and the release never
reached GCS or the GitHub Release.

Switch the three `min` lines to `completions print <shell>`, and name
their outputs after the `min` binary (`min`, `_min`, `min.fish`) rather
than the crate: the shim `min` prints registers the command `min`, so a
shell only ever autoloads it from a file of that name — the
`minimal`/`_minimal` files shipped in `completions.tar.gz` since the
binary rename (#737) were dead on arrival. `mip` and `minimald` keep the
flat verb; only the `min` CLI changed.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants