Skip to main content

Export Your Code Graph with vg export

vg export outputs your code map in JSON, GraphML, Graphviz DOT, Neo4j Cypher, Markdown, HTML, or SBOM formats. Use --format and --out to target downstream tools and visualization.

Difficulty
Intermediate
Duration
15 minutes
Steps
5

Your code graph is most useful when you can feed it into other tools — a Neo4j database, a Graphviz render, or a Markdown doc. vg export outputs the code map in a range of formats.

Prerequisites

  • A built code graph from vg build

Steps

1. Build the graph

vg build

2. Export the graph

vg export

vg export writes the code map. Supported formats include JSON, GraphML, Graphviz DOT, Neo4j Cypher, Markdown, HTML, CycloneDX SBOM, and SPDX.

3. Pick a format

Choose the format with --format:

vg export --format graphml

Use DOT for Graphviz rendering, Cypher to load into Neo4j, or JSON for custom tooling.

4. Write to a file

Send the output to a file with --out:

vg export --format graphml --out graph.graphml

5. Load it downstream

Load the exported artifact into your target tool — render a DOT file with Graphviz, import Cypher into Neo4j, or publish the Markdown export as documentation.

Verification

Confirm the exported file exists and is non-empty in the format you chose. Opening it in the target tool (Graphviz, Neo4j, a Markdown viewer) should render your graph.

Next Steps

  • Embed the graph for fast queries with vg embed
  • Share the graph with your team using vg share
  • Generate AI facts with vg facts

Prerequisites

  • A built code graph (vg build)

Steps

  • 1
    Build the graph
  • 2
    Export the graph
  • 3
    Pick a format
  • 4
    Write to a file
  • 5
    Load it downstream

Category

Vibgrate