2. Monorepo structure with four crates
Date: 2026-04-22
Status
Accepted
Context
Cerebro needs to support multiple use cases: command-line tool usage for building dashboards, library usage for other tools, OpenCode MCP integration, and an interactive terminal UI for browsing project data.
Decision
This project uses a Rust workspace with four crates:
- cerebro: command-line tool, the main binary
- cerebro-core: Shared types, traits, collectors, and queries, the library crate
- cerebro-mcp: MCP server for OpenCode integration, a binary crate
- cerebro-tui: Ratatui terminal UI for interactive browsing, a binary crate
Consequences
Pros
- Clear separation between command-line tool, library, MCP, and Terminal User Interface concerns
- other tools can use cerebro-core as a library
- Each crate can evolve independently
- Terminal User Interface shares types with command-line tool, ensuring consistency across delivery surfaces
Cons
- Workspace complexity
- More build artifacts to manage
Notes
See crates/ directory for actual structure.