Expand description
Nucel Agent SDK — Unified
One import for all providers. Swap coding agents via configuration.
§Quick Start
use nucel_agent_sdk::{AgentExecutor, ClaudeCodeExecutor, SpawnConfig};
use std::path::Path;
let executor = ClaudeCodeExecutor::new();
let session = executor.spawn(
Path::new("/my/repo"),
"Fix the failing tests",
&SpawnConfig {
model: Some("claude-opus-4-6".into()),
budget_usd: Some(5.0),
..Default::default()
},
).await?;
println!("Response: {}", session.query("Check if CI passes now").await?.content);
session.close().await?;§Provider Selection
use nucel_agent_sdk::*;
// Via config string (like agent-operator does)
let executor = build_executor("claude-code", None);
let executor = build_executor("codex", Some("sk-...".into()));
let executor = build_executor("opencode", Some("http://localhost:4096".into()));§Runnable examples
examples/claude_basic.rs— spawn + query + close against Claude Code.examples/codex_resume.rs— spawn, save thesession_id, resume, query.examples/opencode_http.rs— point at a localopencode serveand send a prompt.examples/build_executor.rs— runtime provider selection viabuild_executor.
Run any of them with:
cargo run -p nucel-agent-sdk --example claude_basic§See also
- Workspace README
docs/tutorials/— getting started, multi-turn, budget control, provider comparison.CONTRIBUTING.md— adding a new provider.
Structs§
- Agent
Capabilities - Capability flags for a provider implementation.
- Agent
Cost - Cost breakdown for a single query or session.
- Agent
Response - Response from a coding agent query.
- Agent
Session - Active agent session.
- Availability
Status - Runtime availability of the provider.
- Cache
Point - A single cache-breakpoint marker for prompt caching.
- Claude
Code Executor - Claude Code executor — spawns
claudeCLI subprocess. - Codex
Executor - Codex executor — spawns
codex execCLI subprocess. - Hook
Config - Hook configuration for tool/lifecycle interception.
- Hook
Handler - A single hook handler — a shell command the provider will execute.
- Opencode
Executor - OpenCode executor — connects to OpenCode HTTP server.
- Session
Metadata - Metadata about a session (persistable, cloneable).
- Spawn
Config - Configuration for spawning a new session.
Enums§
- Agent
Error - Executor
Type - Supported executor backends.
- Message
Event - Event emitted by a streaming query.
- Permission
Mode - Permission mode for file system and command operations.
Traits§
- Agent
Executor - Core trait — every provider implements this.
- Session
Impl - Session implementation trait. Providers implement this to control query/cost/close behavior.
Functions§
- available_
providers - List all available provider names.
- build_
executor - Build an executor from a config string (like
providers.agent = "claude-code").
Type Aliases§
- Event
Stream - Boxed event stream — what
query_stream()returns. - Result