Expand description
locode-exec — the minimal headless CLI (Task 14, ADR-0009), as a library.
The crate ships both a binary (the stock CLI) and this lib target so downstream binary crates can reuse the entire CLI — flags, session assembly, stdout discipline, exit codes — while injecting custom providers (ADR-0015):
use locode_exec::{ProviderRegistry, main_with};
fn main() -> std::process::ExitCode {
main_with(ProviderRegistry::builtin() /* .register("my-wire", …) */)
}Stdout discipline: stdout carries exactly one machine-readable artifact
(the JSON report, the final message, or the JSONL event stream — by
--output-format), enforced structurally: the workspace denies
print_stdout/print_stderr, and the ONLY allows live in output.rs
(Codex-exec’s pattern). All diagnostics go to stderr; exit codes map the
run’s terminal status (0 = structured, 1 = fatal, 2 = usage via clap).
Modules§
- cli
- clap surface (plan §3.1 + the positional-prompt addendum).
- run
- Session assembly + drive (plan §3.2): resolve inputs, build host/pack/
provider through the facade, run the engine, emit per
--output-format.
Structs§
- Provider
Registry - The
--api-schemaname space: ordered name → factory entries.
Functions§
- main_
with - Parse the CLI, install logging, and drive one session to its exit code —
the whole binary, minus
fn main. Custom providers come in throughregistry; the stock binary passesProviderRegistry::builtin.