* feat(cli): export Storybook stories beside many documents Accept several documents, or a quoted glob such as 'src/**/*.pen', and add --beside to write each document's stories, design images, and manifest into the document's own folder, next to the component's code. Documents export one after another, since documents in one folder share its manifest; a failed document is reported and the rest still export. --watch covers every matched document through one queue. Several documents need --beside or --output, and --page takes a single document. Refs #727 * fix(cli): resolve Storybook export documents by existence, not glob syntax Deciding between a path and a pattern by looking for glob characters missed extglobs, so 'src/+(a|b).pen' was opened as a literal filename, and it flagged an escaped star, so a file genuinely named that way went to the matcher. The character list also could not agree with Node's matcher: is-glob rejects a bare '?', picomatch accepts a parenthesised directory name. An existing path is now that file, and everything else goes to glob(), which matches a plain path to itself and expands every pattern it supports. --------- Co-authored-by: Danila Poyarkov <dev@dannote.net> |
||
|---|---|---|
| .. | ||
| bin | ||
| src | ||
| tests | ||
| AGENTS.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| tsdown.config.ts | ||
@open-pencil/cli
Headless command line for OpenPencil and .fig files: inspect documents and layers, query with XPath, export to PNG, JPG, WEBP, SVG, PDF, PPTX, JSX, HTML, or .fig, import HTML/CSS/Tailwind, lint design files, analyze and extract design tokens, and script documents with a Figma Plugin API-compatible figma global through eval.
npm install -g @open-pencil/cli # or: bun add -g @open-pencil/cli
openpencil --help
openpencil eval design.fig -c "return figma.currentPage.children.length"
Inspection commands support --json for automation. The MCP server ships separately as @open-pencil/mcp.
- CLI reference: https://openpencil.dev/programmable/cli/inspecting
- Scripting with the Plugin API: https://openpencil.dev/programmable/cli/scripting
- Source and issues: https://github.com/open-pencil/open-pencil
MIT License.