Development marketplace for LeanKG knowledge graph plugin
npx claudepluginhub freepeak/leankgLightweight knowledge graph for AI-assisted development. Impact analysis, code search, dependency tracking, and context generation.
Official prompts.chat marketplace - AI prompts, skills, and tools for Claude Code
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations
Claude Code plugins for the Slidev presentation framework
Share bugs, ideas, or general feedback.
Lightweight Knowledge Graph for AI-Assisted Development
LeanKG is a local-first knowledge graph that gives AI coding tools accurate codebase context. It indexes your code, builds dependency graphs, generates documentation, and exposes an MCP server so tools like Cursor, OpenCode, and Claude Code can query the knowledge graph directly. No cloud services, no external databases -- everything runs on your machine with minimal resources.
graph LR
subgraph "Without LeanKG"
A1[AI Tool] -->|Scans entire codebase| B1[10000+ tokens]
B1 --> A1
end
subgraph "With LeanKG"
A2[AI Tool] -->|13-42 tokens| C[LeanKG Graph]
C -->|Targeted subgraph| A2
end
Without LeanKG: AI scans entire codebase, wasting tokens on irrelevant context.
With LeanKG: AI queries the knowledge graph for targeted context only.
Install the LeanKG binary, configure MCP, and add agent instructions for your AI coding tool:
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- <target>
This installs:
~/.local/binSupported targets:
| Target | AI Tool | MCP Config | Agent Instructions |
|---|---|---|---|
opencode | OpenCode AI | ~/.config/opencode/opencode.json | ~/.config/opencode/AGENTS.md |
cursor | Cursor AI | ~/.cursor/mcp.json | ~/.cursor/AGENTS.md |
claude | Claude Code/Desktop | ~/.config/claude/settings.json | ~/.config/claude/CLAUDE.md |
gemini | Gemini CLI / Google Antigravity | ~/.config/gemini-cli/mcp.json / ~/.gemini/antigravity/mcp_config.json | ~/.gemini/GEMINI.md |
kilo | Kilo Code | ~/.config/kilo/kilo.json | ~/.config/kilo/AGENTS.md |
Examples:
# Install for OpenCode
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- opencode
# Install for Cursor
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- cursor
# Install for Claude Code
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- claude
# Install for Gemini CLI
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- gemini
# Install for Kilo Code
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- kilo
# Install for Google Antigravity
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- antigravity
cargo install leankg
leankg --version
git clone https://github.com/your-org/LeanKG.git
cd LeanKG
cargo build --release
Use GitHub Codespaces to try LeanKG in your browser - no installation required!
leankg index ./src
leankg web
Free tier: 60 hours/month (3 months), then 15 hours/month
Try LeanKG without installing - visit the live demo at https://leankg.onrender.com
To update LeanKG to the latest version, run the same install command:
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- update
This will replace the existing binary with the latest release while preserving your configuration.
# 1. Initialize LeanKG in your project
leankg init
# 2. Index your codebase
leankg index ./src
# 3. Start the MCP server (for AI tools)
leankg serve
# 4. Start the Web UI (for visualization)
# Open http://localhost:8080 in your browser
leankg web
# 5. Compute impact radius for a file
leankg impact src/main.rs --depth 3
# 6. Check index status
leankg status