Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/open-pencil/open-pencil/llms.txt

Use this file to discover all available pages before exploring further.

The OpenPencil CLI provides headless access to .fig file operations — inspect, search, analyze, and render design files from the command line.

Installation

bunx @open-pencil/cli
Or install globally:
bun add -g @open-pencil/cli

Quick Start

# Document stats, node types, fonts
bunx @open-pencil/cli info design.fig

# Visual node tree
bunx @open-pencil/cli tree design.fig

# Search by name or type
bunx @open-pencil/cli find design.fig --type TEXT

# Render to PNG
bunx @open-pencil/cli export design.fig

# JPG at 2x scale with 90% quality
bunx @open-pencil/cli export design.fig -f jpg -s 2 -q 90

Available Commands

CommandDescription
infoShow document info (pages, node counts, fonts)
treePrint the node tree
findFind nodes by name or type
nodeShow detailed properties of a specific node by ID
pagesList all pages with node counts
variablesList design variables and collections
exportExport to PNG, JPG, or WEBP
analyzeAnalyze design tokens and patterns
evalExecute JavaScript with Figma plugin API

JSON Output

All commands support --json for machine-readable output:
bunx @open-pencil/cli info design.fig --json
bunx @open-pencil/cli find design.fig --type FRAME --json
bunx @open-pencil/cli analyze colors design.fig --json

Output Formatting

CLI output uses agentfmt for consistent, readable formatting:
  • Hierarchical trees with unicode line drawing
  • Histograms with visual bars
  • Entity formatting (type, name, ID)
  • Key-value pairs
  • Color-coded summaries

Requirements

The CLI requires Bun runtime. All commands run headless — no GUI or browser needed.