Berkelium CLI is a Code Graph Management tool and Model Context Protocol (MCP) server. It uses tree-sitter to parse your codebase into a structured graph stored in SQLite, enabling high-fidelity impact analysis and surgical context retrieval for AI assistants.
# Install
pip install berkelium
# Run the TUI
berkelium-cligit clone https://github.com/BerkeliumLabs/berkelium-cli
cd berkelium-cli
uv syncThe Berkelium TUI (berkelium-cli) provides a terminal interface for:
- Build/Update Graph: Index supported languages (Python, JS/TS, Go, Java, Rust, C/C++).
- Incremental Sync: Uses git-diff to update the graph in milliseconds.
- Exploration: Visualize symbols and relationships directly in your terminal.
Connect Berkelium to Claude, Cursor, or any MCP-compatible client to give your AI "graph-vision" over your code.
Add this to your settings.json:
{
"mcpServers": {
"berkelium": {
"command": "berkelium-mcp",
}
}
}query_search_codebase: Executes read-only Cypher queries directly against the code graph for advanced structural search.
review_my_pr: A guided workflow that syncs the graph, identifies changes via git, and suggests targeted tests based on impact analysis.
Berkelium is most powerful when used through an AI assistant (like Claude or Cursor). Here are some real-world scenarios where it excels:
Prompt: "I want to add a new database provider. Show me all classes that inherit from BaseProvider to see the existing pattern."
- AI Action: Uses
query_search_codebasewith a Cypher query like:MATCH (child)-[:INHERITS]->(parent) WHERE parent.name = 'BaseProvider' RETURN child.name AS name, child.file_rel_path AS file
Prompt: "Trace the execution flow starting from IncrementalSync.sync(). What internal methods does it reach?"
- AI Action: Uses
query_search_codebaseto traverse the[:CALLS]edges.
Prompt: "Are there any functions in the utils/ directory that are never called by any other part of the project?"
- AI Action: Uses
query_search_codebaseto find nodes with zero incoming[:CALLS]edges.
- Extractor (
extractor.py): Language-agnostic extraction usingtree-sitter. - Store (
store.py): Persistence layer usingGraphQLiteon SQLite. - Sync (
sync.py): Git-based incremental synchronization logic. - Retriever (
retriever.py): Graph traversal algorithms for impact and context.
MIT License - see LICENSE.