Skip to content

feature: ilo run / check / build CLI verbs (0.12.0)#398

Merged
danieljohnmorris merged 5 commits into
mainfrom
feature/phase1b-cli-verbs
May 18, 2026
Merged

feature: ilo run / check / build CLI verbs (0.12.0)#398
danieljohnmorris merged 5 commits into
mainfrom
feature/phase1b-cli-verbs

Conversation

@danieljohnmorris
Copy link
Copy Markdown
Collaborator

Summary

Adds ilo run, ilo check, and ilo build as verb-noun subcommands matching cargo / go / zero toolchain conventions, while preserving every existing positional form for backwards compatibility. Ships in 0.12.0 alongside the modular skills work as a coherent CLI refresh.

  • ilo run <file> [args] — exact alias for the bare positional ilo <file>; same dispatch, same engine selection, same arg handling
  • ilo build <file> -o <out> [func] — alias for ilo compile
  • ilo check <file> [--json] — new capability: lex + parse + import-resolve + verify, exit 0 if clean, exit 1 with diagnostics on stderr if not; does not execute the program. Useful for editor save-hooks, agent inner loops, CI gates that want type-only feedback. On a syntactically-broken input it still reports the parse error rather than crashing.

ilo run / ilo check / ilo build with no source argument now print a friendly Usage: ilo <verb> <file> line to stderr and exit 1, replacing the previous parser blowup (ILO-P020 incomplete function header for run from lexing the verb as inline ilo source). One of the manifesto wins of this PR: every agent who reached for the natural toolchain shape used to burn a retry decoding that error.

Repro before/after

$ ilo run                                        # before
{"code":"ILO-P020","message":"incomplete function header for `run`: ...

$ ilo run                                        # after
Usage: ilo run <file.ilo> [func] [args...]
       ilo run <inline-code> [func] [args...]

$ ilo check file.ilo --json                      # new
{"code":"ILO-T008","labels":[],"message":"return type mismatch: expected n, got _"...}

What's in the diff

  • commit 1 (cli)src/cli/args.rs adds Cmd::Build(CompileArgs) and Cmd::Check(CheckArgs); src/main.rs dispatches both (build forwards to compile_cmd, check calls the new check_cmd) and pre-clap-intercepts ilo run|check|build with no source for the friendly usage message
  • commit 2 (tests) — 16 integration tests in tests/cli_verbs.rs: file / inline / args coverage for run, clean / type-error / parse-error / --json / no-args coverage for check, file + no-args coverage for build, plus 4 backwards-compat regression tests that the bare positional forms (ilo file.ilo, ilo file.ilo arg, ilo file.ilo func, ilo compile file.ilo -o out) all still work post-refactor
  • commit 3 (docs)SPEC.md CLI invocation section picks up the three new verb forms and explains the ilo check semantics; ai.txt and skills/ilo/SKILL.md regenerate from SPEC.md via build.rs; README.md Quick start picks up a verb-form example block

Site repo: docs/reference/cli.md updated separately and pushed to ilo-lang/site main as commit be8a82b.

Test plan

  • cargo build --release clean
  • cargo fmt --check clean
  • cargo clippy --release --all-targets -- -D warnings clean
  • 16/16 new tests in tests/cli_verbs.rs pass
  • Full cargo test --release --features cranelift suite: 3179+ passing tests; one flaky vm::tests::vm_rdl_basic (TOCTOU on /tmp/ilo_vm_rdl_test.txt when run alongside vm_rdl_not_found) — passes in isolation, unrelated to this PR; pre-existing regression_inline_lambda failures on main caused by the recent --run-cranelift--jit rename, also unrelated
  • Smoke-tested every acceptance criterion in the brief by hand

Follow-ups

  • The pre-existing regression_inline_lambda failures from the --run-cranelift--jit rename should be cleaned up in a follow-up; out of scope here.
  • A future PR can promote --bench to a full ilo bench subcommand and split --explain overload into ilo explain <code> per the brief's deferred-decisions section.

Adds three verb-noun aliases matching cargo / go / zero toolchain
conventions:

- ilo run <file> [args] — exact alias for the bare positional 'ilo
  <file>' dispatch, same engine selection and arg handling
- ilo build <file> -o <out> [func] — alias for 'ilo compile'
- ilo check <file> [--json] — new capability: lex + parse + resolve
  imports + verify, exit 0 if clean, exit 1 with diagnostics on stderr
  if not. Does not execute the program. Useful for editor save-hooks,
  agent inner loops, CI gates.

ilo run / check / build with no source argument now print a friendly
'Usage: ilo <verb> <file>' line to stderr and exit 1, replacing the
previous parser blowup (ILO-P020 'incomplete function header for
run' from lexing the verb as inline ilo source).

The bare positional forms (ilo file.ilo, ilo compile ...) remain
fully supported; the verbs are aliases, not replacements.
16 integration tests covering the new verb-noun surface plus
backwards-compat regression for the bare positional forms:

- ilo run <file> / <inline> / with args
- ilo run with no source prints usage (negative-asserts the old
  ILO-P020 parser blowup so a regression is caught loud)
- ilo check on clean / type-error / parse-error inputs
- ilo check --json emits NDJSON diagnostics on stderr
- ilo build <file> -o <out> produces a binary
- positional 'ilo file.ilo', 'ilo file.ilo arg', 'ilo file.ilo func',
  and 'ilo compile file.ilo -o out' all still work post-dispatch
  refactor
- SPEC.md CLI invocation table picks up the three new verb forms and
  adds a paragraph on verb-noun aliases and the ilo check semantics
- ai.txt and skills/ilo/SKILL.md regenerate from SPEC.md via build.rs
- README.md Quick start section picks up a verb-form example block
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 86.59794% with 13 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/main.rs 86.59% 13 Missing ⚠️

📢 Thoughts on this report? Let us know!

@danieljohnmorris danieljohnmorris merged commit 3ad23fa into main May 18, 2026
4 of 5 checks passed
@danieljohnmorris danieljohnmorris deleted the feature/phase1b-cli-verbs branch May 18, 2026 21:20
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.

1 participant