Expand description
Bamboo - A fully self-contained AI agent backend framework
Bamboo provides a complete backend system for AI agents, including:
- Built-in HTTP/HTTPS server (Actix-web)
- Agent execution loop with tool support
- LLM provider integrations (OpenAI, Anthropic, Google Gemini, GitHub Copilot)
- Session management and persistence
- Workflow and slash command systems
- Process management for external tools
§Features
- Dual mode: Binary (standalone server) or library (embedded)
- Unified directory: All data in the Bamboo data directory (default
${HOME}/.bamboo) - Production-ready: Built-in CORS, rate limiting, security headers
§Quick Start
§Binary Mode
bamboo serve --port 9562 --data-dir "$HOME/.bamboo"§Library Mode
ⓘ
use bamboo_agent::{BambooServer, Config};
#[tokio::main]
async fn main() {
let config = Config::new();
let server = BambooServer::new(config);
server.start().await.unwrap();
}Re-exports§
pub use error::BambooError;pub use error::Result;pub use bamboo_server as server;pub use bamboo_tools as tools;pub use bamboo_infrastructure as infrastructure;pub use bamboo_config as config;
Modules§
- actor_
cli - The
bamboo actor runCLI: drive an actor from the terminal.bamboo actor …/bamboo -p— drive actors from the terminal. - admin_
cli - The
bamboo health|status|sessions|session|stop|respond|schedulesadmin CLI: a thin HTTP client over a runningbamboo servefor operators (health probe, session list/inspect/stop/respond, schedule management). Thebamboo health | status | sessions | session | stop | respond | schedulesadmin CLI. - agent
- Ergonomic top-level Agent SDK.
- broker_
agent - The
bamboo broker-agent serveworker: connect to a central broker and answer Ask/Task (query/steer) for its mailbox; deployable local/Docker/remote.bamboo broker-agent serve: a long-lived agent that connects to a central message broker and answers Ask/Task for its own mailbox (query/steer modes). - claude_
code_ executor ClaudeCodeExecutor: drives the official Claude Code CLI as aChildExecutor(ExecutorSpec::ClaudeCode), sibling ofsubagent_worker.ClaudeCodeExecutor: a [ChildExecutor] that drives the official Claude Code CLI (claude) as an external sub-agent engine over its stream-json wire protocol. Seedocs/claude-code-executor.mdfor the full protocol reference (spawn flags, NDJSON frame table, permission relay, shutdown) this implementation follows.- codex_
app_ server_ executor - Long-lived
codex app-serverexecutor with interactive approval relay. Long-lived Codex app-server executor with Bamboo approval relay. - codex_
cli_ executor CodexExecutor: drivescodex exec --jsonas a one-shotChildExecutor(ExecutorSpec::Codex).CodexExecutor: a [ChildExecutor] that drives the official OpenAI Codex CLI throughcodex exec --json.- commands
- Command and workflow management
- core
- error
- Error types for Bamboo
- headless
- The
bamboo -pheadless server mode: full AppState, one-shot, resumable.bamboo -p— a COMPLETE bamboo server, headless: boots the fullAppState(root tool surface incl. SubAgent → can spawn actor children), runs the prompt on a root session through the same execute path the HTTP API uses, streams events to the terminal, and exits when the whole tree is finished (parent + children, including suspend/resume coordination). - model_
spec - Shared
-m/--modelCLI-flag grammar (provider:model/ bare model id), used by-p -m,actor run|serve -m, andbroker-agent spawn --modelso all three parse and validate the same string the same way (#246). Shared-m/--modelCLI-flag grammar. - plugin_
cli - The
bamboo plugin install|list|remove|updateCLI: a thin HTTP client over a runningbamboo serveinstance’s/api/v1/pluginsroutes. Thebamboo plugin install|list|remove|updateCLI — a thin HTTP client over a runningbamboo serveinstance’s/api/v1/pluginsroutes. - project_
worktree - Project-scoped Git worktree lifecycle.
- read_
cli - The
bamboo skills list/mcp listread CLI: inspect the configured skill and MCP surfaces offline (straight from<data_dir>), no running server. Thebamboo skills list/bamboo mcp listread CLI. - setup_
cli - The
bamboo init/doctor/config setonboarding CLI: configure a provider + API key and self-diagnose without the web UI (server-less).bamboo init/bamboo doctor/bamboo config set— first-run onboarding. - subagent_
worker - The
bamboo subagent-workeractor worker (provision via stdin, serve over WS).bamboo subagent-worker— the real actor worker.
Structs§
- Agent
- Stable, ergonomic entry point for agent execution.
- Agent
Builder - Ergonomic builder for
Agent. - Bamboo
Builder - Builder pattern for creating BambooServer
- Bamboo
Server - Main Bamboo server instance
- Config
- Runtime configuration facade. Phase-1 sidecar domains are typed modules;
the remaining values keep field-access compatibility through
Deref. - Hook
Runner - Engine adapter around the standalone hook dispatcher.
- Hook
Tool Outcome - Engine-independent view of a tool execution outcome.
- Lifecycle
Hook Test Output - Raw handler result returned by the settings dry-run endpoint.
- Script
Hook - One config-driven lifecycle script executed by an installed system runtime.
- Server
Config - HTTP server configuration
- Shell
Command Hook - One config-driven lifecycle shell command.
Enums§
- Agent
Hook Point - Lifecycle phases where hooks can be attached.
- Hook
Payload - Point-specific data supplied to an
AgentHookPointcallback. - Hook
Result - Result of running a hook.
- Lifecycle
Hook Event - User-facing lifecycle events that currently map to engine hook seams.
- Lifecycle
Script Runner - Runtime used to execute a lifecycle script.
Traits§
- Agent
Hook - Trait for agent lifecycle hooks.
Type Aliases§
- Shell
Hook Event - Backward-compatible name retained for SDK consumers.