Thanks to visit codestin.com
Credit goes to lib.rs

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

MIT license

55KB
1K SLoC

Vibe-Graph

Crates.io License: MIT

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.

image image image

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

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 Rule trait for custom evolution logic
  • ๐Ÿง  LLM-Powered Rules โ€” Use --features llm for 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