Development Setup
Prerequisites
- Rust 1.85 or later
- Cargo (comes with Rust)
Building
# Development build
cargo build
# Release build
cargo build --release
Testing
cargo test
Quality Checks
# Format check
cargo fmt --check
# Lint check
cargo clippy -- -D warnings
# All quality checks
cargo check
Workspace Structure
cerebro/
├── crates/
│ ├── cerebro/ # CLI tool
│ ├── cerebro-core/ # Shared types
│ ├── cerebro-mcp/ # MCP server
│ └── cerebro-tui/ # Terminal UI
├── docs/ # Documentation
└── book.toml # mdbook config
Running Locally
# Build and run
cargo run -- build
# With arguments
cargo run -- build --project my-project
MCP Server
The MCP server lives in crates/cerebro-mcp/ and provides tools for OpenCode integration.
Building
cargo build --release -p cerebro-mcp
The binary is output to target/release/cerebro-mcp.
Running
# Via cargo
cargo run -p cerebro-mcp
# Or directly
./target/release/cerebro-mcp
Environment Variables
| Variable | Default | Description |
|---|---|---|
CORTEX_PATH | (required) | Path to your cortex (contains config.toml) |
RUST_LOG | info | Log level (debug, info, warn, error) |