Skip to content

Edit

Update the content or title of an existing Mermaid diagram.

Usage

merfolk diagrams edit <id> [flags]

Arguments

Argument Description
id The diagram ID to edit (required)

Flags

Flag Description
--content <mermaid> New Mermaid source
--title <title> New title
--json Output result as JSON

Examples

# Update content
merfolk diagrams edit abc123 --content "graph TD\n  A --> B --> C"

# Update title only
merfolk diagrams edit abc123 --title "Updated architecture"

# Pipe content from a file
cat updated.mmd | merfolk diagrams edit abc123

# Update and confirm with JSON output
merfolk diagrams edit abc123 --content "graph TD\n  A --> B" --json

Output

Default output confirms the update:

Updated diagram abc123
View at: https://app.merfolk.io/d/abc123

With --json:

{
  "id": "abc123",
  "title": "My architecture",
  "updatedAt": "2024-01-15T11:00:00Z",
  "url": "https://app.merfolk.io/d/abc123"
}

Exit codes

Code Meaning
0 Diagram updated
2 Not authenticated
3 Diagram not found
1 Update failed
Navigation

Type to search…

↑↓ navigate↵ selectEsc close