feature: ilo run / check / build CLI verbs (0.12.0)#398
Merged
Conversation
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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…erbs # Conflicts: # ai.txt # skills/ilo/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
ilo run,ilo check, andilo buildas verb-noun subcommands matchingcargo/go/zerotoolchain 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 positionalilo <file>; same dispatch, same engine selection, same arg handlingilo build <file> -o <out> [func]— alias forilo compileilo 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 buildwith no source argument now print a friendlyUsage: ilo <verb> <file>line to stderr and exit 1, replacing the previous parser blowup (ILO-P020 incomplete function header for runfrom 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
What's in the diff
src/cli/args.rsaddsCmd::Build(CompileArgs)andCmd::Check(CheckArgs);src/main.rsdispatches both (build forwards tocompile_cmd, check calls the newcheck_cmd) and pre-clap-interceptsilo run|check|buildwith no source for the friendly usage messagetests/cli_verbs.rs: file / inline / args coverage forrun, clean / type-error / parse-error /--json/ no-args coverage forcheck, file + no-args coverage forbuild, 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-refactorSPEC.mdCLI invocation section picks up the three new verb forms and explains theilo checksemantics;ai.txtandskills/ilo/SKILL.mdregenerate from SPEC.md viabuild.rs;README.mdQuick start picks up a verb-form example blockSite repo: docs/reference/cli.md updated separately and pushed to ilo-lang/site main as commit
be8a82b.Test plan
cargo build --releasecleancargo fmt --checkcleancargo clippy --release --all-targets -- -D warningscleantests/cli_verbs.rspasscargo test --release --features craneliftsuite: 3179+ passing tests; one flakyvm::tests::vm_rdl_basic(TOCTOU on/tmp/ilo_vm_rdl_test.txtwhen run alongsidevm_rdl_not_found) — passes in isolation, unrelated to this PR; pre-existingregression_inline_lambdafailures on main caused by the recent--run-cranelift→--jitrename, also unrelatedFollow-ups
regression_inline_lambdafailures from the--run-cranelift→--jitrename should be cleaned up in a follow-up; out of scope here.--benchto a fullilo benchsubcommand and split--explainoverload intoilo explain <code>per the brief's deferred-decisions section.