Architecture
How figdeck Works
Section titled “How figdeck Works”figdeck consists of two main components that work together to convert Markdown into Figma Slides:
┌─────────────────────┐ ┌─────────────────────┐│ CLI Tool │ │ Figma Plugin ││ │ │ ││ - Reads Markdown │ │ - Runs in Figma ││ - Parses content │ │ - Receives data ││ - Converts to data │ │ - Creates slides │└─────────────────────┘ └─────────────────────┘Two Ways to Use figdeck
Section titled “Two Ways to Use figdeck”1. WebSocket Mode (Recommended)
Section titled “1. WebSocket Mode (Recommended)”The most common way to use figdeck is with live preview:
- Start CLI: Run
figdeck serve slides.mdin your terminal - Open Plugin: Launch the figdeck plugin in Figma
- Automatic Connection: The plugin connects to the CLI automatically
- Live Updates: When you edit your Markdown file, changes are instantly reflected in Figma
Benefits:
- Real-time preview as you edit
- Automatic updates when files change
- No need to manually export/import files
2. JSON Import Mode
Section titled “2. JSON Import Mode”For one-time generation or when you can’t use WebSocket:
- Generate JSON: Run
figdeck build slides.md -o slides.json - Open Plugin: Launch the figdeck plugin in Figma
- Import JSON: Use the “Import JSON” tab to paste or select the JSON file
- Generate: Click to create slides
Benefits:
- Works without CLI running
- Can share JSON files with others
- Useful for CI/CD pipelines
Data Flow
Section titled “Data Flow”WebSocket Mode
Section titled “WebSocket Mode”Markdown File ↓CLI parses and converts ↓WebSocket connection (localhost:4141) ↓Figma Plugin receives data ↓Slides created in FigmaJSON Import Mode
Section titled “JSON Import Mode”Markdown File ↓CLI parses and converts ↓JSON file generated ↓Figma Plugin imports JSON ↓Slides created in FigmaComponents
Section titled “Components”CLI Tool
Section titled “CLI Tool”The CLI is a command-line tool that:
- Reads your Markdown files
- Parses the content and converts it to structured data
- Provides two modes:
serve(WebSocket) andbuild(JSON export)
Figma Plugin
Section titled “Figma Plugin”The plugin runs inside Figma and:
- Connects to the CLI via WebSocket (in serve mode)
- Accepts JSON imports (in build mode)
- Creates slides using Figma’s native slide creation API
- Handles styling, fonts, images, and all slide content
Security
Section titled “Security”figdeck includes security features to protect your system:
- Local by Default: WebSocket connections default to localhost only
- Remote Access: Requires explicit
--allow-remoteflag for network connections - Authentication: Auto-generated secrets for remote connections
- Input Validation: All data is validated before processing