{"_id":"@swiftlysingh/excalidraw-cli","_rev":"6-f674672fd707467add8b99015ba82d42","name":"@swiftlysingh/excalidraw-cli","dist-tags":{"latest":"1.5.0"},"versions":{"1.0.0":{"name":"@swiftlysingh/excalidraw-cli","version":"1.0.0","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"author":"","license":"MIT","_id":"@swiftlysingh/excalidraw-cli@1.0.0","maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"bin":{"excalidraw-cli":"dist/cli.js"},"dist":{"shasum":"5ac3004eb3911110b6d5b054702da9e81a371cb2","tarball":"https://registry.npmjs.org/@swiftlysingh/excalidraw-cli/-/excalidraw-cli-1.0.0.tgz","fileCount":75,"integrity":"sha512-qjrLBQ4T6iiiskjdytPd3h5Lccvt921GcqC6JkUpndakNsicdt+KsZ63lY/sZLAFuH6cbh2ST7AtIFF0pMhFZA==","signatures":[{"sig":"MEQCICs6qzYsnBqwwjgaQllcVES6mGBp9VUmFsrk7uaKrzNrAiBFWPV9HqOrG6bt0jHjOkudinWBgn8j+kwV6J/yvuqucw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":125875},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"c4c34b35ba5032884508d762e70e29397ff9e33c","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"vitest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:run":"vitest run","prepublishOnly":"npm run build"},"_npmUser":{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"},"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"_npmVersion":"11.6.0","description":"CLI for creating Excalidraw flowcharts programmatically","directories":{},"_nodeVersion":"24.9.0","dependencies":{"elkjs":"^0.9.3","nanoid":"^5.0.9","commander":"^12.1.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.17.0","vitest":"^2.1.8","prettier":"^3.4.2","typescript":"^5.7.2","@types/node":"^22.10.5","@typescript-eslint/parser":"^8.19.1","@typescript-eslint/eslint-plugin":"^8.19.1"},"_npmOperationalInternal":{"tmp":"tmp/excalidraw-cli_1.0.0_1767963304483_0.6609973840274603","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@swiftlysingh/excalidraw-cli","version":"1.0.1","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"author":"","license":"MIT","_id":"@swiftlysingh/excalidraw-cli@1.0.1","maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"bin":{"excalidraw-cli":"dist/cli.js"},"dist":{"shasum":"86ca9f33254fc27113b7e595bf81d37113c9d945","tarball":"https://registry.npmjs.org/@swiftlysingh/excalidraw-cli/-/excalidraw-cli-1.0.1.tgz","fileCount":75,"integrity":"sha512-TYt1gKiDz5hUDP781DqioQ7l2J+HlUIS0KUsICB7KhetfVl0jBR9eEXUcP+APKjTbTAyrP8uYTTiuDkbNJlFDw==","signatures":[{"sig":"MEUCIQCiJ5UguK9dKqT9EUBTe3ZoiKRabMpbBi+L24aiPvHdlwIgSe6ym7CkSFzSVt1M10XOM+VQthirrOmooLcyaBgyHBg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126636},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"a85c0c35d930d5b1a29f9af40dd2847936b294ae","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"vitest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:run":"vitest run","prepublishOnly":"npm run build"},"_npmUser":{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"},"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"_npmVersion":"11.6.0","description":"CLI for creating Excalidraw flowcharts programmatically","directories":{},"_nodeVersion":"24.9.0","dependencies":{"elkjs":"^0.9.3","nanoid":"^5.0.9","commander":"^12.1.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.17.0","vitest":"^2.1.8","prettier":"^3.4.2","typescript":"^5.7.2","@types/node":"^22.10.5","@typescript-eslint/parser":"^8.19.1","@typescript-eslint/eslint-plugin":"^8.19.1"},"_npmOperationalInternal":{"tmp":"tmp/excalidraw-cli_1.0.1_1767980336299_0.7203521501522727","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@swiftlysingh/excalidraw-cli","version":"1.1.0","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"author":"","license":"MIT","_id":"@swiftlysingh/excalidraw-cli@1.1.0","maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"bin":{"excalidraw-cli":"dist/cli.js"},"dist":{"shasum":"10f804b3799171a7de28055ddb107206416c299b","tarball":"https://registry.npmjs.org/@swiftlysingh/excalidraw-cli/-/excalidraw-cli-1.1.0.tgz","fileCount":83,"integrity":"sha512-O5NdxMuaLmGAa6ReSkfA/lT/VmKml5eFaOJOvPb4kzEap+9nmZ93Jj3SkHmliJWFHla38PA21zStSpsYiT59TQ==","signatures":[{"sig":"MEUCICj37GjtquZm1R/9sqbp0arHaiaN+6qzr2crefrCAbD4AiEA/LnaNX8+sTUebjToVRHXgo9L/PlfQbGWAFkyg7sz+FQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":191438},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"b4670faca5c02cc35ed0dbd5fb77f3ed5d0d2d67","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"vitest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:run":"vitest run","prepublishOnly":"npm run build"},"_npmUser":{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"},"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"CLI for creating Excalidraw flowcharts programmatically","directories":{},"_nodeVersion":"20.19.6","dependencies":{"elkjs":"^0.9.3","nanoid":"^5.0.9","commander":"^12.1.0","ts-graphviz":"^3.0.6"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.17.0","vitest":"^2.1.8","prettier":"^3.4.2","typescript":"^5.7.2","@types/node":"^22.10.5","@typescript-eslint/parser":"^8.19.1","@typescript-eslint/eslint-plugin":"^8.19.1"},"_npmOperationalInternal":{"tmp":"tmp/excalidraw-cli_1.1.0_1768331604402_0.7684164361559749","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@swiftlysingh/excalidraw-cli","version":"1.2.0","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"author":"","license":"MIT","_id":"@swiftlysingh/excalidraw-cli@1.2.0","maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"bin":{"excalidraw-cli":"dist/cli.js"},"man":["man/excalidraw-cli.1"],"dist":{"shasum":"a31471b92f439be9d2982a3062a85bdd2c8d7c0d","tarball":"https://registry.npmjs.org/@swiftlysingh/excalidraw-cli/-/excalidraw-cli-1.2.0.tgz","fileCount":96,"integrity":"sha512-cdBYhhEwR0uLI9X8/dTpSmAvkTgmB/bLZFc8QRlP8bMz6seBaTHfYR7hJP2tyEwqQSEKd9xF0sLyPDSw8Y09Ng==","signatures":[{"sig":"MEYCIQCldSIp2ANVTk8tFtS0QJTqlaCfMTAcrX6xdw/Wc0HJ1QIhAIg5SO0H5nOteCtVR088Fr3srTTTOvvhqCSHk9Q04Rs0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":239487},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"gitHead":"c171c66b3edd7bd703a395787127f32bb41b7d1a","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"vitest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:run":"vitest run","prepublishOnly":"npm run build"},"_npmUser":{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"},"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"CLI for creating Excalidraw flowcharts programmatically","directories":{},"_nodeVersion":"20.19.0","dependencies":{"elkjs":"^0.9.3","jsdom":"^28.1.0","nanoid":"^5.0.9","commander":"^12.1.0","ts-graphviz":"^3.0.6","@resvg/resvg-js":"^2.6.2","@excalidraw/utils":"0.1.3-test32"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.17.0","vitest":"^2.1.8","prettier":"^3.4.2","typescript":"^5.7.2","@types/node":"^22.10.5","@types/jsdom":"^28.0.0","@typescript-eslint/parser":"^8.19.1","@typescript-eslint/eslint-plugin":"^8.19.1"},"_npmOperationalInternal":{"tmp":"tmp/excalidraw-cli_1.2.0_1773640424281_0.6530017902868557","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@swiftlysingh/excalidraw-cli","version":"1.4.0","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"author":"","license":"MIT","_id":"@swiftlysingh/excalidraw-cli@1.4.0","maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"bin":{"excalidraw-cli":"dist/cli.js"},"man":["man/excalidraw-cli.1"],"dist":{"shasum":"ee24ee6a708780a9db75d6b43f986cfeca9b5510","tarball":"https://registry.npmjs.org/@swiftlysingh/excalidraw-cli/-/excalidraw-cli-1.4.0.tgz","fileCount":96,"integrity":"sha512-Z5ZxBc41+7LpL3z7emLX8LEvGpQKX102EwUTItpBlvuVnf9YvPLH2xmloFOQe0U3LYcGvHZYlmwGL8Sw9J3haw==","signatures":[{"sig":"MEUCIQCbU13J744LeJhe018uC71A4X2nGHJyzAPVQpxGkKiX5gIgekyUrj0u/GrZZ5SsB4WQqkNkzdSLojElskN268lfvjw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCb/xciOvuPs9RUwZHz19YNgLCzDpNZJThVgFMOWY/wbwIhAIWohzQDz4uHnOSdpSQQd+3uLhLAOzpf+9lNQypO4CVo","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":277891},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=20.19.0"},"gitHead":"03772178d77a5fcc5e93729816ad4041d952eb8b","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"vitest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:run":"vitest run","prepublishOnly":"npm run build"},"_npmUser":{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"},"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"CLI for creating Excalidraw flowcharts programmatically","directories":{},"_nodeVersion":"20.19.0","dependencies":{"elkjs":"^0.9.3","jsdom":"^28.1.0","nanoid":"^5.0.9","commander":"^12.1.0","ts-graphviz":"^3.0.6","@resvg/resvg-js":"^2.6.2","@excalidraw/utils":"0.1.3-test32"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.17.0","vitest":"^2.1.8","js-yaml":"^4.1.1","prettier":"^3.4.2","typescript":"^5.7.2","@types/node":"^22.10.5","@types/jsdom":"^28.0.0","@typescript-eslint/parser":"^8.19.1","@typescript-eslint/eslint-plugin":"^8.19.1"},"_npmOperationalInternal":{"tmp":"tmp/excalidraw-cli_1.4.0_1789968583093_0.6597930667956384","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"_id":"@swiftlysingh/excalidraw-cli@1.5.0","bin":{"excalidraw-cli":"dist/cli.js"},"man":["man/excalidraw-cli.1"],"bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"dist":{"shasum":"faf904da9f22d391cbef91ea5821c13c8764b2b7","tarball":"https://registry.npmjs.org/@swiftlysingh/excalidraw-cli/-/excalidraw-cli-1.5.0.tgz","fileCount":96,"integrity":"sha512-l5Jk4YYEhX3vKnoTF5eFP3/CXvPGUESMUo07xV9LKiApUf3ePyQ5LRII/9Poeq8mB2GQ10frL74IHnflFzKGmg==","signatures":[{"sig":"MEYCIQCu/4VN+h872ztHk8azn+lkJUW5LRT2kXsynrDkHt0+pQIhALXfD2AIpIEx0m8bfQ1H/sbvdD8y3BGmH20M/JIoo3X5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBsWeRANYkLOXL48VKdhWwnTyJ7T/8sRDN0HekRSkm3WAiAuK9uB8WqukgbtRFpqzuoGxqX7UwNBlJyDH/mANPEkkg=="}],"unpackedSize":286574},"main":"dist/index.js","name":"@swiftlysingh/excalidraw-cli","type":"module","types":"dist/index.d.ts","author":"","engines":{"node":">=20.19.0"},"gitHead":"1859dde3b04947d5d531248ec976022bbdfdc502","license":"MIT","scripts":{"dev":"tsc --watch","lint":"eslint src --ext .ts","test":"vitest","build":"tsc","format":"prettier --write \"src/**/*.ts\"","test:run":"vitest run","prepublishOnly":"npm run build"},"version":"1.5.0","_npmUser":{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"},"homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"CLI for creating Excalidraw flowcharts programmatically","directories":{},"maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"_nodeVersion":"20.19.0","dependencies":{"elkjs":"^0.9.3","jsdom":"^28.1.0","nanoid":"^5.0.9","commander":"^12.1.0","ts-graphviz":"^3.0.6","@resvg/resvg-js":"^2.6.2","@excalidraw/utils":"0.1.5"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.17.0","vitest":"^2.1.8","js-yaml":"^4.1.1","prettier":"^3.4.2","typescript":"^5.7.2","@types/node":"^22.10.5","@types/jsdom":"^28.0.0","@typescript-eslint/parser":"^8.19.1","@typescript-eslint/eslint-plugin":"^8.19.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/excalidraw-cli_1.5.0_1792297747732_0.8581983895684797"}}},"time":{"created":"2026-01-09T12:55:04.430Z","modified":"2026-10-18T04:29:07.976Z","1.0.0":"2026-01-09T12:55:04.619Z","1.0.1":"2026-01-09T17:38:56.442Z","1.1.0":"2026-01-13T19:13:24.552Z","1.2.0":"2026-03-16T05:53:44.420Z","1.4.0":"2026-09-21T05:29:43.174Z","1.5.0":"2026-10-18T04:29:07.824Z"},"bugs":{"url":"https://github.com/swiftlysingh/excalidraw-cli/issues"},"license":"MIT","homepage":"https://github.com/swiftlysingh/excalidraw-cli#readme","keywords":["excalidraw","flowchart","diagram","cli","visualization"],"repository":{"url":"git+https://github.com/swiftlysingh/excalidraw-cli.git","type":"git"},"description":"CLI for creating Excalidraw flowcharts programmatically","maintainers":[{"name":"swiftlysingh","email":"pushpinderpal19@gmail.com"}],"readme":"# excalidraw-cli\n<p>\n  <a href=\"https://www.npmjs.com/package/@swiftlysingh/excalidraw-cli\"><img src=\"https://img.shields.io/npm/v/@swiftlysingh/excalidraw-cli\" alt=\"npm version\"></a>\n  <a href=\"https://github.com/swiftlysingh/excalidraw-cli/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"MIT License\"></a>\n</p>\n\n<p align=\"center\">\n  <img alt=\"image\" src=\"https://github.com/user-attachments/assets/5af4b002-bd69-4187-8836-84135685117a\" />\n</p>\n\n<p align=\"center\">\n  Create Excalidraw flowcharts and diagrams from text-based DSL, JSON, or Graphviz DOT.\n</p>\n\n## Features\n\n- **Text-based DSL** for quick flowchart creation\n- **JSON API** for programmatic use\n- **Auto-layout** using ELK.js (Eclipse Layout Kernel)\n- **Multiple flow directions**: TB (top-bottom), BT, LR, RL\n- **Export to PNG & SVG** with dark mode, custom backgrounds, scale, and padding\n- **Programmable API** for integration into other tools\n\n## Installation\n\nRequires `Node >=20.19.0`. Node 18 is no longer supported.\n\nStyling and extended arrow syntax require version 1.4.0 or later.\nSee the [releases](https://github.com/swiftlysingh/excalidraw-cli/releases) for published versions.\n\n### Using npm\n\n```bash\nnpm install -g @swiftlysingh/excalidraw-cli\n```\n\n### Homebrew\n\nInstall from the tap:\n\n```bash\nbrew install swiftlysingh/tap/excalidraw-cli\n```\n\nHomebrew installs Node.js automatically. See the [tap README](https://github.com/swiftlysingh/homebrew-tap#readme)\nfor upgrades and switching from an existing npm installation.\n\n### From Source (Local Development)\n\n```bash\ngit clone https://github.com/swiftlysingh/excalidraw-cli.git\ncd excalidraw-cli\nnpm install\nnpm run build\nnpm link  # Makes 'excalidraw-cli' available globally\n```\n\n### Run without a global install\n\n```bash\nnpx --yes @swiftlysingh/excalidraw-cli create --inline \"[A] -> [B]\" -o diagram.excalidraw\n```\n\n## Quick Start\n\n### Create from DSL\n\n```bash\n# Inline DSL\nexcalidraw-cli create --inline \"(Start) -> [Process] -> {Decision?}\" -o flow.excalidraw\n\n# From file\nexcalidraw-cli create flowchart.dsl -o diagram.excalidraw\n\n# From stdin\necho \"[A] -> [B] -> [C]\" | excalidraw-cli create --stdin -o diagram.excalidraw\n```\n\n### Create from DOT\n\n```bash\nexcalidraw-cli create --format dot --inline 'digraph { A [label=\"Start\"]; B [label=\"Process\"]; A -> B; }' -o flow.excalidraw\n```\n\nDOT subgraphs are flattened. See `man excalidraw-cli` for supported attributes\nand shape mappings.\n\n### Export to Image\n\n```bash\n# Convert an existing .excalidraw file to PNG\nexcalidraw-cli convert diagram.excalidraw --format png\n\n# Convert with options\nexcalidraw-cli convert diagram.excalidraw --format png --scale 2 --dark\n\n# Convert to SVG without background\nexcalidraw-cli convert diagram.excalidraw --format svg --no-export-background\n```\n\n### DSL Syntax\n\n| Syntax | Element | Description |\n|--------|---------|-------------|\n| `[Label]` | Rectangle | Process steps, actions |\n| `{Label}` | Diamond | Decisions, conditionals |\n| `(Label)` | Ellipse | Start/End points |\n| `[[Label]]` | Database | Data storage |\n| `![path]` | Image | Local image node, default size 100x100 |\n| `![path](WxH)` | Image | Image node with an explicit size |\n| `[Label @fillStyle:hachure @backgroundColor:#a5d8ff]` | Styled node | Add inline node style attributes |\n| `[A] -> [B]` | Arrow | Forward connection |\n| `[A] <- [B]` | Reverse arrow | Connection from B to A |\n| `[A] <-> [B]` | Bidirectional arrow | Arrowheads on both ends |\n| `[A] --> [B]` | Dashed arrow | Dashed connection |\n| `[A] <-- [B]` | Dashed reverse arrow | Dashed connection from B to A |\n| `[A] <--> [B]` | Dashed bidirectional arrow | Dashed connection with arrowheads on both ends |\n| `[A] -> \"text\" -> [B]` | Labeled arrow | Double-quoted edge label |\n| `[A] -> 'text' -> [B]` | Labeled arrow | Single-quoted edge label |\n\n### Example DSL\n\n```\n(Start) -> [Enter Credentials] -> {Valid?}\n{Valid?} -> \"yes\" -> [Dashboard] -> (End)\n{Valid?} -> 'no' -> [Show Error] -> [Enter Credentials]\n[API] -> \"GET /users?name=\\\"pp\\\" \\\\ cache\" -> [Client]\n[Client] --> [Webhook]\n[Worker] <-- [Queue]\n[Service A] <--> [Service B]\n[Reviewer] <- [Approved]\n[Client] <-> [API]\n```\n\n### Edge label escaping\n\nEdge labels must use the fully specified form `[A] -> \"label\" -> [B]` (or single quotes instead of double quotes).\nMixed forms like `[A] --> \"x\" -> [B]` are rejected because they are ambiguous.\n\nShell escaping tips:\n\n```bash\n# easiest: wrap the whole DSL in single quotes, use double-quoted labels inside\nexcalidraw-cli create --inline '[API] -> \"GET /users?name=\\\"pp\\\"\" -> [Client]' -o api.excalidraw\n\n# if the label itself needs apostrophes, flip it\nexcalidraw-cli create --inline \"[Decision] -> 'team\\'s call' -> [Next]\" -o decision.excalidraw\n```\n\n### Node Styling\n\nAdd shape-level styling directly to nodes with inline `@key:value` attributes:\n\n```excalidraw\n(Start) -> [Enter Credentials @fillStyle:hachure @backgroundColor:#a5d8ff] -> {Valid?}\n{Valid?} -> \"no\" -> [Show Error @backgroundColor:#ffc9c9 @strokeStyle:dashed] -> [Enter Credentials]\n```\n\nFor repeated or shared nodes, define defaults with an `@node` block:\n\n```excalidraw\n@node [Enter Credentials]\n  fillStyle: solid\n  backgroundColor: #a5d8ff\n\n(Start) -> [Enter Credentials @fillStyle:hachure] -> {Valid?}\n```\n\nSupported node style keys:\n\n- `fillStyle`: `solid`, `hachure`, `cross-hatch`\n- `backgroundColor`\n- `strokeColor`\n- `strokeWidth`\n- `strokeStyle`: `solid`, `dashed`, `dotted`\n- `roughness`\n- `opacity`\n\nPrecedence rules:\n\n- `@node` blocks provide defaults for matching nodes\n- inline node attributes override block values\n- repeated references to the same node merge explicit style properties with later values winning per property\n\n### Directives\n\n```\n@direction LR    # Left to Right (default: TB)\n@spacing 60      # Node spacing in pixels\n```\n\nUse `#` for comments outside node definitions and quoted labels.\n\nImages must be local files; relative paths resolve from the working directory.\nUse `![path]` for an image node. For positioning, decorations, stickers, and\nscatter directives, see the [man page](man/excalidraw-cli.1).\n\n## CLI Reference\n\n| Command | Purpose |\n|---------|---------|\n| `create [input]` | Generate an editable `.excalidraw` file. Accepts a file, `--inline`, or `--stdin`. |\n| `convert <input> --format png\\|svg` | Export an existing `.excalidraw` file. |\n| `parse <input>` | Validate input and print its graph without generating a file. |\n\nUse `--help` with any command for its options, or `man excalidraw-cli` for the\nfull reference. `create -o -` writes to stdout.\n\nBoth `create` and `parse` detect `.json`, `.dot`, and `.gv` files. Other files\nand inline/stdin input default to DSL; use `--format json` or `--format dot`\nto override.\n\n## JSON API\n\nFor programmatic flowchart creation:\n\n```json\n{\n  \"nodes\": [\n    { \"id\": \"start\", \"type\": \"ellipse\", \"label\": \"Start\" },\n    { \"id\": \"process\", \"type\": \"rectangle\", \"label\": \"Process\" },\n    { \"id\": \"end\", \"type\": \"ellipse\", \"label\": \"End\" }\n  ],\n  \"edges\": [\n    { \"from\": \"start\", \"to\": \"process\" },\n    { \"from\": \"process\", \"to\": \"end\" }\n  ],\n  \"options\": {\n    \"direction\": \"TB\",\n    \"nodeSpacing\": 50\n  }\n}\n```\n\n```bash\nexcalidraw-cli create flowchart.json -o diagram.excalidraw\n```\n\n## Programmatic Usage\n\n```typescript\nimport {\n  createFlowchartFromDSL,\n  createFlowchartFromJSON,\n} from '@swiftlysingh/excalidraw-cli';\n\n// From DSL\nconst dsl = '(Start) -> [Process] -> (End)';\nconst json = await createFlowchartFromDSL(dsl);\n\n// From JSON input\nconst json2 = await createFlowchartFromJSON({\n  nodes: [\n    { id: 'a', type: 'rectangle', label: 'Hello' },\n    { id: 'b', type: 'rectangle', label: 'World' }\n  ],\n  edges: [{ from: 'a', to: 'b' }]\n});\n```\n\n### Export API\n\n```typescript\nimport { convertToSVG, convertToPNG } from '@swiftlysingh/excalidraw-cli';\nimport { readFileSync, writeFileSync } from 'fs';\n\n// Load an existing .excalidraw file\nconst file = JSON.parse(readFileSync('diagram.excalidraw', 'utf-8'));\n\n// Export to SVG\nconst svg = await convertToSVG(file, { padding: 20 });\nwriteFileSync('diagram.svg', svg);\n\n// Export to PNG with 2x scale and dark mode\nconst png = await convertToPNG(file, {\n  scale: 2,\n  dark: true,\n});\nwriteFileSync('diagram.png', png);\n```\n\nWhen no background is supplied, exports use `file.appState.viewBackgroundColor`\nand fall back to `#ffffff`. PNG scale values are clamped to `0.1` through `10`.\n\n## Examples\n\nHere are some flowcharts created with excalidraw-cli:\n\n### Simple Flow\n![Simple Flow](assets/up.png)\n\n### iOS App Architecture\n![iOS App Architecture](assets/ios-app-architecture.png)\n\n### LeetCode Problem Solving Flow\n![LeetCode Flow](assets/leetcode.png)\n\nGenerated `.excalidraw` files open in [Excalidraw](https://excalidraw.com) and\ncan be imported into Obsidian's Excalidraw plugin.\n\n## Releasing\n\nRun the **Release** workflow from `main` to create the next minor version from the\nlatest stable tag. It tests the updated package, creates a release commit and tag,\nthen publishes npm, GitHub, and Homebrew. The version commit stays on the tag;\nprotected `main` is unchanged.\n\nTo resume a partially published release, choose **retry** and enter its existing\ntag. A retry does not bump the version.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}