openfig-cli 0.3.37 → 0.3.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +37 -55
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,86 +4,68 @@
4
4
 
5
5
  Open tools for Figma files.
6
6
 
7
- Parse, inspect, and render `.deck` and `.fig` files without the Figma application — including PNG export.
7
+ Parse, inspect, render, and modify `.deck` and `.fig` files without the Figma application.
8
8
 
9
- OpenFig is an open-source implementation of the Figma file format that allows developers to inspect, parse, and render Figma files without using the Figma application or API. The primary use case is Figma Slides (`.deck`), with `.fig` design file support also available.
9
+ ## Install
10
10
 
11
- ## Figma File Formats
11
+ ```bash
12
+ npm install -g openfig-cli
13
+ ```
12
14
 
13
- Each Figma product has its own native file format. Active development — status may change:
15
+ Node 18+. No build step. Pure ESM.
16
+
17
+ ## File Format Support
14
18
 
15
- | Product | Extension | Status |
16
- |---------|-----------|--------|
17
- | Figma Slides | `.deck` | ✅ |
18
- | Figma Design | `.fig` | ✅ read + PNG render |
19
- | Figma Jam (whiteboard) | `.jam` | ❌ not yet |
20
- | Figma Buzz | `.buzz` | ❌ not yet |
21
- | Figma Sites | `.site` | ❌ not yet |
22
- | Figma Make | `.make` | ❌ not yet |
19
+ | Product | Extension | Read | Render | Modify |
20
+ |---------|-----------|------|--------|--------|
21
+ | Figma Slides | `.deck` | ✅ | ✅ PNG / PDF | ✅ |
22
+ | Figma Design | `.fig` | ✅ | PNG / PDF | — |
23
23
 
24
24
  ## Render Quality
25
25
 
26
- OpenFig achieves **≥99% SSIM** (Structural Similarity Index) against Figma reference exports across all test cases. Render fidelity is verified with visual regression tests against real Figma-exported PNGs.
26
+ **≥99% SSIM** against Figma reference exports across all test cases:
27
27
 
28
28
  | Test suite | Visual results |
29
29
  |------------|----------------|
30
30
  | `.deck` slides | [render-report-deck.html](https://rcoenen.github.io/OpenFig/test/rasterizer/reports/openfig-render-report-deck.html) |
31
31
  | `.fig` design frames | [render-report-fig.html](https://rcoenen.github.io/OpenFig/test/rasterizer/reports/openfig-render-report-fig.html) |
32
32
 
33
- ## Why native `.deck`?
34
-
35
- Figma Slides lets you download presentations as `.deck` files and re-upload them. This is the **native** round-trip format. Exporting to `.pptx` is lossy — vectors get rasterized, fonts fall back to system defaults, layout breaks. By staying in `.deck`, you preserve everything exactly as Figma renders it.
36
-
37
- OpenFig makes this round-trip programmable. Download a `.deck`, modify it, re-upload. Everything stays native.
38
-
39
- Plug in Claude Cowork or any coding agent and you have an AI that can read and edit Figma presentations end-to-end — without ever opening the Figma UI.
40
-
41
- ## Use Cases
42
-
43
- - **AI agent for presentations** — let an LLM rewrite copy, insert images, and produce a ready-to-upload `.deck`
44
- - **Batch-produce branded decks** — start from a template, feed in data per client/project, get pixel-perfect slides out
45
- - **Inspect and audit** — understand the internal structure of any `.deck` file
46
- - **Automate** text and image placement across dozens of slides in seconds
47
-
48
- ## Install
33
+ ## CLI
49
34
 
50
35
  ```bash
51
- npm install -g openfig-cli
36
+ # Read & inspect (works on .deck and .fig)
37
+ openfig inspect deck.deck # node hierarchy tree
38
+ openfig list-text deck.deck # all text and image content per slide
39
+ openfig list-overrides deck.deck # editable override keys per symbol
40
+
41
+ # Render (works on .deck and .fig)
42
+ openfig export deck.deck # export slides/frames as PNG
43
+ openfig pdf deck.deck # export as multi-page PDF
44
+
45
+ # Modify (.deck only)
46
+ openfig update-text deck.deck -o out.deck --slide <id> --set "key=value"
47
+ openfig insert-image deck.deck -o out.deck --slide <id> --key <nodeId> --image <path>
48
+ openfig clone-slide deck.deck -o out.deck --template <id|name> --name <name> [--set key=value ...]
49
+ openfig remove-slide deck.deck -o out.deck --slide <id>
50
+ openfig roundtrip in.deck out.deck # decode + re-encode validation
52
51
  ```
53
52
 
54
- Node 18+. No build step. Pure ESM.
55
-
56
- ## File Format Support
57
-
58
- All CLI commands work on both `.deck` (Figma Slides) and `.fig` (Figma Design) files. Pass either format wherever a file path is expected.
53
+ > Full CLI reference: [docs/cli.md](docs/cli.md)
59
54
 
60
- ## Quick Start
55
+ ## Why native `.deck`?
61
56
 
62
- ```bash
63
- openfig inspect my-presentation.deck # node hierarchy
64
- openfig list-text my-presentation.deck # all text + images per slide
65
- openfig list-overrides my-presentation.deck # editable fields per symbol
66
- ```
57
+ Figma Slides lets you download and re-upload `.deck` files losslessly. Exporting to `.pptx` is lossy — vectors rasterize, fonts fall back, layout breaks. OpenFig makes this native round-trip programmable: download, modify, re-upload.
67
58
 
68
- > Full CLI reference: [docs/cli.md](docs/cli.md)
59
+ Plug in Claude Cowork or any coding agent and you have an AI that can read and edit Figma presentations end-to-end — without opening the Figma UI.
69
60
 
70
- ## Claude Cowork / MCP Integration
61
+ ## Agentic / MCP Integration
71
62
 
72
63
  > Install guide, MCP workflows, and template states: [docs/agentic/claude-cowork.md](docs/agentic/claude-cowork.md)
73
64
 
74
- ## Programmatic API
75
-
76
- ```javascript
77
- import { Deck } from 'openfig';
78
-
79
- const deck = await Deck.open('template.deck');
80
- const slide = deck.slides[0];
81
- slide.addText('Hello world', { style: 'Title' });
82
- await deck.save('output.deck');
83
- ```
65
+ ## Docs
84
66
 
85
- | Docs | |
86
- |------|---|
67
+ | | |
68
+ |---|---|
87
69
  | MCP / Claude workflows | [docs/mcp.md](docs/mcp.md) |
88
70
  | High-level API | [docs/api-spec.md](docs/api-spec.md) |
89
71
  | Low-level FigDeck API | [docs/library.md](docs/library.md) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfig-cli",
3
- "version": "0.3.37",
3
+ "version": "0.3.38",
4
4
  "description": "OpenFig — Open-source tools for Figma file parsing and rendering",
5
5
  "type": "module",
6
6
  "bin": {