Every agent on your device, behind one interface
anyagent discovers the coding agents, assistants and model runners already installed on a machine and exposes them through a single Rust API — one trait, one call site, no per-vendor SDK to wire up.
cargo add anyagent
~/dev/anyagent bat examples/quickstart.rs
use anyagent::{EventKind, Runtime, SessionOptions};
use futures::StreamExt;
// 1. find the agents already installed on this machine
let runtime = Runtime::new();
let agent = runtime.discover().await.require("claude")?;
// 2. open a session on it
let (session, mut events) = runtime.open(agent, SessionOptions::in_dir(".")).await?;
// 3. drive it — same calls for every agent
session.configure("model", "sonnet").await?;
session.prompt("explain this repo").await?;
// 4. one event stream, one set of types
while let Some(event) = events.next().await {
match event?.kind {
EventKind::TextDelta { text, .. } => print!("{text}"),
EventKind::ToolUpdated(tool) => println!("[{}]", tool.title),
EventKind::TurnEnded { .. } => break,
_ => {}
}
}
session.close().await?;