Skip to content

Repository files navigation

Leer en español

figtools

Tools for working with Figma data without the limitations of a free account: no official REST API rate limits, no Dev Mode plan required. This repo is a monorepo with pnpm workspaces — each tool is published as an independent package under the @figtools scope.

Packages

Package What it does
@figtools/core Fetches the data of a Figma node or file (position, size, styles, hierarchy) programmatically. Currently includes the core and its adapters (Playwright); see its ADR for the ports design that lets other mechanisms (REST API, plugin, network interception) be added without touching it.
@figtools/cli Resolves one or more Figma URLs from the command line and writes the result as JSON or as a navigable markdown tree meant to be used by an LLM as a data source. See its ADR for how it orchestrates @figtools/core.

Roadmap: an MCP server (@figtools/mcp) as its own package consuming @figtools/core, and eventually extracting the adapters into independent packages (@figtools/adapter-playwright, @figtools/adapter-rest) if the core ends up supporting more than one mechanism at a time.

Installation

Install the package you need with your package manager:

npm install @figtools/core
# or
npm install -g @figtools/cli

@figtools/core declares playwright as a peer dependency — install it in your project too (npm install playwright) if you're going to use PlaywrightFigmaGateway or PlaywrightLogin.

Examples

import {
  createFigmaScraperCore,
  PlaywrightFigmaGateway,
  PlaywrightLogin,
  CookieSessionStore,
} from "@figtools/core";

const core = createFigmaScraperCore({
  sessionStore: new CookieSessionStore(),
  interactiveLogin: new PlaywrightLogin(),
  gateway: new PlaywrightFigmaGateway(),
});

// same method regardless of whether it's the first use, the session
// expired, or it's still valid — resolveUrl decides internally what to do
// with the session.
const result = await core.resolveUrl(
  "https://www.figma.com/design/ABC123/My-Design?node-id=1-23"
);

if (!result.ok) {
  console.error(result.error.code, result.error.message);
} else if ("nodes" in result.value) {
  console.log("page:", result.value.name, result.value.nodes.length);
} else {
  console.log("node:", result.value.type, result.value.children.length);
}

Or from the command line, with @figtools/cli:

figtools "https://www.figma.com/design/ABC123/My-Design?node-id=1-23"

See each package's own README for full installation, usage, and troubleshooting details.

Additional resources

License

MIT

About

Tools for scraping Figma node and file data (position, size, styles, hierarchy) without free-account limits — no REST API rate limits, no Dev Mode

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages