Thank you for your interest in contributing! Here's how to get started.
For full setup instructions, project structure, and debugging tips, see the Development Guide.
# Install Rust (if needed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Clone, build, install
git clone https://github.com/shuyhere/bb-agent.git
cd bb-agent
cargo install --path crates/cli
# Verify
bb --version
bb- Rust 1.93+ (pinned in
rust-toolchain.toml— auto-installed by rustup) - A C compiler (
cc/gcc/clang) for SQLite and linking - Optional: Chrome/Chromium for
browser_fetchtool - Optional: Node.js 16+ for testing extensions
- Fork the repository
- Create a branch from
master:git checkout -b my-feature - Make your changes
- Ensure quality:
cargo fmt --all cargo clippy --workspace --all-targets cargo test --workspace --release - Commit with a clear message
- Open a Pull Request
- Run
cargo fmt --allbefore committing - Run
cargo clippy --workspace --all-targets— zero warnings required - Write tests for new functionality
- Use
thiserrorfor error types,anyhowfor application-level errors - Doc comments (
///) on all public items - No
unsafecode - No
unwrap()/expect()outside of tests and static initialization
crates/
├── core/ # Core agent, session, config, runtime types
├── session/ # SQLite session storage, branching, compaction
├── tools/ # Built-in tool implementations
├── provider/ # LLM provider integrations (Anthropic, OpenAI, Google, etc.)
├── hooks/ # Event types for extensions
├── plugin-host/ # JS/TS plugin discovery and runtime
├── tui/ # Terminal UI components and tui experience
└── cli/ # The `bb` binary — CLI, controller, TUI wiring
- Create a new module in
crates/tools/src/ - Implement the
Tooltrait (seecrates/tools/src/types.rs) - Register it in
crates/tools/src/registry.rs - Add tests
- Create a new module in
crates/provider/src/ - Implement the
Providertrait (seecrates/provider/src/traits.rs) - Add models to
crates/provider/src/registry/models/ - Wire it in
crates/cli/src/session_bootstrap.rs
Skills are just markdown files. Create ~/.bb-agent/skills/<name>/SKILL.md:
---
name: my-skill
description: What this skill does
---
Instructions for the agent...- Use GitHub Issues
- Include: OS, Rust version (
rustc --version), BB-Agent version (bb --version) - For bugs: steps to reproduce, expected vs actual behavior
By contributing, you agree that your contributions will be licensed under the MIT License.