How to make diagrams in Gemini CLI
Ask Gemini CLI (Google’s coding agent in the terminal) for a diagram in plain words and it draws one. On its own, the result stays in the chat or in a file only you can open. Connect Diagram once, and every diagram Gemini CLI makes is saved at a link you can share, which stays current as the diagram changes. It takes three steps.
1. Connect Diagram to Gemini CLI
Run this in a terminal, in your repo. It connects Diagram and starts Gemini CLI:
gemini mcp remove -s user diagram ; gemini mcp add -s user --transport http diagram https://diagram.la/mcp ; gemini -i "Set up Diagram for this repo, then ask me what to draw. If you don't have the Diagram tools, tell me the connection didn't work."
Sign in once: When Gemini first connects, a browser tab opens: sign in to Diagram and click Allow.
2. Ask Gemini CLI for a diagram
In Gemini CLI, then describe what you want in plain words. For example:
- “Draw how the services in this repo talk to each other.”
- “Diagram what happens when a user signs up, step by step.”
- “Show the database tables and how they relate.”
- “Make a diagram of this script’s steps so I can explain it to my team.”
Gemini CLI draws it, saves it to Diagram as a draft only you can see, and gives you a link. Keep the link open: when you ask for a change, the page updates by itself. Nothing is left in a local file you’d have to remember to upload, and you never have to mention Diagram again: it knows to use it.
3. Publish it and share the link
When it looks right, tell Gemini CLI to publish it. It asks first and says who will be able to see it: the people on its project. Then paste the link in Slack, a pull request, or a doc. To change it later, ask Gemini CLI: the link stays the same and every version is kept.