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.
Install
Homebrew
bash
brew install diagrammo/dgmo/dgmo npx (no install)
bash
npx @diagrammo/dgmo input.dgmo Usage
Render to PNG
bash
dgmo diagram.dgmo -o diagram.png Render to SVG with a palette
bash
dgmo diagram.dgmo -o diagram.svg --palette catppuccin Pipe from stdin
bash
echo 'chart: pie\nCats: 40\nDogs: 60\n' | dgmo -o sample.png Flags
| 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).