from @unified-product-graph/cli · Graph
upg fmt
Rewrite .upg files to canonical form (byte-stable, diff-friendly).
Install
npm install -g @unified-product-graph/cliUsage
upg fmt [files...] [options]Arguments
[files...]- Paths to .upg files. Defaults to the discovered .upg file.
Options
--check- Do not write; exit non-zero if any file is not already canonical. For CI.
Examples
Format the discovered .upg file in place
upg fmtFormat every graph in the workspace
upg fmt .upg/*.upgCI gate: fail if any file is not canonical
upg fmt --check .upg/*.upgOutput
1 file(s) not in canonical form: .upg/threadline.upg Run `upg fmt` to fix.
Branch and merge .upg files like any other file. The $upg header holds derived data (counts, integrity checksum), so on a header conflict take either side and let fmt reseal it from the body. Merges that produce no conflict at all can still leave the header stale, which is what fmt --check catches in CI.
git merge feature-branch && upg fmt .upg/*.upg