ArchiLens reads your Git repository and generates layered C4-style architecture diagrams — automatically, using AST analysis and AI enrichment. No manual diagrams. No stale docs.
From a single CLI command to a full interactive viewer — ArchiLens covers the whole workflow.
Tree-sitter parses Python, JavaScript, TypeScript, Java, and Go at the AST level, with a regex fallback for other languages. Classes, functions, imports, and inheritance are extracted with line-level precision. Imports are then resolved to files per language — Python packages and src/ layouts, TypeScript path aliases and workspace packages, Java packages, Go modules — so dependency edges reflect real imports.
Optionally, Claude writes a one-line summary of each module from its classes and dependencies, so diagrams show what the code does, not just what it's named. Swap in any OpenAI-compatible provider.
Claude / OpenAI / OllamaGenerate diagrams as Mermaid, D2, or PlantUML. All formats support every level — L0 through L3 — so you can embed diagrams anywhere: GitHub, Confluence, Notion, or your own docs.
Mermaid · D2 · PlantUMLRun archilens serve for a dark-themed SPA. Click any module in the L1 diagram to drill straight into its L2 component view. Search, filter, and re-analyse without leaving the browser.
Point ArchiLens at your semver tags and watch your architecture grow over time. Detects module additions, removals, and LOC trends with a Mermaid timeline diagram and full markdown report.
archilens historyThe diff command compares architecture between any two Git refs without touching the working tree. The GitHub Action posts one architecture-diff comment per pull request and can fail the build on layer-skipping or fan-out rules — no API key needed.
Give Claude Code, Cursor and other MCP clients your architecture: which module owns a file, which capability a feature belongs to, and whether a new import breaks a rule — checked before the agent edits. Re-analyses as the code changes.
archilens serve-mcpReal Mermaid output from a sample microservices repo — no configuration required.
Modules detected automatically from directory structure and import analysis
Modules grouped by the business capabilities you declare, with optional one-line AI summaries
Dependency edges come from real import statements — not guesses
Click any node in the interactive viewer to drill into the next level
Each level zooms in further — start with the big picture and drill into any module.
Your system and its external actors — users, third-party services, databases. The 30,000-foot view.
All detected modules and the dependency edges between them, grouped by capability layer.
Classes, interfaces, and inheritance within a single module. Rendered as a class diagram.
Sequence diagrams for each detected process flow — request handling, async events, and more.
No sign-up. No API key required: without one, ArchiLens runs the full static analysis and skips AI enrichment (or pass --no-ai).
Works with Python 3.10+ on macOS, Linux, and Windows.
Point it at any Git repo — local or freshly cloned.
Open the interactive viewer or read the generated markdown diagrams.
ArchiLens is free, open source, and runs entirely on your machine.