Skip to content
UPG is in early alpha. The specification is still evolving and may change between versions.

@unified-product-graph/cli · v0.22.2

The upg command line

Scaffold, inspect, edit, validate and sync product graphs straight from the terminal and gate CI on graph health. 47 commands, zero config, reads and writes the same .upg files as the SDK and MCP server.

Install

$npm install -g @unified-product-graph/cli

Or run it without installing: npx @unified-product-graph/cli <command>.

60-second quick start

# Scaffold a graph (interactive, or pass --title to script it)
upg init

# Score its health, 0-100
upg health

# Validate structure (exits non-zero on violations, great in CI)
upg verify

Every command takes --help. Most reads support --json for scripting.

Run it with your AI

Gate CI on graph health

The CLI exits non-zero on policy violations, so it drops straight into CI. Rather than hand-writing the workflow, paste this into an AI assistant and it reads the exit-code contract and generates the job for any CI.

Add a Unified Product Graph health gate to my CI. Read https://unifiedproductgraph.org/cli/reference for the command list and the exit-code contract, then detect which CI I use (GitHub Actions, GitLab CI, and so on) and write a job that installs the CLI (npm install -g @unified-product-graph/cli) and runs `upg verify` and `upg health --min-score` on every pull request, failing the build on real policy violations but not on transient errors. Show me the workflow file and where to put it.

47 commands

Go deeper