Skip to content

Latest commit

 

History

History

mermaid

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

mermaid: Mermaid Diagrams CLI

Render mermaid files to SVG or PNG on the CLI

Install

  • Install using homebrew:

    brew tap DavidGamba/dgtools https://github.com/DavidGamba/dgtools
    brew install DavidGamba/dgtools/mermaid
    Note

    Completion is auto setup for bash.

    For zsh completions, an additional step is required, add the following to your .zshrc:

    export ZSHELL="true"
    source "$(brew --prefix)/share/zsh/site-functions/dgtools.mermaid.zsh"

    Upgrade with:

    brew update
    brew upgrade mermaid
  • Install using go:

    Install the binary into your ~/go/bin:

    go install github.com/DavidGamba/dgtools/mermaid@latest

    Then setup the completion.

    For bash:

    complete -o default -C mermaid mermaid

    For zsh:

    export ZSHELL="true"
    autoload -U +X compinit && compinit
    autoload -U +X bashcompinit && bashcompinit
    complete -o default -C mermaid mermaid

Usage

  1. Read Mermaid file

    mermaid render <filename.mermaid> -o <filename.[svg|png]>
  2. Pipe Mermaid file to mermaid

    cat <filename.mermaid> | mermaid render -o <filename.[svg|png]>