CLI Reference
This page mirrors the CLI contract from the loopexec repository.
Commands
Section titled “Commands”loopexec init- Initialize local loopexec workspace metadata.
loopexec run- Run one bounded loop iteration.
loopexec status- Show loop status.
loopexec check- Validate invariants.
loopexec step- Execute a single step.
Global flags
Section titled “Global flags”--json- Emit exactly one JSON object to stdout.
- Human logs and error text go to stderr.
JSON output schema
Section titled “JSON output schema”All commands in --json mode emit one object with these fields:
tool(string)version(string)status(string)run_id(string, optional)iteration(integer, optional)halt_reason(string, optional)errors(array of strings)
Example:
{ "tool": "loopexec", "version": "0.1.0-rc1", "status": "ok", "run_id": "local", "iteration": 1, "errors": []}Exit codes
Section titled “Exit codes”0success10halted success condition met11halted blocked12halted max iterations reached20invariant failed30workspace invalid or missing40execution failure (timeout or command failure)50internal error
Examples
Section titled “Examples”Human mode:
loopexec initloopexec runloopexec status --run-id local --iteration 1JSON mode:
loopexec run --json