Canva-like design tool powered by Claude Code — prompt to PNG/PDF via HTML/CSS/SVG rendering.
- Prompt-to-design — describe what you want, get a professional graphic
- Adaptive styles — 10 design styles (editorial, poster, brutalist, retro, glassmorphism, art deco...)
- Stock images — search Unsplash, Pexels, Pixabay directly
- AI background removal — detour people/objects locally (no API)
- Image processing — gradient masks, filters, compositing via Sharp
- Live preview — Express server with auto-reload on port 3456
- Export — PNG, JPEG, PDF via Playwright headless
- 25+ preset formats — Instagram, Story, A4, LinkedIn, YouTube, etc.
All open-source, zero proprietary dependencies:
| Component | Tech | License |
|---|---|---|
| Server | Express | MIT |
| Export | Playwright (Chromium) | Apache 2.0 |
| Image processing | Sharp | Apache 2.0 |
| Background removal | @imgly/background-removal-node | MIT |
| Rendering | HTML/CSS/SVG/Canvas (Fabric.js) | MIT |
cd canva-cli
npm install
npx playwright install chromiumnpm run serve
# → http://localhost:3456node server/export.js --template instagram-post --format png --scale 2
node server/export.js --template flyer-a4 --format pdf
node server/export.js --template my-design --format jpeg --output ~/Desktop/design.jpg| Flag | Description |
|---|---|
--template |
Template name (from templates/ folder) |
--input |
Or a direct HTML file path |
--format |
png, jpeg, pdf |
--scale |
Device scale factor (2 = retina) |
--size |
Override: 1080x1080 or format name |
--output |
Custom output path |
This project includes a skill.md that turns Claude Code into a graphic designer:
- Describe what you need ("crée un post Instagram pour une promo -30%")
- Claude detects the context and picks the right style
- Generates HTML/CSS, serves it, takes a screenshot
- Shows you the preview, iterates on your feedback
- Exports the final design
The skill automatically adapts based on your request:
| Request type | Style applied |
|---|---|
| Poster, pub, flyer | Bold typography, dramatic composition |
| Instagram, TikTok | Eye-catching, trend-aware |
| Magazine, editorial | Elegant serif, generous whitespace |
| Business card, branding | Minimal, precise |
| Event, concert | Maximalist or brutalist |
| Luxury, immobilier | Art deco, editorial |
Editorial, Swiss, Brutalist, Retro, Maximalist, Glassmorphism, Art Deco, Poster, Corporate, Minimal — each with curated font pairings and color palettes.
canva-cli/
├── server/
│ ├── index.js # Express server + live-reload
│ └── export.js # Playwright headless export
├── lib/
│ ├── formats.js # 25+ preset dimensions
│ ├── renderer.js # HTML/SVG/Fabric.js wrappers
│ ├── image.js # Background removal, masks, filters
│ ├── stock-images.js # Unsplash/Pexels/Pixabay integration
│ └── styles.js # 10 design styles + font pairings + palettes
├── templates/ # HTML design files
├── assets/images/ # Stock photos and processed images
├── output/ # Exported PNG/PDF files
├── skill.md # Claude Code skill definition
└── package.json
For searching images by keyword (download by URL works without keys):
export UNSPLASH_ACCESS_KEY="..." # https://unsplash.com/developers
export PEXELS_API_KEY="..." # https://www.pexels.com/api/
export PIXABAY_API_KEY="..." # https://pixabay.com/api/docs/MIT