2026-02-28 05:12:18 +00:00
# OpenPencil
Initial commit: Tauri + CanvasKit + React editor scaffold
- Tauri v2 desktop shell with 1280x800 window
- CanvasKit WASM (Skia) rendering via WebGL2
- Scene graph with typed nodes (Frame, Rectangle, Ellipse, Line, etc.)
- Skia renderer with fills, strokes, rounded corners, opacity, rotation
- Selection system with resize handles
- Undo/redo manager (inverse command pattern with batching)
- Bottom toolbar (Select, Frame, Rect, Ellipse, Line) matching Figma UI3
- Left layers panel, right properties panel
- Pan (scroll), zoom (Ctrl+scroll toward cursor)
- Keyboard shortcuts: V/F/R/O/L for tools, Cmd+Z undo, Backspace delete
- 5 demo shapes rendered on canvas
2026-02-27 12:48:29 +00:00
2026-03-01 09:58:13 +00:00
Open-source, AI-native design editor. Figma-compatible, AI-first, fully local.
Initial commit: Tauri + CanvasKit + React editor scaffold
- Tauri v2 desktop shell with 1280x800 window
- CanvasKit WASM (Skia) rendering via WebGL2
- Scene graph with typed nodes (Frame, Rectangle, Ellipse, Line, etc.)
- Skia renderer with fills, strokes, rounded corners, opacity, rotation
- Selection system with resize handles
- Undo/redo manager (inverse command pattern with batching)
- Bottom toolbar (Select, Frame, Rect, Ellipse, Line) matching Figma UI3
- Left layers panel, right properties panel
- Pan (scroll), zoom (Ctrl+scroll toward cursor)
- Keyboard shortcuts: V/F/R/O/L for tools, Cmd+Z undo, Backspace delete
- 5 demo shapes rendered on canvas
2026-02-27 12:48:29 +00:00
2026-02-28 05:12:18 +00:00
> **Status:** Active development. Not ready for production use.
Initial commit: Tauri + CanvasKit + React editor scaffold
- Tauri v2 desktop shell with 1280x800 window
- CanvasKit WASM (Skia) rendering via WebGL2
- Scene graph with typed nodes (Frame, Rectangle, Ellipse, Line, etc.)
- Skia renderer with fills, strokes, rounded corners, opacity, rotation
- Selection system with resize handles
- Undo/redo manager (inverse command pattern with batching)
- Bottom toolbar (Select, Frame, Rect, Ellipse, Line) matching Figma UI3
- Left layers panel, right properties panel
- Pan (scroll), zoom (Ctrl+scroll toward cursor)
- Keyboard shortcuts: V/F/R/O/L for tools, Cmd+Z undo, Backspace delete
- 5 demo shapes rendered on canvas
2026-02-27 12:48:29 +00:00
2026-03-01 13:32:45 +00:00
**[Try it online →](https://app.openpencil.dev)** · [Download ](https://github.com/open-pencil/open-pencil/releases/latest ) · [Documentation ](https://openpencil.dev )
2026-03-01 13:03:25 +00:00
2026-03-02 05:00:58 +00:00
> **What's next**
>
> - Multi-file / tabs support
2026-03-02 05:19:08 +00:00
> - More AI providers (Anthropic API, Claude Code subscription, Gemini, local models via Ollama)
2026-03-02 05:00:58 +00:00
> - Code signing (Apple & Azure certificates for properly signed binaries)
> - Improving .fig compatibility across a larger set of files
2026-03-02 10:57:03 +00:00
> - Porting more [figma-use](https://github.com/dannote/figma-use) tools (118 → 29 currently) for full AI agent design capabilities
2026-03-02 05:00:58 +00:00
> - CI tools — design linting, code export, visual regression in pipelines
2026-03-02 04:56:45 +00:00
2026-03-01 12:57:01 +00:00

2026-02-28 20:36:55 +00:00
2026-03-01 09:58:13 +00:00
## Why
2026-03-02 05:19:08 +00:00
Figma is a closed platform that actively fights programmatic access. Their [MCP server ](https://www.figma.com/blog/introducing-figma-mcp-server/ ), launched in June 2025, was read-only — you could pull design context but not create or modify anything. [figma-use ](https://github.com/dannote/figma-use ) filled that gap in January 2026 with full read/write design automation via CDP. A month later, [Figma 126.1.2 started stripping `--remote-debugging-port` ](https://forum.figma.com/report-a-problem-6/remote-debugging-port-not-working-in-figma-desktop-126-1-2-50858 ) on startup — killing CDP-based tools. Figma has since added UI-to-Figma capture via their MCP server, but it still can't programmatically create or modify design nodes.
2026-03-01 09:58:13 +00:00
This is a supply chain problem. Designers and developers build workflows on top of their design tool. When that tool is closed-source, the vendor controls what's possible. They can break your tooling overnight with a point release. Your design files are in a proprietary binary format that only their software can fully read.
Coding tools went through the same shift. VS Code opened the editor. LLMs opened code generation. Projects like [pi ](https://github.com/mariozechner/pi-coding-agent ) opened the AI coding agent. Design tools are next.
OpenPencil is:
- **Open source** — MIT license, read and modify everything
- **Figma-compatible** — opens .fig files natively, copy/paste between apps
2026-03-01 14:24:54 +00:00
- **AI-native** — built-in chat with tool use, bring your own API key, no vendor lock-in
2026-03-01 19:44:56 +00:00
- **Free forever** — no account, no subscription, no internet required, ~7 MB install
2026-03-01 09:58:13 +00:00
- **Programmable** — headless CLI, every operation is scriptable
Your design files are yours. Your tools should be too.
2026-02-28 05:12:18 +00:00
## Features
2026-03-01 19:44:56 +00:00
- **Figma .fig file import and export** — read and write native Figma files, copy/paste between apps
- **Real-time collaboration** — P2P via WebRTC, no server required. Cursors, presence, follow mode
- **Drawing tools** — shapes, pen tool with vector networks, rich text with system fonts, auto-layout, components with live sync, variables with modes and collections
2026-03-02 10:57:03 +00:00
- **AI chat** — describe what you want, the AI builds it. 29 tools wired to chat, CLI, and MCP
- **MCP server** — connect Claude Code, Cursor, or any MCP client to read/write .fig files headlessly
2026-03-01 19:44:56 +00:00
- **Headless CLI** — inspect, search, analyze, and render .fig files without a GUI
- **~7 MB desktop app** — Tauri v2, macOS/Windows/Linux. Also runs in the browser
2026-02-28 05:12:18 +00:00
## Tech Stack
| Layer | Tech |
|-------|------|
| UI | Vue 3, VueUse, Reka UI |
| Styling | Tailwind CSS 4 |
2026-02-28 05:14:28 +00:00
| Rendering | Skia (CanvasKit WASM) |
2026-02-28 05:12:18 +00:00
| Layout | Yoga WASM |
2026-02-28 05:14:28 +00:00
| File format | Kiwi binary (vendored) + Zstd + ZIP |
2026-02-28 05:12:18 +00:00
| Color | culori |
P2P collaboration: cursors, follow mode, cleanup
- Broadcast cursor position from canvas mouse move via awareness
- Broadcast selection changes via reactive watcher on selectedIds
- Follow mode: click peer avatar to track their viewport (pan + zoom)
- Zoom broadcast via watcher on store.state.zoom, not just mouse move
- Figma-style cursor arrows: colored fill, white border, name pill
- Stale cursor cleanup: removeAwarenessStates on peer leave
- MQTT signaling (replace Nostr), STUN + TURN ICE servers
- Collab constants extracted to src/constants.ts
- crypto.getRandomValues() replaces Math.random() everywhere
- Provide/inject for collab composable (COLLAB_KEY)
- Update README (collab section, tech stack), CHANGELOG, AGENTS.md
- AGENTS.md: release process, CI workflows, documentation guidelines
2026-03-01 15:11:07 +00:00
| Collaboration | Trystero (WebRTC P2P) + Yjs (CRDT) + y-indexeddb |
2026-02-28 05:12:18 +00:00
| Desktop | Tauri v2 |
2026-02-28 22:28:24 +00:00
| CLI | citty, agentfmt |
2026-03-02 10:57:03 +00:00
| MCP | @modelcontextprotocol/sdk , Hono |
2026-02-28 05:14:28 +00:00
| Testing | Playwright (visual regression), bun:test (unit) |
2026-02-28 05:12:18 +00:00
| Tooling | Vite 7, oxlint, oxfmt, typescript-go |
## Getting Started
```sh
bun install
2026-02-28 05:14:28 +00:00
bun run dev
2026-02-28 05:12:18 +00:00
```
P2P collaboration: cursors, follow mode, cleanup
- Broadcast cursor position from canvas mouse move via awareness
- Broadcast selection changes via reactive watcher on selectedIds
- Follow mode: click peer avatar to track their viewport (pan + zoom)
- Zoom broadcast via watcher on store.state.zoom, not just mouse move
- Figma-style cursor arrows: colored fill, white border, name pill
- Stale cursor cleanup: removeAwarenessStates on peer leave
- MQTT signaling (replace Nostr), STUN + TURN ICE servers
- Collab constants extracted to src/constants.ts
- crypto.getRandomValues() replaces Math.random() everywhere
- Provide/inject for collab composable (COLLAB_KEY)
- Update README (collab section, tech stack), CHANGELOG, AGENTS.md
- AGENTS.md: release process, CI workflows, documentation guidelines
2026-03-01 15:11:07 +00:00
## Collaboration
Share a link to co-edit in real time. No server, no account — peers connect directly via WebRTC.
1. Click the share button in the top-right panel
2. Share the generated link (`app.openpencil.dev/share/< room-id > `)
3. Collaborators see your cursor, selection, and edits in real time
4. Click a peer's avatar to follow their viewport
All sync happens peer-to-peer via [Trystero ](https://github.com/dmotz/trystero ). Document state is persisted locally in IndexedDB — refreshing the page keeps your work.
2026-02-28 22:28:24 +00:00
## CLI
Headless .fig file operations — no GUI needed:
```sh
2026-03-01 19:44:56 +00:00
bunx @open -pencil/cli info design.fig # Document stats, node types, fonts
bunx @open -pencil/cli tree design.fig # Visual node tree
bunx @open -pencil/cli find design.fig --type TEXT # Search by name or type
bunx @open -pencil/cli export design.fig # Render to PNG
bunx @open -pencil/cli export design.fig -f jpg -s 2 -q 90 # JPG at 2x
2026-02-28 22:28:24 +00:00
```
All commands support `--json` for machine-readable output.
2026-03-02 10:57:03 +00:00
## MCP Server
Connect AI coding tools to read and modify `.fig` files headlessly. [Full docs → ](https://openpencil.dev/reference/mcp-tools )
**Stdio** (Claude Code, Cursor, Windsurf) — add to your MCP config:
2026-03-02 11:28:56 +00:00
```sh
bun add -g @open -pencil/mcp
```
2026-03-02 10:57:03 +00:00
```json
{
"mcpServers": {
"open-pencil": {
2026-03-02 11:28:56 +00:00
"command": "openpencil-mcp"
2026-03-02 10:57:03 +00:00
}
}
}
```
**HTTP** (scripts, browser extensions, CI):
```sh
2026-03-02 11:28:56 +00:00
openpencil-mcp-http # http://localhost:3100/mcp
2026-03-02 10:57:03 +00:00
```
29 tools: create shapes, set fills/strokes/layout, find nodes, open/save `.fig` files, render JSX to design nodes.
2026-02-28 05:12:18 +00:00
## Scripts
2026-02-28 05:14:28 +00:00
| Command | Description |
|---------|-------------|
| `bun run dev` | Dev server at http://localhost:1420 |
| `bun run build` | Production build |
| `bun run check` | Lint + typecheck |
| `bun run test` | E2E visual regression |
| `bun run test:update` | Regenerate screenshot baselines |
| `bun run test:unit` | Unit tests |
| `bun run tauri dev` | Desktop app (requires Rust) |
2026-02-28 07:05:25 +00:00
## Desktop App
2026-02-28 05:14:28 +00:00
2026-02-28 07:05:25 +00:00
Requires [Rust ](https://rustup.rs/ ), the Tauri CLI, and platform-specific prerequisites ([Tauri v2 guide](https://v2.tauri.app/start/prerequisites/)).
2026-02-28 05:14:28 +00:00
2026-02-28 05:12:18 +00:00
```sh
2026-02-28 07:05:25 +00:00
bun run tauri dev # Dev mode with hot reload
bun run tauri build # Production build
2026-02-28 05:14:28 +00:00
bun run tauri build --target universal-apple-darwin # macOS universal
2026-02-28 05:12:18 +00:00
```
2026-02-28 05:14:28 +00:00
Cross-compilation to other platforms requires their respective toolchains or CI (e.g. GitHub Actions).
2026-02-28 08:38:27 +00:00
### Platform Prerequisites
#### macOS
Install Xcode Command Line Tools:
```sh
xcode-select --install
```
#### Windows
1. Install [Rust ](https://rustup.rs/ ) — make sure the default toolchain is `stable-msvc` :
```sh
rustup default stable-msvc
```
2. Install [Visual Studio Build Tools ](https://visualstudio.microsoft.com/visual-cpp-build-tools/ ) with the "Desktop development with C++" workload (MSVC compiler + Windows SDK)
3. WebView2 is pre-installed on Windows 10 (1803+) and Windows 11. If missing, download from [Microsoft ](https://developer.microsoft.com/en-us/microsoft-edge/webview2/ )
#### Linux
Install system dependencies (Debian/Ubuntu):
```sh
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file \
libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
```
For other distros, see the [Tauri v2 prerequisites ](https://v2.tauri.app/start/prerequisites/ ).
2026-02-28 05:12:18 +00:00
## Project Structure
```
2026-02-28 22:28:24 +00:00
packages/
core/ @open -pencil/core — engine (scene graph, renderer, layout, codec)
cli/ @open -pencil/cli — headless CLI (info, tree, find, export)
2026-03-02 10:57:03 +00:00
mcp/ @open -pencil/mcp — MCP server (stdio + HTTP)
2026-03-01 19:44:56 +00:00
docs/ VitePress documentation site
2026-02-28 05:12:18 +00:00
src/
2026-03-01 19:44:56 +00:00
ai/ AI tool wiring
components/ Vue SFCs (canvas, panels, collaboration, color picker)
P2P collaboration: cursors, follow mode, cleanup
- Broadcast cursor position from canvas mouse move via awareness
- Broadcast selection changes via reactive watcher on selectedIds
- Follow mode: click peer avatar to track their viewport (pan + zoom)
- Zoom broadcast via watcher on store.state.zoom, not just mouse move
- Figma-style cursor arrows: colored fill, white border, name pill
- Stale cursor cleanup: removeAwarenessStates on peer leave
- MQTT signaling (replace Nostr), STUN + TURN ICE servers
- Collab constants extracted to src/constants.ts
- crypto.getRandomValues() replaces Math.random() everywhere
- Provide/inject for collab composable (COLLAB_KEY)
- Update README (collab section, tech stack), CHANGELOG, AGENTS.md
- AGENTS.md: release process, CI workflows, documentation guidelines
2026-03-01 15:11:07 +00:00
composables/ Canvas input, keyboard shortcuts, collaboration, rendering
2026-03-01 19:44:56 +00:00
views/ Route views
2026-02-28 05:12:18 +00:00
stores/ Editor state (Vue reactivity)
2026-02-28 22:28:24 +00:00
engine/ Re-export shims from @open -pencil/core
2026-02-28 05:12:18 +00:00
desktop/ Tauri v2 (Rust + config)
tests/
2026-02-28 05:14:28 +00:00
e2e/ Playwright visual regression
engine/ Unit tests
2026-02-28 05:12:18 +00:00
```
2026-03-02 09:27:05 +00:00
## Acknowledgments
Thanks to [@sld0Ant ](https://github.com/sld0Ant ) (Anton Soldatov) for creating and maintaining the [documentation site ](https://openpencil.dev ).
2026-02-28 05:12:18 +00:00
## License
MIT