cli-anything-mermaid
できること
このスキルは、AIエージェントがMermaid形式でフローチャートやシーケンス図などの図を作れるようにします。テキストから分かりやすい図を作りたい人向けです。
使う場面
- ✓処理や判断の流れを示すフローチャートを作りたいとき。
- ✓人やシステム間で受け渡されるメッセージを示すシーケンス図が必要なとき。
- ✓既存の図ファイルを変更し、その新しい画像を描画したいとき。
スキルのリンク
https://github.com/HKUDS/CLI-Anything/blob/main/mermaid/agent-harness/cli_anything/mermaid/skills/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“顧客の注文が、依頼から配達までどう進むかを示すフローチャートを作ってください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは図をテキストとして書き、プロジェクトファイルに保存します。そしてオンラインの描画サービスを通じて、描画された画像へのリンクを作ります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
cli-anything-mermaid
Create, edit, and render Mermaid diagrams via stateful project files and the mermaid.ink renderer. Designed for AI agents and power users who need to generate flowcharts, sequence diagrams, and other visualizations without a GUI.
Installation
This CLI is installed as part of the cli-anything-mermaid package:
pip install cli-anything-mermaid
Prerequisites:
- Python 3.10+
- No external software required (rendering uses mermaid.ink cloud service)
Usage
Basic Commands
# Show help
cli-anything-mermaid --help
# Start interactive REPL mode
cli-anything-mermaid
# Create a new project
cli-anything-mermaid project new -o diagram.json
# Run with JSON output (for agent consumption)
cli-anything-mermaid --json project info
REPL Mode
When invoked without a subcommand, the CLI enters an interactive REPL session:
cli-anything-mermaid
# Enter commands interactively with tab-completion and history
Command Groups
Project
Project lifecycle commands.
| Command | Description |
|---|---|
new |
Create a new Mermaid project with optional sample preset and theme |
open |
Open an existing Mermaid project file |
save |
Save the current project to a file |
info |
Show current project information |
samples |
List available sample diagram presets |
Diagram
Diagram source manipulation commands.
| Command | Description |
|---|---|
set |
Replace the Mermaid source text (inline or from file) |
show |
Print the current Mermaid source code |
Export
Render and share commands.
| Command | Description |
|---|---|
render |
Render the diagram to SVG or PNG via mermaid.ink |
share |
Generate a Mermaid Live Editor URL for sharing |
Session
Session state commands.
| Command | Description |
|---|---|
status |
Show current session state |
undo |
Undo the last diagram source change |
redo |
Redo the last undone change |
Examples
Create and Render a Flowchart
# Create a project with flowchart sample
cli-anything-mermaid project new --sample flowchart -o flow.json
# Replace diagram source
cli-anything-mermaid --project flow.json diagram set --text "graph TD; A-->B; B-->C;"
# Render to SVG
cli-anything-mermaid --project flow.json export render output.svg --format svg
Create a Sequence Diagram
# Create project with sequence sample
cli-anything-mermaid project new --sample sequence -o seq.json
# Set diagram from file
cli-anything-mermaid --project seq.json diagram set --file my_diagram.mmd
# Render to PNG
cli-anything-mermaid --project seq.json export render output.png --format png
Share a Diagram
# Generate an editable Mermaid Live URL
cli-anything-mermaid --project flow.json export share --mode edit
# Generate a view-only URL
cli-anything-mermaid --project flow.json export share --mode view
Interactive REPL Session
cli-anything-mermaid
# new flowchart
# set graph TD; A-->B; B-->C;
# render output.svg
# share
# quit
State Management
The CLI maintains session state with:
- Undo/Redo: Revert or replay diagram source changes
- Project persistence: Save/load project state as JSON
- Session tracking: Track modifications and changes
Output Formats
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (
--jsonflag): Structured JSON for agent consumption
# Human output
cli-anything-mermaid project info
# JSON output for agents
cli-anything-mermaid --json project info
For AI Agents
When using this CLI programmatically:
- Always use
--jsonflag for parseable output - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use absolute paths for all file operations
- Verify outputs exist after render operations
More Information
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
Version
1.0.0
よくある質問
図を手で描く必要がありますか?
いいえ。手順を普通の言葉で説明すれば、エージェントが図のテキストを書いてくれます。
描画に追加のソフトは必要ですか?
いいえ。描画にはクラウドサービスを使うため、Python以外の追加ソフトは必要ないとされています。
図を保存して後で変更できますか?
はい。図はプロジェクトファイルに保存され、後から開いて編集できます。
詳細
作者による元の説明
Command-line interface for Mermaid Live Editor - Create, edit, and render Mermaid diagrams via stateful project files and mermaid.ink renderer URLs. Designed for AI agents and power users who need to generate flowcharts, sequence diagrams, and other visualizations without a GUI.
repo: HKUDS/CLI-Anything
人気
- GitHubのスター
- 58k
- ランキング
- #3223
- ライセンス
- Apache-2.0
- 更新日
- 2026/9/21
コメント
- …
このリポジトリの他のスキル
cli-anything-3mf
58kエージェントが3Dプリントのファイルを調べて直せるようにします。丸い穴を見つける、そのサイズを変える、メッシュを修復する、2つのファイルを比べることができます。
cli-anything-qgis
58kエージェントがターミナルからQGISのマッププロジェクトを開き、編集し、書き出せるようにします。レイヤー、フィーチャー、印刷レイアウト、処理ツールを含みます。
cli-anything-adguardhome
58kエージェントがAdGuard Homeを管理できるようにします。AdGuard Homeはネットワーク全体で広告を遮断するツールで、フィルター、DNSの書き換え、クライアント、クエリのログを扱います。
cli-anything-anygen
58kエージェントが、AnyGenのサービスを使って、書かれたプロンプトからスライド、文書、ウェブサイト、図を生成できるようにします。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。