Skip to main content

Pull Figma files into agent-readable local folders

Project description

ExtraFigma

A pull-only CLI that converts Figma files into agent-readable local folders. Drop the output into your project and let Claude Code (or any AI coding agent) implement pixel-perfect frontend code from the design.

Install

pip install extrafigma
# or
uvx extrafigma --help

Quick start

extrafigma pull "https://www.figma.com/design/abc123/My-App" ./my-design

On first run you'll be prompted for a Figma Personal Access Token. Get one at Figma → Settings → Security → Personal Access Tokens (scopes needed: file_content:read, file_metadata:read).

The token is stored at ~/.config/extrafigma/credentials.json and reused for all future pulls.

What gets extracted

my-design/
  CLAUDE.md               ← instructions for AI agents
  index.md                ← overview of all pages and frames
  tokens/
    colors.json           ← named color styles → hex values
    typography.json       ← named text styles → font properties
  assets/
    icon-name.svg         ← exported SVG icons (VECTOR nodes)
  pages/
    Page-1/
      page.md
      Hero.frame.json     ← distilled layout tree (CSS-friendly)
      Hero.png            ← 2× frame render (visual ground truth)

frame.json structure

Every frame is distilled to a CSS-friendly layout tree:

{
  "type": "FRAME",
  "name": "Hero",
  "width": 1440,
  "height": 900,
  "layout": { "mode": "flex", "direction": "column", "gap": 24 },
  "background": "colors/brand-primary",
  "borderRadius": 0,
  "children": [
    {
      "type": "TEXT",
      "content": "Welcome",
      "style": "typography/heading-xl",
      "color": "colors/gray-800"
    }
  ]
}

Named Figma Styles become tokens (colors/brand-primary, typography/heading-xl). Raw hex values that weren't saved as styles are flagged with # not in tokens.

Auth commands

extrafigma auth login               # interactive prompt
extrafigma auth login --pat <token> # non-interactive (CI-friendly)
extrafigma auth status              # check stored PAT
extrafigma auth logout              # remove stored PAT

Rate limits

Figma's REST API limits GET /v1/files calls based on your seat type:

Seat Limit
View / Collab 6 per month
Dev / Full (Starter) 10 per minute
Dev / Full (Professional) 15 per minute

Use an account with an editor seat on the file for meaningful usage.

Known limitations

  • Design tokens require named Figma Styles. If the designer applied colors directly without saving them as named styles, tokens will be empty. Variables (Figma Professional+) are not supported — use Styles instead.
  • SVG export skips remote library components. Icons that are instances of components from external shared libraries cannot be exported via the REST API. They'll appear as INSTANCE nodes in the frame JSON.
  • x/y positions are canvas-space coordinates. For absolute-layout frames, subtract the parent's x/y to get relative positions.

How it works

  1. GET /v1/files/:key — fetches the full document tree
  2. Batch-fetches style node data to resolve exact color/font values
  3. Distills each top-level frame to a CSS-friendly JSON tree
  4. Exports frame PNGs at 2× resolution
  5. Exports VECTOR nodes as SVGs in a second pass

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

extrafigma-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

extrafigma-0.1.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file extrafigma-0.1.0.tar.gz.

File metadata

  • Download URL: extrafigma-0.1.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for extrafigma-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94dda32e3c1f81f0ca02ca02ea56c220b9af91cf8fb409a5459c914761ca8747
MD5 cdfaca92c8da6cd81f98bb9fd31d6302
BLAKE2b-256 cb46906bce20a8cf671c2bf334c5ecf4d3136be38f76d3dda042c2b522376cc2

See more details on using hashes here.

File details

Details for the file extrafigma-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: extrafigma-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for extrafigma-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6284a5d16aae42b3004c5cf8b6ed882ae3e8a23def5ec516e48a3673717eae7f
MD5 5b46ac22223ad43231962eee34572f14
BLAKE2b-256 2d6b6a44526b1523d49d97fd78dfbd99de80014d6a872bee5c5d00cb4f9fea6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page