Skip to content

CLI Overview

Use the Merfolk CLI to bring diagram work into scripts, repositories, and agent workflows.

The CLI is one way to work with the shared diagram workspace. Use it when diagram changes belong in a terminal workflow, a script, or a coding-agent task. Use the web app when people need to inspect the visual result, discuss it, or comment on the diagram itself.

Start here

Command structure

All Merfolk commands follow the pattern:

merfolk <command> [subcommand] [arguments] [flags]

Top-level commands:

Command Description
login Authenticate with your Merfolk account
logout Remove stored credentials
diagrams Create and manage Mermaid diagrams
skills Install agent skills

The --json flag

Every command that produces output supports --json. When passed, the CLI prints structured JSON to stdout instead of human-readable text.

Use --json for scripting, piping into jq, or calling from coding agents.

merfolk diagrams list --json

Output is always a valid JSON object or array. Errors are printed to stderr as JSON with an error key.

Exit codes

Code Meaning
0 Success
1 General error (see stderr)
2 Authentication required — run merfolk login
3 Not found — the requested resource does not exist
Navigation

Type to search…

↑↓ navigate↵ selectEsc close