{"id":28199056,"url":"https://github.com/alexchantastic/figma-export","last_synced_at":"2025-05-16T18:15:14.547Z","repository":{"id":241835483,"uuid":"802286494","full_name":"alexchantastic/figma-export","owner":"alexchantastic","description":"A CLI tool to bulk export Figma, FigJam, and Figma Slides files","archived":false,"fork":false,"pushed_at":"2025-03-29T17:41:05.000Z","size":71,"stargazers_count":73,"open_issues_count":4,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T18:32:07.657Z","etag":null,"topics":["cli","figjam","figma","figma-slides","playwright"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexchantastic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-17T22:40:56.000Z","updated_at":"2025-03-29T17:39:41.000Z","dependencies_parsed_at":"2024-06-04T01:43:32.627Z","dependency_job_id":"ff4b5793-7b3d-4e77-81dc-655a5faa8468","html_url":"https://github.com/alexchantastic/figma-export","commit_stats":null,"previous_names":["alexchantastic/figma-export"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexchantastic%2Ffigma-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexchantastic%2Ffigma-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexchantastic%2Ffigma-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexchantastic%2Ffigma-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexchantastic","download_url":"https://codeload.github.com/alexchantastic/figma-export/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582927,"owners_count":22095520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","figjam","figma","figma-slides","playwright"],"created_at":"2025-05-16T18:15:05.757Z","updated_at":"2025-05-16T18:15:14.540Z","avatar_url":"https://github.com/alexchantastic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# figma-export\n\nfigma-export is a CLI tool for bulk exporting Figma, FigJam, and Figma Slides files to your local desktop in Figma's proprietary `.fig`/`.jam`/`.deck` format. figma-export supports downloading by team, project, and even drafts.\n\nThis tool leverages [Figma's REST API](https://www.figma.com/developers/api) and [Playwright](https://playwright.dev/) to automate discovering Figma files and downloading them.\n\n\u003e [!NOTE]\n\u003e If you are a complete beginner to the terminal and CLI tools, please refer to the [Complete beginner guide](https://github.com/alexchantastic/figma-export/wiki/Complete-beginner-guide) in the wiki.\n\n## Table of contents\n\n- [Requirements](#requirements)\n- [Installation](#Installation)\n- [Usage](#usage)\n- [Commands](#commands)\n- [Known issues](#known-issues)\n\n## Requirements\n\n- node (v20 LTS)\n- npm (v10 LTS)\n\nOther versions may work, but have not been officially tested.\n\nYou will also need a [Figma access token](https://www.figma.com/developers/api#authentication) with scope access to **file content** that you can generate through your Figma user profile settings.\n\n\u003e [!NOTE]\n\u003e You must disable opening links in the Figma desktop app in order for downloads to work. See the [Figma docs](https://help.figma.com/hc/articles/360039824334-Open-links-in-the-desktop-app#h_01HW8HDP9DN3HTMQ65XQMXR88A) on how to disable this setting.\n\n## Installation\n\n1. Clone the repository or download the latest release\n2. `cd` into the repository\n3. Run `npm install`\n\n## Usage\n\n### Environment variables\n\nCreate a `.env` file at the root of the repository:\n\n```sh\nFIGMA_EMAIL=\"email@example.com\"\nFIGMA_PASSWORD=\"hunter2\"\nFIGMA_ACCESS_TOKEN=\"figd_abcdefghijklmnopqrstuvwxyz\"\nDOWNLOAD_PATH=\"/Users/anonymous/Downloads\" # Absolute path where files will be downloaded to\nWAIT_TIMEOUT=10000 # Time in ms to wait between downloads (defaults to 10000)\n```\n\n\u003e [!CAUTION]\n\u003e Figma has started to implement anti-automation detection which may cause issues with using this tool. It is recommended that you do not set a lower `WAIT_TIMEOUT` than `10000`. To be on the safer side, you may want to increase it even further.\n\nIf you are using SSO to log in to Figma, you can either manually set a password (see [wiki](https://github.com/alexchantastic/figma-export/wiki/Manually-setting-a-Figma-password)) _or_ you can provide your Figma auth session cookie through `FIGMA_AUTH_COOKIE` in lieu of `FIGMA_EMAIL` and `FIGMA_PASSWORD`:\n\n```sh\nFIGMA_AUTH_COOKIE=\"my-auth-cookie-value\"\nFIGMA_ACCESS_TOKEN=\"figd_abcdefghijklmnopqrstuvwxyz\"\nDOWNLOAD_PATH=\"/Users/anonymous/Downloads\"\nWAIT_TIMEOUT=10000\n```\n\nThe value for `FIGMA_AUTH_COOKIE` should be the value of the `__Host-figma.authn` cookie. Please refer to the [wiki](https://github.com/alexchantastic/figma-export/wiki/Getting-your-Figma-auth-session-cookie) on how to grab this value.\n\n### Generating files.json\n\n`files.json` determines which Figma files within your account will be downloaded.\n\n\u003e [!TIP]\n\u003e Drafts are just a hidden project in Figma so you can absolutely download them with figma-export. Check out the [wiki](https://github.com/alexchantastic/figma-export/wiki/Downloading-draft-files) to learn about how to grab the drafts project ID.\n\nIt is recommended that you use one of the built-in commands to generate `files.json`:\n\n- `npm run get-team-files {team_ids ...}` - Gets all files for all projects within given team IDs (space separated)\n  - Example: `npm run get-team-files 12345 67890`\n- `npm run get-project-files {project_ids ...}` - Gets all files for given project IDs (space separated)\n  - Example: `npm run get-project-files 12345 67890`\n\nTo find your Figma team ID, navigate to your [Figma home](https://www.figma.com/files/), right click your team in the left sidebar, and then click **Copy link**. The last segment of the URL that you copied will contain your team ID: `https://www.figma.com/files/team/1234567890`.\n\nTo find a project ID, navigate to your team's home, right click the project, and then click **Copy link**. The last segment of the URL that you copied will contain the project ID: `https://www.figma.com/files/project/1234567890`.\n\nYou are free to manually construct this file as long as it follows this structure:\n\n```json\n[\n  {\n    \"name\": String,\n    \"id\": String,\n    \"team_id\": String?,\n    \"files\": [\n      {\n        \"key\": String,\n        \"name\": String\n      },\n      ...\n    ]\n  },\n  ...\n]\n```\n\nThis is a modified structure from the return value of [Figma's GET project files](https://www.figma.com/developers/api#get-project-files-endpoint) endpoint.\n\n### Starting the downloads\n\nOnce you have generated `files.json`, you can then run `npm run start` to start the downloads. The status of each download will be shown in the console.\n\nEach file will be downloaded to your specified `DOWNLOAD_PATH` in a folder named with the project's name and ID. Each file will be saved as the file's name and ID (key). The folder structure will look something like this:\n\n```\nProject A (12345)/\n├── File X (123).fig\n└── File Y (456).fig\nProject B (67890)/\n└── File Z (789).fig\n```\n\nIf you ran `get-team-files`, your `files.json` will also have references to the team ID(s) so projects will be placed in a folder named after the team ID. In which case, the folder structure will look something like this:\n\n```\n1029384756/\n├── Project A (12345)/\n│   ├── File X (123).fig\n│   └── File Y (456).fig\n└── Project B (67890)/\n    └── File Z (789).fig\n5647382910/\n└── Project C (45678)/\n    └── File W (012).fig\n```\n\n### Parallel downloads\n\nParallel downloads are disabled by default. To enable them, update the following properties in `playwright.config.ts`:\n\n```ts\nexport default defineConfig({\n  ...\n  fullyParallel: true,\n  workers: 3, // The maximum number of parallel downloads\n  ...\n});\n```\n\n\u003e [!CAUTION]\n\u003e It is not advised to use parallel downloads as Figma has started to invoke anti-automation safe guards.\n\n### Retrying failed downloads\n\nIf you encounter downloads that fail, you can attempt to re-run _only_ those failed downloads using the `npm run retry` command.\n\nNote that downloads may fail due to any number of reasons, but typically it is due to reaching the Playwright timeout. You can increase this timeout by updating the `timeout` configuration in `playwright.config.ts`.\n\n## Commands\n\nThe following commands are available via `npm run`:\n\n| Command             | Description                                     |\n| ------------------- | ----------------------------------------------- |\n| `get-team-files`    | Generates `files.json` from Figma team ID(s)    |\n| `get-project-files` | Generates `files.json` from Figma project ID(s) |\n| `start`             | Starts downloads                                |\n| `retry`             | Retries failed downloads from last run          |\n| `dry-run`           | Lists files that will be downloaded             |\n| `report`            | Show an HTML report of the last run             |\n\nAt any time, you can press `ctrl+c` to stop a command.\n\n## Known issues\n\n- Two-factor authentication is not supported (suggest temporarily disabling two-factor authentication)\n- You must have editor access to a file in order to download it\n- Some downloads may take a long time (large file size, slow internet connection, etc.) which can trigger the Playwright timeout and lead to a failed download (suggest increasing the `timeout` in `playwright.config.ts`)\n- Figma will invoke anti-automation measures based off of how many files you download (suggest using a `WAIT_TIMEOUT` of at least `10000`)\n- If you have the setting for opening links in the Figma desktop app enabled, downloads will not start (suggest [disabling the setting](https://help.figma.com/hc/articles/360039824334-Open-links-in-the-desktop-app#h_01HW8HDP9DN3HTMQ65XQMXR88A))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexchantastic%2Ffigma-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexchantastic%2Ffigma-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexchantastic%2Ffigma-export/lists"}