Skip to content

API Reference

Creates a template slides.md with examples of all supported Markdown syntax. Optionally generates AI agent rule files for various coding assistants.

Terminal window
figdeck init [options]
OptionDescriptionDefault
-o, --out <path>Output file pathslides.md
-f, --forceOverwrite existing files-
--ai-rules [targets]Generate AI agent rules (agents,claude,cursor,copilot or all)-
--no-slidesSkip generating slides.md-
-h, --helpShow help-

AI Rules Targets:

TargetGenerated FileTool
agentsAGENTS.mdCodex CLI, Cursor (AGENTS.md)
claude.claude/rules/figdeck.mdClaude Code
cursor.cursor/rules/figdeck.mdcCursor
copilot.github/instructions/figdeck.instructions.mdGitHub Copilot

Examples:

Terminal window
# Create slides.md in current directory
figdeck init
# Create with custom filename
figdeck init -o presentation.md
# Overwrite existing files
figdeck init --force
# Generate all AI agent rules
figdeck init --ai-rules all
# Generate specific rules only
figdeck init --ai-rules claude,cursor
# Add rules to existing project (keep existing slides.md)
figdeck init --ai-rules all --no-slides

Parses Markdown and outputs JSON (one-shot).

Terminal window
figdeck build <file> [options]
ArgumentDescriptionRequired
<file>Markdown file pathYes
OptionDescriptionDefault
-o, --out <path>Output file pathstdout
-h, --helpShow help-

Examples:

Terminal window
# Output to stdout
figdeck build slides.md
# Output to file
figdeck build slides.md -o slides.json
# Pipe to other commands
figdeck build slides.md | jq '.[] | .title'

Starts a WebSocket server and waits for Plugin connections.

Terminal window
figdeck serve <file> [options]
ArgumentDescriptionRequired
<file>Markdown file pathYes
OptionDescriptionDefault
--host <host>WebSocket hostlocalhost
-p, --port <port>WebSocket port4141
-w, --watchWatch file changes and auto-updatefalse
-h, --helpShow help-

Examples:

Terminal window
# Basic usage
figdeck serve slides.md
# Specify port
figdeck serve slides.md --port 8080
# Specify host (allow external connections)
figdeck serve slides.md --host 0.0.0.0
# File watch mode (auto-resend on changes)
figdeck serve slides.md -w

You can set styles using YAML frontmatter at the beginning of the Markdown file or at the beginning of each slide.

---
background: "#1a1a2e"
color: "#ffffff"
headings:
h1: { size: 72, color: "#fff" }
h2: { size: 56 }
paragraphs: { size: 24 }
slideNumber:
show: true
position: bottom-right
---
# First Slide
---
background: "#0d1117"
color: "#58a6ff"
---
## This slide only has different background
PropertyTypeDescription
coverbooleanTreat the first slide as a cover (default: true)
backgroundstring | objectUnified background config: string (color/gradient/image/component) or object (color, gradient, template, image, component)
colorstringBase text color (applied to all elements)
headingsobjectHeading styles (h1-h4)
paragraphsobjectParagraph styles
bulletsobjectBullet point styles
codeobjectCode block styles
fontsobjectCustom font configuration
slideNumberobject | booleanSlide number settings
titlePrefixobject | falseTitle prefix settings
alignstringHorizontal alignment (left, center, right)
valignstringVertical alignment (top, middle, bottom)

The CLI communicates with the Figma Plugin via WebSocket on ws://localhost:4141 (default port).

When you run figdeck serve, the CLI automatically sends slide data to connected plugins. You typically don’t need to interact with the WebSocket API directly.