bamboo-agent 0.1.0

A fully self-contained AI agent backend framework with built-in web services, multi-LLM provider support, and comprehensive tool execution
Documentation
# Bamboo Agent ๐ŸŽ‹

[![Crates.io](https://img.shields.io/crates/v/bamboo-agent.svg)](https://crates.io/crates/bamboo-agent)
[![Documentation](https://docs.rs/bamboo-agent/badge.svg)](https://docs.rs/bamboo-agent)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://img.shields.io/github/actions/workflow/status/bigduu/Bamboo-agent/ci.yml?branch=main)](https://github.com/bigduu/Bamboo-agent/actions)
[![Test Coverage](https://img.shields.io/badge/tests-806%20passing-brightgreen)](https://github.com/bigduu/Bamboo-agent)

**A fully self-contained AI agent backend framework with built-in web services.**

Bamboo provides everything you need to build, deploy, and scale AI-powered applications with support for multiple LLM providers, comprehensive tool execution, and production-ready infrastructure.

## โœจ Features

- ๐Ÿค– **Complete Agent System**: Agent loop, tool execution, skill management
- ๐ŸŒ **Built-in HTTP Server**: Actix-web based API server with REST and streaming endpoints
- ๐Ÿง  **Multi-LLM Support**: OpenAI, Anthropic, Google Gemini, GitHub Copilot
- ๐Ÿ“ **XDG-Compliant**: Follows XDG Base Directory specification
- ๐Ÿ”ง **Dual Mode**: Binary (standalone server) or library (embedded)
- ๐Ÿ” **Production-Ready**: CORS, rate limiting, security headers built-in
- ๐Ÿ”„ **Session Management**: Persistent conversation history
- โšก **Workflow System**: Automate complex tasks with YAML workflows
- ๐Ÿค **Claude Integration**: Seamless Claude Code binary discovery and management
- ๐Ÿงช **Well Tested**: 806 tests with 100% pass rate

## Installation

### From crates.io

```bash
cargo install bamboo-agent
```

### From source

```bash
git clone https://github.com/bigduu/Bamboo-agent
cd bamboo
cargo install --path .
```

## Quick Start

### Binary Mode

```bash
# Start server with default settings
bamboo serve

# Custom configuration
bamboo serve --port 9000 --bind 0.0.0.0 --data-dir /var/lib/bamboo
```

### Library Mode

```rust
use bamboo_agent::{BambooBuilder, BambooConfig};

#[tokio::main]
async fn main() {
    let server = BambooBuilder::new()
        .port(3000)
        .bind("0.0.0.0")
        .data_dir(std::path::PathBuf::from("/var/lib/myapp"))
        .build()
        .unwrap();

    server.start().await.unwrap();
}
```

## Configuration

Bamboo follows the [XDG Base Directory specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).

### Default Paths

- **Config**: `$XDG_CONFIG_HOME/bamboo/config.json` (default: `~/.config/bamboo/`)
- **Data**: `$XDG_DATA_HOME/bamboo/` (default: `~/.local/share/bamboo/`)
- **Cache**: `$XDG_CACHE_HOME/bamboo/` (default: `~/.cache/bamboo/`)

### Configuration File

Edit `~/.config/bamboo/config.json`:

```json
{
  "server": {
    "port": 8080,
    "bind": "127.0.0.1",
    "workers": 10
  },
  "data_dir": "~/.local/share/bamboo"
}
```

### Environment Variables

Override configuration with environment variables:

- `BAMBOO_PORT`: Server port
- `BAMBOO_BIND`: Bind address
- `BAMBOO_DATA_DIR`: Data directory

## API Endpoints

Once running, Bamboo exposes the following endpoints:

### Health Check
```
GET /api/v1/health
```

### Chat Completions
```
POST /api/v1/chat/completions
```

### Agent Execution
```
POST /api/v1/agent/run
```

### Workflows
```
GET    /v1/workflows
POST   /v1/workflows
DELETE /v1/workflows/{name}
```

### Sessions
```
GET  /api/v1/sessions
POST /api/v1/sessions
```

## Development

### Build

```bash
cargo build
```

### Test

```bash
cargo test
```

### Run

```bash
cargo run -- serve
```

## Architecture

Bamboo is organized into the following modules:

- **`config`**: Configuration management with XDG support
- **`core`**: Core types and utilities
- **`agent`**: Agent system (loop, tools, skills, LLM providers)
- **`server`**: HTTP server and controllers
- **`process`**: Process management
- **`claude`**: Claude Code integration
- **`commands`**: Workflow, slash commands, keyword masking

## License

MIT

## Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

## Roadmap

- [ ] Complete agent system migration
- [ ] Full OpenAI/Anthropic API compatibility
- [ ] Webhook support
- [ ] Plugin system
- [ ] gRPC API
- [ ] Kubernetes deployment guides