Run dgmo from code
1.Install
macOS
brew install diagrammo/dgmo/dgmoArch Linux
Adds the Diagrammo package repository, so dgmo updates with the rest of your system. Remove it any time with sudo pacman -R diagrammo-keyring.
curl -LO https://github.com/diagrammo/dgmo/releases/download/arch-repo/diagrammo-keyring.pkg.tar.zst &&
sudo pacman -U ./diagrammo-keyring.pkg.tar.zst &&
sudo pacman -Syu dgmoOmarchy
Same as Arch, except the last step. Omarchy refuses a direct pacman -Syu and asks you to use omarchy update, so this only refreshes the package list. Keep the system itself current with omarchy update as usual.
curl -LO https://github.com/diagrammo/dgmo/releases/download/arch-repo/diagrammo-keyring.pkg.tar.zst &&
sudo pacman -U ./diagrammo-keyring.pkg.tar.zst &&
sudo pacman -Sy dgmoLinux, Windows, or anywhere with Node
npm install -g @diagrammo/dgmo-cli1.Install
npm install @diagrammo/dgmo2.Render
import { render } from '@diagrammo/dgmo';
const { svg } = await render(`pie Browser Market Share (2025)
Chrome 63.5
Safari 19.8
Firefox 6.2
Edge 5.1
Other 5.4`);
document.getElementById('chart').innerHTML = svg;Produces
1.Install
<!-- Drop this in your <head>; that's the whole install. -->
<script
src="https://cdn.jsdelivr.net/npm/@diagrammo/dgmo-standalone@0.85.0 <1/dist/element.js"
crossorigin="anonymous"
></script>2.Render
<dgmo-diagram palette="nord">
pie Browser Market Share (2025)
Chrome 63.5
Safari 19.8
Firefox 6.2
Edge 5.1
Other 5.4
</dgmo-diagram>Already rendering markdown, or have <pre class="dgmo"> blocks? Auto-convert them instead — no custom tag required:
<script
src="https://cdn.jsdelivr.net/npm/@diagrammo/dgmo-standalone@0.85.0 <1/dist/auto.js"
crossorigin="anonymous"
></script><pre class="dgmo">pie Browser Market Share (2025)
Chrome 63.5
Safari 19.8
Firefox 6.2
Edge 5.1
Other 5.4</pre>Produces
Open files in the desktop app
The same brew install diagrammo/dgmo/dgmo also installs adiagrammo command for launching the Diagrammo desktop app from your terminal. macOS only.
diagrammo . # open the current directory as the workspace
diagrammo foo.dgmo # open a .dgmo file
diagrammo notes.md # open a markdown file
diagrammo # just launch the appIf Diagrammo.app isn't installed,diagrammo foo.dgmo falls back to opening the file as a share link in the web editor atonline.diagrammo.app.