Aesthetic diagrams,
straight from
the code.

v0.10.1MITmacOS · Linux · Windows

No boxes to drag, no lines to route. Your agent reads the code and archgram draws the diagram: one SVG, light and dark, with the flows animated.

npx skills add byabas/archgram
A coding agent with tools A chat sends the question to the agent, which reasons with Claude and calls its tools: search_docs reads a Qdrant index of the docs, query_db reads the Postgres warehouse and run_code runs in a Docker sandbox. Every night a Python script embeds the docs with Mistral into the index. indexing the docs: docs/ → ingest.py → Embeddings → Docs index. a question: Chat → Agent → search_docs, query_db → Docs index, Warehouse. trying the fix: Chat → Agent → run_code. think AGENT LOOP NIGHTLY Chat React Agent plans and calls tools Claude reasoning search_docs query_db run_code sandbox Docs index Warehouse docs/ Markdown ingest.py Embeddings External

01The spec

Start with words, not boxes.

Everything archgram draws comes from one small YAML file: the parts of your system, what calls what, and the way a request goes through it. It lives beside the code and is reviewed like it. Or skip writing it: give the skill to your agent, and watch it write the spec from your code while you finish your coffee.

npx skills add byabas/archgram

  • nodeswhat runs or is stored, with its kind and logo
  • frameswhat runs together
  • edgeswhat calls or reads what
  • flowsthe way a request goes
linkshort.archgram.yaml
archgram: 1title: linkshortdescription: >-  The API creates short links and redirects. A redirect reads the URL from  the Redis cache, falls back to Postgres on a miss, adds the click to a  Redis stream and returns. A worker drains the stream in batches and adds  the counts to Postgres, where the stats route reads them.nodes:  - { id: browser, kind: browser, label: Visitor }  - { id: api, kind: service, label: API, note: "FastAPI, port 8000", tech: fastapi }  - { id: cache, kind: cache, label: URL cache, note: "1-day TTL", tech: redis, frame: redis }  - { id: clicks, kind: queue, label: Click stream, tech: redis, frame: redis }  - { id: worker, kind: service, label: Worker, note: up to 500 per read }  - { id: postgres, kind: database, label: links, note: source of truth, tech: postgresql }frames:  - { id: redis, label: Redis }edges:  - { from: browser, to: api }  - { from: api, to: cache }  - { from: api, to: postgres, label: on a miss, style: dashed }  - { from: api, to: clicks }  - { from: clicks, to: worker }  - { from: worker, to: postgres }flows:  - { name: a visit, steps: [browser, api, clicks, worker, postgres] }

02Layout

Every part in its place.

No dragging, no lining things up. archgram puts every part in order, the way a request travels through them, left to right or top to bottom if you prefer. Parts that run together share a frame.

linkshort The API creates short links and redirects. A redirect reads the URL from the Redis cache, falls back to Postgres on a miss, adds the click to a Redis stream and returns. A worker drains the stream in batches and adds the counts to Postgres, where the stats route reads them. on a miss REDIS Visitor API FastAPI, port 8000 URL cache 1-day TTL Click stream Worker up to 500 per read links source of truth

03Routing

Lines go around, never through.

Every line finds its own way around the cards, with soft rounded bends. A dashed line marks a step that happens only sometimes.

linkshort The API creates short links and redirects. A redirect reads the URL from the Redis cache, falls back to Postgres on a miss, adds the click to a Redis stream and returns. A worker drains the stream in batches and adds the counts to Postgres, where the stats route reads them. on a miss REDIS Visitor API FastAPI, port 8000 URL cache 1-day TTL Click stream Worker up to 500 per read links source of truth

04Flows

Then the request moves.

Name the steps a request takes, and archgram plays them inside the SVG itself. No script and no player, so it moves wherever an image shows, in a GitHub README, on npm, on any page. As the arrow reaches a card, its border draws itself in.

The API creates short links and redirects. A redirect reads the URL from the Redis cache, falls back to Postgres on a miss, adds the click to a Redis stream and returns. A worker drains the stream in batches and adds the counts to Postgres, where the stats route reads them. a visit: Visitor → API → Click stream → Worker → links.The API creates short links and redirects. A redirect reads the URL from the Redis cache, falls back to Postgres on a miss, adds the click to a Redis stream and returns. A worker drains the stream in batches and adds the counts to Postgres, where the stats route reads them. a visit: Visitor → API → Click stream → Worker → links.

05Refused at the gate

A flow can be told no.

One line in the spec shows where a flow gets turned away. A ✕ lands at the step that says no, the refusal travels back to where it started, and the card stays red until a flow gets through and turns it green.

Scroll to play it forward and back.

Orders behind a sign-in The browser asks the API for the user's orders. Before anything is read, the API has Clerk check the request's session. A request without a session is refused at the session check and the refusal goes back to the browser; signed in, it passes to the orders service, which reads the orders from Postgres. a request without a session: Browser → API → Session, refused at Session. signed in, it goes through: Browser → API → Session → Orders → Postgres. check signed in Browser the shop API GET /orders Session is the user signed in? Orders the user's orders Postgres orders check check signed in External

06Light, dark, your colours

One file, both themes.

The same SVG carries light and dark, and follows the reader's system. Need a file for each? archgram writes both.

Match it to your design system. Bring your tokens and archgram draws in your colours, and tells you when two of them are too close to read.

linkshort drawn in the light theme.
light
linkshort drawn in the dark theme.
dark

—Samples

No retouching, no mockups. Each drawing is one small spec, drawn by archgram. Open it under the drawing and copy it to try yourself.

—Install

Install it, then just ask.

One line gives archgram to your agent, and from then on a diagram is one sentence away.

npx skills add byabas/archgram
terminal~/linkshort

In a terminal, npx skills add byabas/archgram adds archgram for your agents. Asked “Draw this project's architecture with archgram.”, the agent reads the code, writes linkshort.archgram.yaml and draws linkshort.svg, in light and dark.

Every command, in the docs

—Questions

Asked before.

Pick a question and ask. More in the spec and the README.

what-is

archgram is an open-source CLI tool for software architecture diagrams. Write a YAML or JSON spec, or let Claude Code, Codex, Cursor or Gemini CLI draw one from your code. It writes one self-contained SVG that follows light and dark mode and animates the path a request takes. The file drops into a GitHub README or any docs page, and the animation plays wherever an image shows.

what-is

archgram is an open-source CLI tool for software architecture diagrams. Write a YAML or JSON spec, or let Claude Code, Codex, Cursor or Gemini CLI draw one from your code. It writes one self-contained SVG that follows light and dark mode and animates the path a request takes. The file drops into a GitHub README or any docs page, and the animation plays wherever an image shows.

github-readme

Yes. The flows are animated with SMIL inside the SVG, which needs no script, so the drawing moves in an <img>: in a GitHub README, on npm and in any docs page.

dark-mode

One SVG carries both themes and follows the reader's system setting. To follow GitHub's own theme instead, draw with --split-themes and put the two files in a <picture> with prefers-color-scheme.

offline

No. archgram is one native binary, and the SVG is self-contained: no script, no external file, no web font, so it shows the same wherever it is opened.

vs-mermaid

Mermaid draws many kinds of diagram from text and is rendered by the page that shows it; GitHub renders it in Markdown. archgram draws two kinds, the architecture of a system and the sequence of one request, into an SVG file ahead of time: it routes the lines around the cards, animates the flows and embeds its font, so the file looks the same everywhere. For a chart, or a kind archgram does not draw, Mermaid is the better tool.

vs-drawio

draw.io and Excalidraw are canvases you arrange by hand, which suits a sketch. archgram places everything from the spec, so the diagram lives in git beside the code and changes in a diff when the system does.

vs-d2

D2 is a language for many kinds of diagram, and PlantUML draws UML from text, such as sequence, class and deployment diagrams. archgram draws two kinds, the architecture of a system and the sequence of one request, from a spec in plain YAML or JSON that an agent can write from the code; it routes the lines, animates the flows inside the SVG and gives the same file on every machine. For the rest of UML, PlantUML is the better tool; for a diagram in many shapes, D2 is.

vs-structurizr

Structurizr models a system once in its DSL and draws several C4 views from that model; it is the C4 model's reference implementation. archgram draws one diagram per spec, the parts and the path a request takes, as an animated SVG for a README or a docs page. To keep several C4 views in step, Structurizr is the better tool.

agent

Yes, with the archgram skill: it reads the code, draws a part only where a file backs it and an edge only where a line of code makes it, and lists both.

in-sync

Keep the spec in git beside the code. archgram redraws the diagram from it, and its agent skill can write the spec again from the code, so the diagram changes in the same pull request as the system.

your-colours

Yes: --theme-file maps archgram's colour roles to your design tokens (W3C Design Tokens), and refuses colours that fall short of contrast.

same-file

Yes, byte for byte, on every machine, so a diagram changes in git only when the system does.