agent-harness
A Rust framework for driving agent CLIs — or building your own — behind
one interface. Imported as harness:
use ;
let reg = new
.register
.register
.register; // your own impl Harness — no fork
let claude = reg.by_id.unwrap;
// claude.run(request, on_event)? streams normalized RunEvents
What it gives you
- The
Harnesstrait —info/readiness/install/run/credential/login. Object-safe (Box<dyn Harness>).run()only emitsRunEvents, so an implementor can spawn a CLI or call an HTTP API — CLI-backed and API-backed providers both fit. - A normalized event vocabulary —
RunEvent(text, thinking, tool start/end, suggested edits, activity, lifecycle) +ParsedLine+normalize_process_event, the skeleton every process-backed adapter shares. - An open
Registry— compose the built-ins and/or your own custom providers; nothing to fork to add one. - The streaming engine (
spawn_streaming/ProcessEvent/ProcessHandle/ PATH augmentation) is re-exported from thecli-streamleaf.
Built-in adapters (feature-gated)
Bob / Claude / Codex wrap the bob / Claude Code / Codex CLIs and live
as the bob / claude / codex modules, enabled by default:
= "0.1" # all three
= { = "0.1", = false, = ["claude"] } # just Claude — no bob/keyring
= { = "0.1", = false } # the lean framework only
The bob feature pulls in the unofficial bob-rs SDK (keychain
/ installer); claude/codex own their CLI's login, so they add no deps.
Wire shapes derive Serialize with stable field names, so any transport
(HTTP/SSE, an IPC channel) emits identical JSON.
License
Licensed under either of MIT or Apache-2.0 at your option.