openpencil/packages/cli
Danila Poyarkov cff091bc6a
test: resolve repository files without climbing directories (#946)
* test: resolve repository files without climbing directories

Twelve tests and helpers reached shared fixtures, package assets, and workers with ../.. paths from import.meta, which the import rule does not see. They now go through repoPath and testPath, a workspaceRoot() that finds the root by its lockfile, the core package's own root, or the #core alias through import.meta.resolve. The root finder derives its folder from import.meta.url, so Playwright specs running under Node can use the helpers too. open-pencil/no-deep-parent-relative-paths rejects climbing two levels in new URL(…, import.meta.url) and in path calls that start from import.meta.

* fix(lint): catch Windows separators and wrapped import.meta paths, and stop at template expressions

The path rule missed '..\..' and a base such as dirname(fileURLToPath(import.meta.url)), and read `../${folder}` followed by '..' as climbing two levels.
2026-10-07 12:35:39 +00:00
..
bin build: publish node-compatible packages 2026-05-21 17:03:19 +03:00
src feat: behaviours and preview mode (#893) 2026-10-06 13:23:05 +00:00
tests test: resolve repository files without climbing directories (#946) 2026-10-07 12:35:39 +00:00
AGENTS.md feat: control documents, history, settings, and tools from the CLI and MCP (#871) 2026-10-04 16:02:36 +00:00
package.json feat: control documents, history, settings, and tools from the CLI and MCP (#871) 2026-10-04 16:02:36 +00:00
README.md feat: behaviours and preview mode (#893) 2026-10-06 13:23:05 +00:00
tsconfig.json feat(cli): import DOM/CSS documents 2026-06-30 10:48:13 +03:00
tsdown.config.ts feat: add Figma-style variants and component libraries (#512) 2026-08-14 19:31:41 +03:00

@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 through eval with a Figma Plugin API-compatible figma global and an openpencil global for what OpenPencil adds, such as component behaviours and slots.

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.

MIT License.