brigid-cli
The brigid command-line tool: deconstruct a codebase into an AI-generated tutorial.
brigid crawls a codebase, identifies its core abstractions via an LLM map/reduce pipeline, and produces a multi-chapter Markdown + Mermaid tutorial explaining how the system works: setup, architecture, and inter-concept relationships. Built for monorepos and large codebases where "read the source" is not a realistic onboarding path.
This is the only binary crate in the brigid workspace. The business logic
lives in the companion library crates (brigid-core, brigid-crawl,
brigid-pipeline). Both the pipeline and the CLI use
llm-kernel directly for LLM calls
(OpenAIClient, CacheClient). brigid-cli is a thin wrapper that parses
arguments, wires the pipeline, and maps errors to exit codes.
Install
# cargo install
# cargo-binstall (pre-built Linux binary, compiles from source on macOS/Windows)
Or download the Linux binary from GitHub Releases.
Verify: brigid --version
Quick start
# 1. Set your LLM API key (DeepSeek is the default provider)
# 2. Generate a tutorial from any codebase
# 3. Open the result
The tutorial is plain Markdown with Mermaid diagrams — render it in any Markdown viewer (GitHub, VS Code, Obsidian).
No API key? Set
BRIGID_FORCE_MOCK=1to run the full pipeline with a mock LLM client for offline testing.
Common commands
See brigid --help and brigid <command> --help for all options.
Project context
brigid-cli is one crate in the brigid workspace:
brigid-core— pure domain types and logicbrigid-crawl— filesystem and GitHub repository crawlingbrigid-pipeline— stage orchestration, checkpoint/resume, dry-run planningbrigid-cli— this crate: thebrigidbinary
LLM provider calls go through llm-kernel
(OpenAIClient, CacheClient), an external workspace dependency.
All crates are developed together in a single repository: https://github.com/igmarin/brigid.
For the full guide, diagrams, and development docs, see the main brigid README.
License
This project is licensed under the MIT License. See LICENSE.