3 releases (breaking)
| 0.3.0 | Jan 2, 2026 |
|---|---|
| 0.2.0 | Dec 24, 2025 |
| 0.1.0 | Dec 18, 2025 |
#123 in Visualization
Used in 4 crates
55KB
1K
SLoC
Vibe-Graph
A local-first neural OS for software projects, where specs, code, and collaboration live in one evolving systemโwith Git as the fossil record.
Vibe-Graph maintains a living SourceCodeGraph that captures structure, relationships, and historical vibes (human + machine intents). It scans your codebase, detects cross-file references, and provides interactive visualizationโall running locally.
Quick Start
# Install
cargo install vibe-graph-cli
# Analyze your codebase
cd your-project
vg sync
# Build the dependency graph
vg graph
# Launch interactive visualization
vg serve
# Open http://localhost:3000
# Start MCP Server for AI Agents
vg serve --mcp
Features
- ๐ค Model Context Protocol (MCP) โ Native MCP server for AI agents to semantically explore code
- โก GPU Acceleration โ WebGPU-powered Barnes-Hut layout for large graphs (>10k nodes)
- ๐ Auto-detection โ Recognizes single repos, multi-repo workspaces, or plain directories
- ๐ SourceCodeGraph โ Builds a graph of files, directories, and cross-file references
- ๐ Interactive Visualization โ D3.js or embedded egui/WASM graph explorer
- ๐พ Local-first Persistence โ All data stored in
.self/folder, works offline - ๐ Documentation Generation โ Export markdown or JSON from your codebase structure
- ๐ GitHub Integration โ Clone and analyze entire organizations
Installation
From crates.io (recommended)
cargo install vibe-graph-cli
From source
git clone https://github.com/pinsky-three/vibe-graph
cd vibe-graph
make build
# Binary at: target/release/vg
Commands
| Command | Description |
|---|---|
vg sync |
Analyze workspace, save to .self/ |
vg sync <org> |
Clone and analyze entire GitHub org |
vg sync <owner/repo> |
Clone and analyze single GitHub repo |
vg graph |
Build SourceCodeGraph with reference detection |
vg serve |
Interactive visualization at localhost:3000 |
vg serve --mcp |
Start Model Context Protocol server for AI agents |
vg compose |
Generate markdown documentation |
vg status |
Show workspace and cache status |
vg clean |
Remove .self/ folder |
vg remote show |
Show configured remote (auto-detected for single repos) |
vg remote add <org> |
Set GitHub org as remote for workspaces |
vg remote list |
List repos from configured remote |
vg remote clone |
Clone all repos from configured remote |
vg config show |
Display current configuration |
Sync Options:
--cacheโ Clone to global cache instead of current directory--ignore <repo>โ Skip specific repos when syncing an org--snapshotโ Create timestamped snapshot
Run vg --help for full command reference.
๐ค Model Context Protocol (MCP)
Vibe-Graph acts as a Semantic Intelligence Layer for your AI agents (Claude, Cursor, etc.). By running the MCP server, you give your agents "eyes" to see the codebase structure.
Capabilities:
- Gateway Mode: Serve multiple local projects from a single endpoint.
- Impact Analysis: Ask "what breaks if I touch
User.rs?" -> Returns sorted list of dependents (ranked by centrality). - Semantic Search: Find files by concept/module rather than just regex.
- Context Awareness: Get the "neighborhood" of a file (imports + usage) in one shot.
Graph Visualization
The serve command provides an interactive force-directed graph with REST + WebSocket API:
vg sync && vg serve
Features:
- ๐จ egui WASM visualization โ Interactive graph explorer with pan/zoom
- โก GPU Layout โ High-performance WebGPU compute for massive graphs
- ๐ก Live git status โ Change indicators on modified files (auto-refresh via WebSocket)
- ๐ PageRank Sizing โ Nodes sized by structural importance
- ๐ REST API โ Programmatic access to graph data
API Endpoints
| Endpoint | Description |
|---|---|
GET /api/health |
Health check |
GET /api/graph |
Full graph (nodes + edges + metadata) |
GET /api/graph/nodes |
All nodes |
GET /api/graph/edges |
All edges |
GET /api/git/changes |
Current git change snapshot |
WS /api/ws |
WebSocket for live updates |
Build Variants
| Build | Command | Visualization |
|---|---|---|
| Minimal | make build |
D3.js fallback |
| Full | make build-full |
egui WASM (offline-capable) |
Architecture
vibe-graph/
โโโ crates/
โ โโโ vibe-graph-core # Domain model: graphs, nodes, edges, references
โ โโโ vibe-graph-automaton # Temporal state evolution & rule-driven automaton
โ โโโ vibe-graph-cli # CLI entry point (vg command)
โ โโโ vibe-graph-api # REST + WebSocket API (Axum-based)
โ โโโ vibe-graph-mcp # Model Context Protocol server implementation
โ โโโ vibe-graph-viz # egui/WASM visualization
โ โโโ vibe-graph-git # Git status and fossilization
โ โโโ ... # Additional crates (ssot, semantic, llmca, etc.)
โโโ frontend/ # TypeScript/Vite host for WASM visualization
Graph Automaton (vibe-graph-automaton)
The automaton crate enables temporal state evolution on graphsโa foundation for "vibe coding" where code structure evolves over time via rule-driven transitions.
use vibe_graph_automaton::{GraphAutomaton, Rule, StateData, TemporalGraph};
// Each node tracks: history: Vec<(rule, state)>, current: (rule, state)
let mut automaton = GraphAutomaton::new(temporal_graph)
.with_rule(Arc::new(MyRule));
// Evolve the graph
automaton.tick()?;
Features:
- ๐ฐ๏ธ Temporal State โ Each node maintains full transition history
- ๐ Pluggable Rules โ Implement
Ruletrait for custom evolution logic - ๐ง LLM-Powered Rules โ Use
--features llmfor AI-driven state transitions via Rig - ๐ฎ Examples โ Conway's Game of Life (deterministic & LLM-powered)
# Run Game of Life example
cargo run --example game_of_life -p vibe-graph-automaton
# LLM-powered version (requires API key)
export OPENAI_API_URL="https://openrouter.ai/api/v1"
export OPENAI_API_KEY="sk-or-..."
export OPENAI_MODEL_NAME="anthropic/claude-3.5-sonnet"
cargo run --example llm_game_of_life -p vibe-graph-automaton --features llm
The .self Folder
Analysis results persist in .self/:
.self/
โโโ manifest.json # Workspace metadata
โโโ project.json # Full analysis data
โโโ graph.json # SourceCodeGraph with references
โโโ snapshots/ # Historical snapshots
Add .self/ to your .gitignore.
Configuration
| Environment Variable | Description |
|---|---|
GITHUB_TOKEN |
GitHub PAT for org commands |
GITHUB_USERNAME |
GitHub username (for authenticated clones) |
VG_MAX_CONTENT_SIZE_KB |
Max file size to include content (default: 50) |
RUST_LOG |
Log level (e.g., info, tower_http=info) |
Configuration is stored in ~/.config/vibe-graph/config.toml. Use vg config show to view.
Development
# First-time setup
make setup
# Development (two terminals)
make dev-api # Terminal 1: API server on :3000
make dev-frontend # Terminal 2: Vite dev server on :5173
# Or with tmux
make dev-all
# Run native egui app (for local debugging)
make ui-dev
Build Commands
make check # Check all crates compile
make build # Build minimal CLI (D3.js fallback)
make build-wasm # Build WASM to frontend/public/wasm/
make build-full # Full production build (frontend + CLI)
Quality
make test # Run all tests
make lint # Clippy
make fmt # Format code
make ci # Full CI checks (fmt + lint + test + typecheck)
Status
This is early-stage research code. Expect rapid iteration, incomplete features, and evolving abstractions. The core graph analysis and visualization are functionalโuse them to explore your codebases.
License
MIT
Dependencies
~15MB
~307K SLoC