Skip to main content

Berkelium CLI — TUI for code graph management.

Project description

Berkelium CLI

PyPI Version PyPI Downloads License MCP Compatible

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.

Quick Start

Installation

# Install
pip install berkelium

# Run the TUI
berkelium-cli

Development Setup

git clone https://github.com/BerkeliumLabs/berkelium-cli
cd berkelium-cli
uv sync

TUI Features

The 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.

MCP Server (for AI Assistants)

Connect Berkelium to Claude, Cursor, or any MCP-compatible client to give your AI "graph-vision" over your code.

Configuration (Claude)

Add this to your settings.json:

{
  "mcpServers": {
    "berkelium": {
      "command": "berkelium-mcp",
    }
  }
}

Available Tools

  • query_search_codebase: Executes read-only Cypher queries directly against the code graph for advanced structural search.

Available Prompts

  • review_my_pr: A guided workflow that syncs the graph, identifies changes via git, and suggests targeted tests based on impact analysis.

Usage Examples (AI-Assisted Development)

Berkelium is most powerful when used through an AI assistant (like Claude or Cursor). Here are some real-world scenarios where it excels:

1. Architectural Exploration

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_codebase with a Cypher query like:
    MATCH (child)-[:INHERITS]->(parent) WHERE parent.name = 'BaseProvider' RETURN child.name AS name, child.file_rel_path AS file
    

2. Tracing Complex Call Chains

Prompt: "Trace the execution flow starting from IncrementalSync.sync(). What internal methods does it reach?"

  • AI Action: Uses query_search_codebase to traverse the [:CALLS] edges.

3. Identifying Dead Code

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_codebase to find nodes with zero incoming [:CALLS] edges.

Architecture

  • Extractor (extractor.py): Language-agnostic extraction using tree-sitter.
  • Store (store.py): Persistence layer using GraphQLite on SQLite.
  • Sync (sync.py): Git-based incremental synchronization logic.
  • Retriever (retriever.py): Graph traversal algorithms for impact and context.

License

MIT License - see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

berkelium-0.1.1.tar.gz (224.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

berkelium-0.1.1-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file berkelium-0.1.1.tar.gz.

File metadata

  • Download URL: berkelium-0.1.1.tar.gz
  • Upload date:
  • Size: 224.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for berkelium-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0e10de1eaca3d14aa6a27688e44d09a3acb95b2ad619db99c4c8295b56c80e7
MD5 9b8dc55ba6b680e4afcba028a5c9ea82
BLAKE2b-256 8dfa59a511c04b059b24472dde3ce937f04eb7ef13e54f61d697f8f914581816

See more details on using hashes here.

File details

Details for the file berkelium-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: berkelium-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for berkelium-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54f744d5455ce5e2218504122845496d3c518701771c33c1980eca78da7ea0e1
MD5 3aa4eb8179d0530134cfe029e7c3d839
BLAKE2b-256 111961db145352a985d93a83cd8b3e581dae67079645017a5b2bd9cd45c201a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page