This release is a pre-release and may not be stable for production use.
Buddhi AI CLI
Buddhi AI CLI turns a codebase into what an AI coding agent actually needs: a code graph (files, directories, classes, functions/methods, and their containment/import/call relationships, via tree-sitter), a Model Context Protocol (MCP) server for topology-aware code search and compressed reading, a scaffolded Google Antigravity agent harness grounded in that graph, and a full Spec-Driven Development (SDD) lifecycle based on open standards like AGENTS.md.
The idea: point Buddhi AI CLI at a project, and it gives Antigravity:
- A workspace MCP Server (
buddhi-mcp) exposing:buddhi_search— Community-aware, topology-driven code graph search across lexical anchors and bridge nodes.buddhi_read— AST-pruned, entropy-filtered, token-budget-aware file reading (auto,signatures,map,entropy,full).
- A full Spec-Driven Development (SDD) workflow:
/specify— Scaffold feature branch and refinespec.mdwith prioritized, testable user stories./plan— Synthesize architectural design intoplan.mdvia domain specialists andAGENTS.mdcompliance checks./tasks— Generate a phased, story-oriented task breakdown intotasks.mdwith[P]parallelism markers./implement— Execute tasks with prerequisite validation and live progress tracking intasks.md./verify— Evidence-based test execution mapping results to specification acceptance criteria (SDD convergence mode).
- A
/quick-planworkflow for lightweight, non-SDD multi-specialist planning. - A
/document-codebaseworkflow that generates dependency-aware OKF symbol documentation. - Specialized
/debug,/remember, and/statusworkflows for systematic root-cause investigation, persistent memory capture, and harness dashboarding. - Domain specialist agents (frontend, backend, database, testing, security, deployment, git) and
terminal-runnerfor delegated command execution.
Supported languages: Python, JavaScript, TypeScript/TSX, Go, Rust, C#, Java, Kotlin, Swift.
Installation
Requires Python 3.10+.
pip install "buddhi-ai[mcp]"
Or, if you prefer an isolated tool install:
pipx install "buddhi-ai[mcp]"
# or
uv tool install "buddhi-ai[mcp]"
This installs both the buddhi CLI command and the buddhi-mcp Stdio server entrypoint.
Usage
buddhi init — full setup (recommended)
buddhi init [path]
Scans path (defaults to the current directory), builds the code graph,
computes a documentation plan, scaffolds the root AGENTS.md, and prepares the Antigravity agent harness.
Writes:
AGENTS.md— standard project instructions, dev commands, and architecture rules at the project root (created if not already present).buddhi/graphs/tree-graph.json— the graph in Cytoscape.js elements format.buddhi/graphs/tree-graph.db— a SQLite database (nodes/edgestables, indexed for recursive CTE traversal — ancestor/descendant lookups, call-graph walks).buddhi/graphs/tree-graph.html— an interactive Cytoscape.js visualization (loads Cytoscape.js from a CDN; open in a browser with internet access).buddhi/docs-plan.json— a bottom-up, staleness-aware plan of what needs documenting.agents/mcp_config.json— workspace MCP server configuration registeringbuddhi-mcpwith Antigravity IDE.agents/— the Antigravity agent harness (agents, workflows, rules, skills, templates, memory index — see below). Idempotent: rerunninginitnever overwrites a harness file you've already edited under.agents/, it only fills in what's missing.
A .buddhi/.gitignore (ignoring graphs/ and docs/) is created on first
run so generated artifacts don't get committed to your project's own repo.
Next step printed at the end: open the project in Antigravity, run
/document-codebase, and start a feature with /specify.
buddhi mcp — Model Context Protocol server
buddhi mcp [--db-path <path>]
# or run the dedicated entrypoint directly:
buddhi-mcp [--db-path <path>]
Runs the Buddhi Model Context Protocol (MCP) server over StdIO, allowing AI coding agents to dynamically query the code graph and read compressed files:
buddhi_search: Topology-aware codebase search. Uses lexical anchors, expands into community neighborhoods, filters boilerplate using Shannon entropy, and sorts results using a U-curve positional layout within a token/character budget.buddhi_read: Dynamic, AST-pruned file reading with multiple compression modes (auto,signatures,map,entropy,full) and token-budget awareness to prevent context window saturation.
The MCP server auto-detects .buddhi/graphs/tree-graph.db in the workspace root or parent directories and is scoped per-workspace with zero port conflicts.
buddhi generate — update / refresh code graph
buddhi generate [path]
Scans path and rebuilds all three graph artifacts under .buddhi/graphs/ (tree-graph.json, tree-graph.db, tree-graph.html) without modifying .buddhi/docs-plan.json or .agents/.
Use this whenever the codebase grows or changes to update the SQLite graph database queried by the Buddhi MCP server (buddhi_search and buddhi_read).
buddhi docs plan — refresh documentation plan
buddhi docs plan [path]
Recomputes .buddhi/docs-plan.json against the current source tree without touching .agents/ or overwriting existing graph files. This detects newly added or modified source files and marks stale OKF docs for (re)generation. This is what /document-codebase and /plan Antigravity workflows call automatically before planning.
[!TIP] Rerunning
buddhi init: You can also rerunbuddhi initat any time to refresh both the graph and the documentation plan in one step.buddhi initis fully idempotent: it never overwrites your existing or customized files in.agents/orAGENTS.md.
buddhi sdd — Spec-Driven Development CLI helpers
buddhi sdd <command> [options]
Underlying helper commands used by the SDD workflows:
buddhi sdd create <description>— Create a new feature directory under.buddhi/specs/<branch>/, create branch name, and instantiatespec.mdfrom template.buddhi sdd setup-plan— Set upplan.mdfor the active feature branch fromplan-template.md.buddhi sdd setup-tasks— Verify prerequisites and output task resolution context fortasks.md.buddhi sdd check— Consolidated prerequisite checker supporting--require-tasks,--include-tasks,--paths-only, and--json.buddhi sdd resolve-template <name>— Resolve and compose templates across.agents/templates/and built-in defaults.
The Antigravity agent harness
buddhi init scaffolds .agents/ with:
workflows//specify— Initialize a new feature branch, scaffold.buddhi/specs/<branch>/spec.md, and iteratively refine requirements into prioritized, independently testable user stories (P1,P2...)./plan— Spec-Driven Development architecture workflow: verifiesspec.md, resolvesplan-template.md, dispatches domain specialists in parallel, checksAGENTS.mdcompliance, and synthesizes.buddhi/specs/<branch>/plan.md./tasks— Break downspec.mdandplan.mdinto actionable, phased tasks organized by user story intotasks.mdwith[P]parallelism markers./implement— Enforce prerequisite checks (spec.md+plan.md+tasks.md) and execute tasks story by story, tracking completion directly intasks.md./verify— Repurposed verification workflow: runs real build/lint/test commands viaterminal-runnerand maps evidence to user story acceptance criteria (SDD convergence mode), with fallback to general verification for ad-hoc changes./quick-plan— Lightweight implementation planning for requests that do not require full SDD branching/spec overhead./document-codebase— Generate or refresh OKF symbol documentation bottom-up./debug— Systematic bug investigation producing a confirmed root cause and concrete fix plan without modifying code./remember— Capture user preferences, project conventions, and technical decisions into memory./status— Dashboard of harness state (docs staleness, active plans, memory size, git branch).
mcp_config.json— Auto-connects Antigravity to the workspace'sbuddhi-mcpserver so agents have direct access tobuddhi_searchandbuddhi_read.templates/— Standard templates for specifications (spec-template.md), implementation plans (plan-template.md), task lists (tasks-template.md), review checklists (checklist-template.md), and agent configurations (agents-template.md).agents/— Read-only specialist subagents (backend-specialist,frontend-specialist,database-specialist,testing-specialist,security-specialist,deployment-specialist,git-specialist) dispatched in parallel by/planand/quick-plan, plusterminal-runnerfor delegated shell/build/test execution.rules/— Always-on conventions: consult.buddhi/docs/and Buddhi MCP code graph tools before raw source, require confirmation before destructive commands, read/append to the memory index for durable decisions.hooks.json/hooks/guard_destructive.py— APreToolUsehook that mechanically denies destructive commands (force-push,reset --hard,DROP/TRUNCATE, disk-format commands, etc.) as a safety backstop.skills/—okf-context(how to read OKF docs and use Buddhi MCP code graph toolsbuddhi_searchandbuddhi_read),repoagent-doc-generation(how to write docs),system-design(an architecture/trade-off decision framework used during planning), and custom skill slots (see.agents/skills/README.md).memory/MEMORY.md— A structured index into topic files under.agents/memory/(user-preferences.md,project-conventions.md,tech-decisions.md,feedback-history.md).
Documentation format
Generated docs under .buddhi/docs/ follow the
Open Knowledge Format (OKF): one concept file per
module/class/function, each carrying frontmatter that names its source file
and line range, a content hash for staleness detection, and a status. The
bottom-up generation order — document a symbol only after everything it
depends on is already documented — is inspired by the
RepoAgent paper's approach to
whole-repository, dependency-aware documentation.
Notes on accuracy
Import and call resolution is best-effort, not a full semantic analysis:
same-project relative imports and same-file/self./this. calls are
resolved to real nodes; everything else (external packages, ambiguous
cross-file calls, ...) becomes an external placeholder node so the graph
stays informative without producing false edges.
Contributing
The sections below are for working on Buddhi AI CLI itself, not for using it.
Setup
uv sync
Once dependencies are installed, run the CLI from source with uv run,
e.g. uv run buddhi init [path], instead of the plain buddhi command shown
above.
Development
uv run pytest
uv run ruff check src tests
uv run mypy src
Publishing
Releases to PyPI are handled by the publish.yml
GitHub Actions workflow. It builds the package with uv build and publishes it
using PyPI trusted publishing (OIDC),
so no API token is stored in the repository.
The workflow triggers on any pushed tag matching v* (e.g. v0.1.0). To cut a
release:
- Bump
versioninpyproject.toml. - Commit the change and tag it to match, e.g.:
git commit -am "Bump version to 0.1.1" git tag v0.1.1 git push origin main v0.1.1
- The tag push triggers the workflow, which builds and publishes the package to PyPI automatically.
This requires a trusted publisher to be configured once on PyPI for the
buddhi-ai project, pointing at this repository, the publish.yml workflow
file, and the pypi environment.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file buddhi_ai-1.0.0b10.tar.gz.
File metadata
- Download URL: buddhi_ai-1.0.0b10.tar.gz
- Upload date:
- Size: 76.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3982db1bf1feecafbef99ea34c84e2aa3c6654824238f03acb6cb71c8db3604
|
|
| MD5 |
bfb6b527047cf39e951375441bd37bac
|
|
| BLAKE2b-256 |
f4711fc9dec9880c7f0cb799fa688b86b10246cf66671cfe2c46ddd01d4910ee
|
Provenance
The following attestation bundles were made for buddhi_ai-1.0.0b10.tar.gz:
Publisher:
publish.yml on Buddhilive/buddhi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
buddhi_ai-1.0.0b10.tar.gz -
Subject digest:
a3982db1bf1feecafbef99ea34c84e2aa3c6654824238f03acb6cb71c8db3604 - Sigstore transparency entry: 2626065597
- Sigstore integration time:
-
Permalink:
Buddhilive/buddhi-cli@9d3f6b364af6d8ad64e796d6131233179cba2924 -
Branch / Tag:
refs/tags/v1.0.0-beta.10 - Owner: https://github.com/Buddhilive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9d3f6b364af6d8ad64e796d6131233179cba2924 -
Trigger Event:
push
-
Statement type:
File details
Details for the file buddhi_ai-1.0.0b10-py3-none-any.whl.
File metadata
- Download URL: buddhi_ai-1.0.0b10-py3-none-any.whl
- Upload date:
- Size: 118.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f057d5a94409fc0f34fc5a599c049cea2c1642a0dc3dd7c152a3c653665a6d2
|
|
| MD5 |
f4aa5d539edb24a761fdaab3058dff9f
|
|
| BLAKE2b-256 |
b20cef6dcc4a093098c5ceb1e2593be4af6be46d9ad705275c3aaee091017a43
|
Provenance
The following attestation bundles were made for buddhi_ai-1.0.0b10-py3-none-any.whl:
Publisher:
publish.yml on Buddhilive/buddhi-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
buddhi_ai-1.0.0b10-py3-none-any.whl -
Subject digest:
1f057d5a94409fc0f34fc5a599c049cea2c1642a0dc3dd7c152a3c653665a6d2 - Sigstore transparency entry: 2626065612
- Sigstore integration time:
-
Permalink:
Buddhilive/buddhi-cli@9d3f6b364af6d8ad64e796d6131233179cba2924 -
Branch / Tag:
refs/tags/v1.0.0-beta.10 - Owner: https://github.com/Buddhilive
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9d3f6b364af6d8ad64e796d6131233179cba2924 -
Trigger Event:
push
-
Statement type: