This reference helps you produce and consume JSON output from the Vibgrate CLI. It is for developers building scripts, dashboards, or custom integrations on top of scan results. For a comparison of all formats, see the Output Formats guide.
Producing JSON
JSON is one of the four output formats Vibgrate supports (Text, JSON, SARIF, and Markdown). Request it from a scan:
vg scan --format json
Write it to a file for later processing instead of printing to the terminal:
vg scan --format json --out scan.json
The vg report command can also render JSON from existing scan artifacts:
vg report --format json
What JSON gives you
JSON output is the machine-readable view of the same results you see in the text summary, including the DriftScore (0-100) and the findings that drive it. Because it is structured, it is the right choice when another program needs to read the results — for example, to post a summary comment, populate an internal dashboard, or gate a deployment.
Consuming JSON safely
- Treat fields you do not recognize as optional; consume the values you need and ignore the rest.
- Read the DriftScore for a single headline number, and iterate findings for detail.
- Prefer writing to a file with
--outin CI so multiple steps can read the same artifact.
JSON vs. SARIF
Use JSON for your own tooling and dashboards. Use SARIF when integrating with code-scanning surfaces that understand the SARIF standard, such as GitHub code scanning. See the SARIF output reference for that path.
Exporting the code map as JSON
Separately from scans, Vibgrate Graph can export the code map itself as JSON:
vg export --format json
This is a different artifact from scan output — it represents your code graph rather than drift findings.
Related
- Output Formats guide
- SARIF output reference
- The
vg scanandvg reportcommand pages