Diagram CLI — render from the terminal
Pipe a .dgmo file through dgmo and get a PNG or SVG. Open-source CLI for scripts, CI pipelines, and Makefiles.
One of Diagrammo's tools: CLInpm LibraryMCP ServerObsidianAI Integrations
Install
Homebrew
brew install diagrammo/dgmo/dgmonpx (no install)
npx @diagrammo/dgmo input.dgmoUsage
Render to PNG
dgmo diagram.dgmo -o diagram.pngRender to SVG with a palette
dgmo diagram.dgmo -o diagram.svg --palette catppuccinPipe from stdin
echo 'pie\nCats 40\nDogs 60\n' | dgmo -o sample.pngFlags
| Flag | Description |
|---|---|
| -o, --output | Output file path. Extension determines format (.png, .svg, .html) |
| --theme | Color theme: light, dark, transparent |
| --palette | Color palette: nord, catppuccin, dracula, solarized, monokai, gruvbox, tokyonight, rosepine |
| --width | Chart width in pixels (default: 800) |
| --height | Chart height in pixels (default: 600) |
Frequently asked questions
How do I install the dgmo CLI?
Install via Homebrew with "brew install diagrammo/dgmo/dgmo", or run without installing using "npx @diagrammo/dgmo". Both methods work on macOS, Linux, and Windows.
Can I use dgmo in CI/CD pipelines?
Yes. The dgmo CLI is designed for automation. Use "npx @diagrammo/dgmo" in GitHub Actions, GitLab CI, or any CI environment with Node.js. Pipe DGMO markup via stdin or pass .dgmo files directly.
What output formats does dgmo support?
The CLI exports to SVG, PNG, and HTML. The output format is determined by the file extension in the -o flag (e.g., -o diagram.svg for SVG, -o diagram.png for PNG).