Skip to main content
Home

Built and signed on GitHub Actions

It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
88%
Published
3 months ago (0.1.4)

figma cli

a command line tool to copy figma nodes as images to your clipboard.

currently, it has three commands:

# copy a figma node to your clipboard
figma node copy "https://www.figma.com/design/FILE_ID/DESIGN_NAME?node-id=NODE_ID&t=HASH"

# export a figma node to a file
figma node export "https://www.figma.com/design/FILE_ID/DESIGN_NAME?node-id=NODE_ID&t=HASH"

# get the direct image URL for a figma node
figma node url "https://www.figma.com/design/FILE_ID/DESIGN_NAME?node-id=NODE_ID&t=HASH"

see full info in docs/usage.md

Tip

Copy usage.md to your ~/.claude/CLAUDE.md or other global llm rules file to allow llm coding tools to use this

installation

  1. install deno
  2. install the package
    deno install -A -g --force jsr:@schpet/figma-cli
    

it should be available on your $PATH, if that fails, check deno's docs.

development installation

if you're working from source:

deno task install

setup

1. get a figma personal access token

  1. go to figma and click on your profile picture in the top right
  2. select "settings" from the dropdown
  3. scroll down to the "personal access tokens" section
  4. click "create new token"
  5. give it a name (like "figma-cli")
  6. set the expiration (max 90 days currently)
  7. copy the token that starts with figd_

2. set environment variable

add your token to your shell profile:

bash/zsh (.bashrc, .zshrc, or .profile):

export FIGMA_PERSONAL_ACCESS_TOKEN="figd_your_token_here"

after adding it, reload your shell:

source ~/.bashrc  # or ~/.zshrc, ~/.profile

fish:

set -Ux FIGMA_PERSONAL_ACCESS_TOKEN "figd_your_token_here"

usage

copy a figma node

figma node copy "https://www.figma.com/design/FILE_ID/DESIGN_NAME?node-id=NODE_ID&t=HASH"

this will:

  1. download the image to a temporary directory
  2. copy it to your clipboard (macos only)
  3. show you where the file was saved

commands

  • figma node copy <url> - copy a figma node as an image to clipboard
  • figma node export <url> - export a figma node to a temporary file
  • figma node url <url> - get the direct image URL for a figma node
  • figma --help - show help information
  • figma node --help - show node command help

requirements

  • deno
  • macos (for clipboard functionality - images are still downloaded on other platforms)
  • figma personal access token
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@schpet/figma-cli

Import symbol

import * as figma_cli from "@schpet/figma-cli";
or

Import directly with a jsr specifier

import * as figma_cli from "jsr:@schpet/figma-cli";

Add Package

pnpm i jsr:@schpet/figma-cli
or (using pnpm 10.8 or older)
pnpm dlx jsr add @schpet/figma-cli

Import symbol

import * as figma_cli from "@schpet/figma-cli";

Add Package

yarn add jsr:@schpet/figma-cli
or (using Yarn 4.8 or older)
yarn dlx jsr add @schpet/figma-cli

Import symbol

import * as figma_cli from "@schpet/figma-cli";

Add Package

vlt install jsr:@schpet/figma-cli

Import symbol

import * as figma_cli from "@schpet/figma-cli";

Add Package

npx jsr add @schpet/figma-cli

Import symbol

import * as figma_cli from "@schpet/figma-cli";

Add Package

bunx jsr add @schpet/figma-cli

Import symbol

import * as figma_cli from "@schpet/figma-cli";