Generate Mermaid diagrams from natural language using AI, rendered to PNG.
git clone https://github.com/AlexandrLo/mermaid-agent
cd mermaid-agent
make install
cp config.toml.example config.toml
# set api.key in config.tomlRequires Python 3.10+ and Node.js 18+.
mermaid-agent -p "Create a Gantt chart for a web development project"
mermaid-agent -p "Sequence diagram for OAuth2 login" -o auth.pngconfig.toml is loaded from ./config.toml or ~/.config/mermaid-agent/config.toml.
| Field | Description |
|---|---|
api.key |
API key |
api.base_url |
API base URL |
api.model |
Model name (default: gpt-4.1-mini) |
agent.max_retries |
Retries on invalid output (default: 3) |
agent.system_prompt |
System prompt sent to the model |