API Reference
API Reference
Complete API reference for the cli-agents Rust library
API Reference
The cli-agents crate exports a small, focused API. Everything you need is re-exported from the crate root.
Primary imports
use cli_agents::{
// Core function
run,
// Handle for the running agent
RunHandle,
// Configuration
RunOptions, CliName, McpServer, McpTransport,
ProviderOptions, ClaudeOptions, CodexOptions, GeminiOptions,
// Results
RunResult, RunStats,
// Events
StreamEvent, Severity,
// Errors
Error, Result,
};Modules
| Module | Description |
|---|---|
run | The run() function, RunHandle, RunResult, and RunStats |
types | RunOptions, CliName, McpServer, and provider-specific option structs |
events | StreamEvent enum and Severity |
discovery | Functions for finding installed CLI binaries |
Constants
| Constant | Value | Description |
|---|---|---|
DEFAULT_MAX_OUTPUT_BYTES | 10 MB | Default max stdout buffer size, shared across all adapters |