Machine-readable graph data in a standard format for custom tools and CI pipelines.
graphify run ./my-project --format json
# Generates graph.json with complete graph structureThe JSON format generates graph.json containing:
- Nodes — All extracted entities (classes, functions, modules, concepts)
- Edges — All relationships (calls, references, imports, semantic connections)
- Metadata — Communities, confidence scores, extraction sources
- Statistics — Node and edge counts, community breakdown
{
"nodes": [
{
"id": "userrepository",
"label": "UserRepository.cs",
"type": "Entity",
"community": 4,
"file_path": "samples/mini-library/src/UserRepository.cs",
"confidence": "EXTRACTED",
"metadata": {
"source_location": "L1"
}
}
],
"edges": [
{
"source": "userservice",
"target": "userrepository",
"relationship": "calls",
"weight": 1,
"confidence": "EXTRACTED",
"metadata": {
"merge_count": "1",
"source_file": "samples/mini-library/src/UserService.cs"
}
}
],
"metadata": {
"node_count": 47,
"edge_count": 79,
"community_count": 7,
"generated_at": "2026-04-07T02:14:03Z"
}
}Nodes:
id— Unique identifier (e.g., "userrepository", "userservice_getbyid")label— Display name (e.g., "UserRepository.cs", "GetById()")type— Node type (e.g., Entity, Class, Function, Module, File, Concept)community— Integer community ID (null if unassigned)file_path— Source file pathlanguage— Programming language (if detected)confidence— Extraction confidence ("EXTRACTED", "INFERRED", "AMBIGUOUS")metadata— Optional key-value pairs (source_location, merge_count, etc.)
Edges:
source— Source node IDtarget— Target node IDrelationship— Type of relationship (calls, references, imports, extends, implements, contains, semantic, inferred)weight— Numeric edge weight (e.g., number of references between same nodes)confidence— Extraction confidence ("EXTRACTED", "INFERRED", "AMBIGUOUS")metadata— Optional key-value pairs (merge_count, source_file, etc.)
Metadata:
node_count— Total number of nodes in the graphedge_count— Total number of edges in the graphcommunity_count— Number of detected communitiesgenerated_at— ISO 8601 timestamp of when the graph was generated
// C# example
var json = System.IO.File.ReadAllText("graph.json");
var graph = System.Text.Json.JsonSerializer.Deserialize<GraphData>(json);
foreach (var node in graph.Nodes)
{
Console.WriteLine($"{node.Id}: {node.Label}");
}// JavaScript example
const graph = await fetch('graph.json').then(r => r.json());
console.log(`Graph has ${graph.metadata.node_count} nodes`);# Python example
import json
with open('graph.json') as f:
graph = json.load(f)
for node in graph['nodes']:
print(f"{node['id']}: {node['label']}")# Extract just node names
jq '.nodes[].label' graph.json
# Find all nodes in a specific community
jq '.nodes[] | select(.community == 0)' graph.json
# List all external imports
jq '.edges[] | select(.relationship == "imports")' graph.json# GitHub Actions example
- name: Analyze graph
run: |
graphify run ./src --format json
jq '.nodes | length' graph.json # node count
jq '.metadata.community_count' graph.json # community countBuild custom visualizations using D3.js, Three.js, Cytoscape.js, or any tool that accepts JSON:
<script src="https://cdnjs.cloudflare.com/ajax/libs/cytoscape.js/3.24.0/cytoscape.min.js"></script>
<script>
const graph = await fetch('graph.json').then(r => r.json());
const cy = cytoscape({
container: document.getElementById('cy'),
elements: [
...graph.nodes.map(n => ({ data: { id: n.id, label: n.label } })),
...graph.edges.map(e => ({ data: { source: e.source, target: e.target } }))
]
});
</script>- Custom tooling — Build your own analysis and visualization
- CI/CD integration — Automated graph generation and metrics
- Data science — Load into Pandas, NetworkX, or R for analysis
- API integration — Feed graph data to other systems
- Reproducibility — Store as machine-readable source of truth
Query the JSON to find circular dependencies, unused modules, or tightly coupled components.
Extract node counts, community sizes, and average degree to track codebase growth.
Use jq or custom scripts to assert that certain nodes don't connect across community boundaries.
Feed graph.json to Claude, ChatGPT, or Copilot as context for code review or refactoring suggestions.
- Files up to 10,000 nodes typically <5 MB
- Load time is linear with node count
- Compression: gzip reduces size by ~70% (minimal impact on parsing)
- Worked Example — Real output from a C# project walkthrough
- Export Formats Overview
- HTML Interactive Viewer — Visual exploration of the same data
- Neo4j Cypher Export — For advanced graph queries and databases