English | 简体中文 | Deutsch | Español | Français | Italiano | Português | Русский | Українська | 日本語 | 한국어 | Čeština | Polski | Română | Türkçe | Tiếng Việt | ไทย | Bahasa Indonesia
X-CMD Draw is an open-source SVG chart generator: put your data and styling in a URL to create bar charts, line charts, Sankey diagrams, system architecture diagrams, mind maps, and more.
Embed charts directly in READMEs, issues, PRs, blog posts, and web pages without exporting or uploading image files. Links and SVGs retain machine-readable data and parameters: readers see the chart, while AI agents can read, modify, and regenerate it without image recognition.
From performance analysis to architecture design, and from maps to schedules, the complete chart definition lives in the link. Click an image to inspect the data, adjust the styling, and regenerate it. Explore more chart examples ↗
| Downloads and growth |
Compression algorithm comparison |
Give the following prompt to an agent that can read web pages. The hosted draw service requires no account registration or API key:
Read and follow https://raw.githubusercontent.com/x-cmd/draw/main/skills/x-cmd-draw/SKILL.md. From now on, whenever you write a README, issue, pull request, blog post, or chat message and need a chart, use x-cmd Draw to generate a link and embed it with image syntax instead of attaching image files.
Tell the agent what data to use, what relationship to express, and where the chart will go:
Add an architecture diagram to the README, showing the request path from the CLI through the API to the database.
For regular use, install SKILL.md in an agent that supports local skills. For Claude Code, save it as ~/.claude/skills/draw/SKILL.md; after this one-time setup, you can describe your request directly.
- 🔗 A URL is a chart: Data and styling remain readable, comparable, version-controlled text, and the link embeds directly in Markdown and web pages.
- 🤖 Readable by people and AI: SVG handles presentation while machine-readable data and parameters support modification and regeneration—no need to infer data from an image.
- 📊 Broad visualization support: Create data charts, flowcharts, architecture diagrams, mind maps, maps, and schedules, or use ECharts for more complex data relationships.
- 🖱️ Interactive editing: Open an example in the interactive editor to inspect data, adjust parameters and styles, and copy the updated chart link.
- 🚀 Open and self-hostable: Built with TypeScript and licensed under Apache-2.0, with a hosted service, CLI, npm / JSR libraries, and Cloudflare Workers deployment.
Ideal for documentation, sharing, and ad-hoc visualization. Open the demo and interactive editor, adjust the data and styling, then copy the link—or edit the URL parameters directly:
Your readers see a chart; you keep text that is easy to modify and review.
Ideal for updating charts in CI, generating reports in bulk, working offline, and integrating charts into applications. The CLI, libraries, and hosted service share the same parameters:
npx @x-cmd/draw --type pie --labels A,B --values 3,2 --out pie.svgTo generate SVG synchronously in code, install the library and call draw:
npm install @x-cmd/drawimport { draw } from '@x-cmd/draw';
const { svg } = draw({ type: 'pie', labels: 'A,B', values: '3,2', t: 'evil', scheme: 'dark' });Deno users can run deno add jsr:@x-cmd/draw and import from jsr:@x-cmd/draw. The rendering core accesses neither the network nor the filesystem, making it suitable for restricted environments.
Ideal for a shared team endpoint, internal networks, or avoiding dependence on a public service:
git clone https://github.com/x-cmd/draw && cd draw && npm install
npm run serve # Local service: http://localhost:8787/draw
bash scripts/setup.sh # One-command deployment to your Cloudflare accountConfigure DATA_REPO, DATA_BRANCH, and GITHUB_TOKEN to enable permanent short links; regular GET rendering works without them. See the self-hosting guide.
Complete chart references, parameters, and examples are organized by topic:
| Topic | Documentation |
|---|---|
| Browse all chart types and scenarios | Documentation index · Reference charts · Cloud architecture examples |
| Common parameters and URL encoding | Parameters |
| JSON data | Data formats and API |
| Create short links or configure their storage | Self-hosting and short-link configuration |
| Architecture, sequence, ERD, and other structural diagrams | Diagram URL grammar |
| Run locally or deploy to Cloudflare | Self-hosting guide |
| Generate charts with an AI agent | Agent skill |
Inside draw: generated project diagrams
One edge worker, one render core, four directories that matter: specs/ parses, styles/ skins, render/ draws, store.ts keeps the short links.
https://x-cmd.com/draw/arch2?n=entry;fe;Worker%20entry;src/index.ts;r0c0&n=node;svc;Node%20server%20%2B%20CLI;src/node/;r0c1&n=handler;be;handler.ts;routing%20%2B%20responses;r1c0&n=demo;fe;demo/;gallery%20%2B%20landing;r1c1&n=specs;be;specs/;parse%20%2B%20validate;r2c0&n=store;db;store.ts;short%20links%20in%20a%20Git%20repo;r2c1&n=render;be;render/;draw%20the%20SVG;r3c0&n=styles;be;styles/;skins%20%2B%20families;r3c1&e=entry;handler&e=node;handler&e=handler;specs&e=handler;store&e=handler;demo&e=handler;render&e=render;styles&b=Edge%20worker;handler%20specs%20store%20render%20styles&title=Inside%20draw
The URL is parsed, a skin is picked, the SVG is drawn, and it comes back with <metadata> inside — one path for every chart type.
https://x-cmd.com/draw/seq?n=app;fe;Your%20app;;r0c0&n=worker;be;Worker;;r0c1&n=specs;be;specs/;parse%20%2B%20validate;r0c2&n=render;be;render/;draw%20the%20SVG;r0c3&e=app;worker;GET%20/draw%3Ftype=pie&e=worker;specs;parse%20the%20spec&e=specs;worker;spec;dash&e=worker;render;draw&e=render;worker;SVG;dash&e=worker;app;200%20%2B%20%3Cmetadata%3E;dash&title=One%20request
Four kinds of callers: your code, an AI agent, your README, and whoever runs their own copy.
https://x-cmd.com/draw/uc?n=caller;actor;Your%20app%20or%20CI&n=agent;actor;AI%20agent&n=writer;actor;README%20or%20docs&n=ops;actor;Self-host%20operator&n=uc1;uc;Render%20a%20chart;GET%20/draw%3Ftype=...&n=uc2;uc;Store%20a%20short%20link;POST%20/draw&n=uc3;uc;Embed%20the%20SVG;markdown%20%2B%20img&n=uc4;uc;Run%20it%20yourself;npm%20%2B%20wrangler&e=caller;uc1&e=caller;uc2&e=agent;uc1&e=writer;uc3&e=ops;uc4&b=draw;uc1%20uc2%20uc3%20uc4&title=What%20draw%20is%20for
npm install
npm run dev # Start wrangler dev locally
npm test # Vitest
npm run check # tsc --noEmit × 3 (worker / node / build)
npm run build # Build dist/ (npm library + CLI)
npm run deploy # wrangler deployCode is licensed under Apache-2.0. Bundled fonts retain their own licenses: Inter (OFL, see inter-OFL.txt) and Handlee (OFL, see handlee-OFL.txt).