graphize

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: MIT

README ΒΆ

Graphize

Go CI Go Lint Go SAST Go Report Card Docs Docs Visualization License

LLM-powered CLI for transforming polyglot codebases into queryable knowledge graphs.

Features

  • 🌍 Multi-Language Support - Go, Java, TypeScript, and Swift with extensible provider interface
  • πŸ“Š AST Extraction - Fast, deterministic extraction of functions, types, and relationships
  • πŸ€– LLM Enhancement - Optional semantic analysis to discover implicit dependencies
  • πŸ” Graph Queries - BFS/DFS traversal, path finding, community detection
  • πŸ“ˆ Analysis Reports - God nodes, surprising connections, corpus health, suggested questions
  • πŸ’‘ Node Explanation - Get context with community membership and centrality metrics
  • 🌐 MCP Server - Integrate with Claude Desktop and Claude Code
  • πŸ”Œ Platform Installers - One-command setup for Claude, Cursor, Copilot, Codex, Gemini, Aider
  • πŸ“€ Multiple Exports - HTML, TOON, JSON, GraphML, Neo4j Cypher, Obsidian vault
  • πŸ‘οΈ Watch Mode - Auto-rebuild graph on file changes
  • πŸ”— Git Hooks - Automatic analysis on commit/checkout
  • πŸ“ Doc Extraction - Link markdown/text documentation to code entities

Quick Start

# Build
go build -o graphize ./cmd/graphize

# Initialize a new graph database
graphize init

# Add your repository (Go, Java, TypeScript, Swift)
graphize add .

# Extract the graph (AST-based)
graphize analyze

# Generate an analysis report
graphize report

# Export interactive visualization
graphize export html -o graph.html

Two-Step Extraction

Graphize provides a two-step extraction pipeline:

  1. Deterministic AST extraction - Fast, reproducible, always available
  2. LLM semantic extraction - Optional, adds inferred relationships and rationale
# Step 1: AST extraction
graphize analyze

# Step 2: Prepare for LLM (optional)
graphize enhance --json > files.json

# Step 3: Merge LLM results
graphize merge -i agents/graph/semantic-edges.json

CLI Commands

Command Description
graphize init Initialize graph database
graphize add <repo> Track a repository
graphize status Show tracked sources
graphize analyze Extract AST-based graph
graphize enhance Prepare for LLM extraction
graphize merge Merge semantic edges
graphize query Query the graph
graphize path <A> <B> Find shortest path between nodes
graphize explain <node> Get node context with community and centrality
graphize report Generate analysis report
graphize report --health Assess corpus health and graph value
graphize benchmark Show token reduction statistics
graphize watch Auto-rebuild on file changes
graphize hook install Install git hooks
graphize install <platform> Install AI assistant integrations
graphize export html Cytoscape.js visualization
graphize export htmlsite Multi-page documentation site
graphize export obsidian Obsidian vault with wikilinks
graphize export cypher Neo4j Cypher statements
graphize serve Start MCP server

MCP Server Integration

Integrate with Claude Desktop or Claude Code:

{
  "mcpServers": {
    "graphize": {
      "command": "graphize",
      "args": ["serve", "-g", "/path/to/.graphize"]
    }
  }
}

Output Formats

Format Use Case
TOON Agent-friendly, token-efficient (default)
JSON Machine-readable, full fidelity
HTML Interactive Cytoscape.js visualization
HTML Site Multi-page documentation site with per-service graphs
GraphML Import into Gephi, yEd, Cytoscape desktop
Cypher Neo4j CREATE statements
Obsidian Wiki-style vault with wikilinks

Storage

Uses GraphFS for git-friendly storage:

.graphize/
β”œβ”€β”€ manifest.json      # Tracked sources
β”œβ”€β”€ nodes/             # One file per node
β”œβ”€β”€ edges/             # One file per edge
└── cache/             # Per-file extraction cache

Documentation

Full documentation at plexusone.github.io/graphize

License

MIT

Directories ΒΆ

Path Synopsis
cmd
graphize command
Package main provides the graphize CLI.
Package main provides the graphize CLI.
graphize/cmd
Package cmd provides the CLI commands for graphize.
Package cmd provides the CLI commands for graphize.
pkg
analyze
Package analyze provides graph analysis functions.
Package analyze provides graph analysis functions.
cache
Package cache provides per-file caching for graph extraction results.
Package cache provides per-file caching for graph extraction results.
exporters/cypher
Package cypher generates Neo4j Cypher statements from graph data.
Package cypher generates Neo4j Cypher statements from graph data.
exporters/graphml
Package graphml provides GraphML format export for code graphs.
Package graphml provides GraphML format export for code graphs.
exporters/htmlsite
Package htmlsite generates multi-page HTML documentation sites from graph data.
Package htmlsite generates multi-page HTML documentation sites from graph data.
exporters/obsidian
Package obsidian generates Obsidian vault exports from graph data.
Package obsidian generates Obsidian vault exports from graph data.
extract
Package extract provides Go AST extraction for building knowledge graphs.
Package extract provides Go AST extraction for building knowledge graphs.
extract/golang
Package golang provides Go language extraction for knowledge graphs.
Package golang provides Go language extraction for knowledge graphs.
extract/java
Package java provides Java extraction for knowledge graphs.
Package java provides Java extraction for knowledge graphs.
extract/markdown
Package markdown provides Markdown/text extraction for knowledge graphs.
Package markdown provides Markdown/text extraction for knowledge graphs.
extract/swift
Package swift provides Swift extraction for knowledge graphs.
Package swift provides Swift extraction for knowledge graphs.
extract/systemspec
Package systemspec provides system-spec extraction for knowledge graphs.
Package systemspec provides system-spec extraction for knowledge graphs.
extract/typescript
Package typescript provides TypeScript/JavaScript extraction for knowledge graphs.
Package typescript provides TypeScript/JavaScript extraction for knowledge graphs.
metrics
Package metrics provides utilities for measuring and formatting metrics.
Package metrics provides utilities for measuring and formatting metrics.
output
Package output provides formatters for CLI output.
Package output provides formatters for CLI output.
platform
Package platform provides installers for integrating graphize with AI coding platforms.
Package platform provides installers for integrating graphize with AI coding platforms.
query
Package query provides graph query utilities and result formatting.
Package query provides graph query utilities and result formatting.
source
Package source manages multi-repo source tracking with git commit awareness.
Package source manages multi-repo source tracking with git commit awareness.
Package provider defines the public interface for language extractors.
Package provider defines the public interface for language extractors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL