gitdiagram README

The project's README from github.com/ahmedkhaleel2004/gitdiagram. As one markdown file: README.md.

GitDiagram

Visualize any codebase: turn any public or private GitHub repository into an interactive architecture diagram, or watch it explained in a one-minute narrated video. AI agents can use it too, through the MCP server or the Markdown version of any diagram (gitdiagram.com/owner/repo.md).

Try GitDiagram → · Or replace hub with diagram in any GitHub repository URL.

GitDiagram front page

License Ko-fi

Ad space · Advertise your product here.

New: explainer videos

GitDiagram can now turn a repository into a narrated video of about a minute. The video starts with what the project is for and what people do with it, then shows briefly how its main parts fit together and one decision under the hood.

Watch GitDiagram explain itself in a minute

Features

Use GitDiagram from AI agents

GitDiagram is a remote MCP server at https://gitdiagram.com/mcp (no key or sign-in). Agents can read a public repository's architecture explanation, components, connections and Mermaid source, search the stored diagrams, and get explainer videos.

Add to Claude Install in Cursor Install in VS Code Install in VS Code Insiders

# Claude Code: the plugin adds the MCP server and a /gitdiagram skill
claude plugin marketplace add ahmedkhaleel2004/gitdiagram
claude plugin install gitdiagram@gitdiagram
# ...or just the MCP server
claude mcp add --transport http gitdiagram https://gitdiagram.com/mcp

# Codex
codex mcp add gitdiagram --url https://gitdiagram.com/mcp

# Gemini CLI
gemini extensions install https://github.com/ahmedkhaleel2004/gitdiagram

# GitHub Copilot CLI
copilot mcp add --transport http gitdiagram https://gitdiagram.com/mcp

In other clients (ChatGPT, Windsurf, Zed, LM Studio, Goose and more), add a remote MCP server with the URL https://gitdiagram.com/mcp. Then ask something like "how is fastapi/fastapi structured?".

Run locally

Requires Bun, Cloudflare R2, Upstash Redis, and an OpenAI or OpenRouter API key. See the setup guide for prerequisites and configuration.

git clone https://github.com/ahmedkhaleel2004/gitdiagram.git
cd gitdiagram
bun install
cp .env.example .env

Fill in .env using the configuration guide, then start the app:

bun run dev

Open localhost:3000.

Explainer videos are off by default. To turn them on, set VIDEO_EXPLAINER_ENABLED=1, NEXT_PUBLIC_VIDEO_EXPLAINER=1, ANTHROPIC_API_KEY, OPENAI_API_KEY and OPENROUTER_API_KEY (for the voice) in .env. See .env.example for the other video settings.

Development

Built with Next.js, React, TypeScript, Tailwind CSS, and Mermaid. Videos use Claude or GPT for the script and scenes and OpenRouter (Gemini 3.8 Flash TTS) for the voice. Deployed on Cloudflare Workers.

Contributions are welcome. Open an issue or pull request with a focused description and verification notes.

Inspired by Romain Courtois's Gitingest.

gitdiagram (ahmedkhaleel2004/gitdiagram)

Searching Database…

What is this?GitDiagram turns any public or private GitHub repository into an interactive architecture diagram in seconds. You can also replace 'hub' with 'diagram' in any GitHub URL to open its diagram.
Is this a website I visit, or something I have to install?It's a web app — nothing to install. It converts the repository tree and README into a system-level graph of components and edges rather than drawn folders, and every node links to its real source on GitHub.
How do I get a diagram for a repository, and what happens under the hood?Swap 'hub' for 'diagram' in any GitHub URL. It fetches the repo tree and README via the GitHub API, streams a plain-English architecture explanation, then renders a validated interactive Mermaid graph.
Do I need my own OpenAI API key to use it?Not on the hosted site: OpenAI is used by default (OpenRouter for self-hosted) and a complimentary quota is included. Local development needs more — at minimum R2, Upstash, and one AI provider in .env.
Does it work on every repository, or are there limits?Yes: truncated trees and oversized inputs are rejected before model work begins, and generation must fit a 300-second Vercel function budget.
Can I run GitDiagram on my own server instead of the hosted site?Vercel is the only live runtime, but the repo keeps a recovery recipe: the same Next.js app builds into a minimal non-root Docker image for Railway via the checked-in Dockerfile and railway.json.
Can it diagram private repositories, and what happens to my GitHub token?Yes — pick Private Repos and provide a fine-grained GitHub personal access token. It travels only with the same-origin request, is never embedded in public links, and private artifacts get a separate R2 namespace.
How does it stop the AI from producing broken or wrong diagrams?Model output is validated before you see it: the server checks identifiers, graph connectivity, limits and every linked path against the actual repository, retrying invalid output with focused feedback, and the browser renders sanitized Mermaid in strict security mode.
Do I trigger a fresh AI run every time I reopen a diagram?No. Successful artifacts are persisted to Cloudflare R2 — keyed by repository, with private ones in a separate namespace — so later visits reopen the saved diagram without another model call.
What can I actually do with the finished diagram?Click any component to open its real file or directory on GitHub, copy the Mermaid source, or download the rendered diagram as a PNG.
What is GitDiagram built with?Next.js 16 App Router, React 19, TypeScript, Tailwind CSS and Radix UI, with generation endpoints on Vercel's Bun runtime. Cloudflare R2 stores artifacts, Upstash Redis handles quotas and locks, and the AI provider is OpenAI or OpenRouter.
Size
14.7 MB
Stars
19K
Updated
CommitNov 17
Age
1y
Commits · 90 Days