KosmoKrator

rendering

Mermaid CLI for AI Agents

Use the Mermaid CLI from KosmoKrator to call Mermaid tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

1 functions 0 read 1 write No credentials auth

Mermaid CLI Setup

Mermaid can be configured headlessly with `kosmokrator integrations:configure mermaid`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure mermaid --enable --read allow --write ask --json
kosmokrator integrations:doctor mermaid --json
kosmokrator integrations:status --json

Runtime Requirements

Install these host dependencies before calling Mermaid locally.

NameTypeDescription
mmdc binary Mermaid CLI is required to render diagrams.

Credentials

Authentication type: No credentials none. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

No credentials are required.

Call Mermaid Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call mermaid.render_mermaid '{
  "syntax": "example_syntax",
  "title": "example_title",
  "width": 1,
  "theme": "example_theme"
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:mermaid render_mermaid '{
  "syntax": "example_syntax",
  "title": "example_title",
  "width": 1,
  "theme": "example_theme"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs mermaid --json
kosmo integrations:docs mermaid.render_mermaid --json
kosmo integrations:schema mermaid.render_mermaid --json
kosmo integrations:search "Mermaid" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Mermaid.

mermaid.render_mermaid

Write write

Render a Mermaid diagram to a PNG image. Pass valid Mermaid syntax and get back a markdown image embed. Supported diagram types: flowchart, sequence, class, state, ER, Gantt, pie, quadrant, requirement, git graph, C4, mindmap, timeline, sankey, XY chart, block. Example syntax: ``` graph TD A[Start] --> B{Decision} B -->|Yes| C[Action] B -->|No| D[End] ``` Tips: - Use `graph TD` for top-down flowcharts, `graph LR` for left-to-right - Use `sequenceDiagram` for sequence diagrams - Use `erDiagram` for entity-relationship diagrams - Use `classDiagram` for class diagrams - Use `stateDiagram-v2` for state diagrams - Use `gantt` for Gantt charts - Use `pie` for pie charts - Use `gitgraph` for git graphs - Use `mindmap` for mind maps

Parameters
syntax, title, width, theme

Generic CLI call

kosmo integrations:call mermaid.render_mermaid '{"syntax":"example_syntax","title":"example_title","width":1,"theme":"example_theme"}' --json

Provider shortcut

kosmo integrations:mermaid render_mermaid '{"syntax":"example_syntax","title":"example_title","width":1,"theme":"example_theme"}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

mermaid.render_mermaid

Render a Mermaid diagram to a PNG image. Pass valid Mermaid syntax and get back a markdown image embed. Supported diagram types: flowchart, sequence, class, state, ER, Gantt, pie, quadrant, requirement, git graph, C4, mindmap, timeline, sankey, XY chart, block. Example syntax: ``` graph TD A[Start] --> B{Decision} B -->|Yes| C[Action] B -->|No| D[End] ``` Tips: - Use `graph TD` for top-down flowcharts, `graph LR` for left-to-right - Use `sequenceDiagram` for sequence diagrams - Use `erDiagram` for entity-relationship diagrams - Use `classDiagram` for class diagrams - Use `stateDiagram-v2` for state diagrams - Use `gantt` for Gantt charts - Use `pie` for pie charts - Use `gitgraph` for git graphs - Use `mindmap` for mind maps

Operation
Write write
Schema command
kosmo integrations:schema mermaid.render_mermaid --json
ParameterTypeRequiredDescription
syntax string yes Mermaid diagram syntax. Must be valid Mermaid markup (e.g., starting with graph TD, sequenceDiagram, erDiagram, etc.).
title string no Diagram title used as alt text (default: "Diagram").
width integer no Output width in pixels (default: 1400, range: 100-4000).
theme string no Mermaid theme (default: 'default').

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.