{"id":33902186,"url":"https://github.com/alexey1312/exfig","last_synced_at":"2026-03-03T10:06:06.453Z","repository":{"id":328141604,"uuid":"1107935091","full_name":"alexey1312/ExFig","owner":"alexey1312","description":"ExFig — fast Figma CLI with parallel exports, batch processing \u0026 smart caching for iOS, Android \u0026 Flutter","archived":false,"fork":false,"pushed_at":"2026-01-26T13:42:25.000Z","size":3492,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-27T02:57:00.480Z","etag":null,"topics":["android","android-studio","automation","cli","design","design-system","design-tokens","figma","figma-api","figma-export","figmaapi","flutter","ios","jetpack-compose","swift","swift-ui","swiftui","tipography","xcode"],"latest_commit_sha":null,"homepage":"https://alexey1312.github.io/ExFig/","language":"Swift","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/alexey1312.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-12-01T20:01:17.000Z","updated_at":"2026-01-26T13:42:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/alexey1312/ExFig","commit_stats":null,"previous_names":["alexey1312/exfig"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/alexey1312/ExFig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexey1312%2FExFig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexey1312%2FExFig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexey1312%2FExFig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexey1312%2FExFig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexey1312","download_url":"https://codeload.github.com/alexey1312/ExFig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexey1312%2FExFig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28875446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T09:47:23.353Z","status":"ssl_error","status_checked_at":"2026-01-29T09:47:19.357Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","android-studio","automation","cli","design","design-system","design-tokens","figma","figma-api","figma-export","figmaapi","flutter","ios","jetpack-compose","swift","swift-ui","swiftui","tipography","xcode"],"created_at":"2025-12-12T00:10:51.727Z","updated_at":"2026-02-22T19:12:48.136Z","avatar_url":"https://github.com/alexey1312.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExFig\n\n[![Platforms](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Falexey1312%2FExFig%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/alexey1312/ExFig)\n[![Swift-versions](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Falexey1312%2FExFig%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/alexey1312/ExFig)\n[![CI](https://github.com/alexey1312/ExFig/actions/workflows/ci.yml/badge.svg)](https://github.com/alexey1312/ExFig/actions/workflows/ci.yml)\n[![Release](https://github.com/alexey1312/ExFig/actions/workflows/release.yml/badge.svg)](https://github.com/alexey1312/ExFig/actions/workflows/release.yml)\n[![Docs](https://github.com/alexey1312/ExFig/actions/workflows/deploy-docc.yml/badge.svg)](https://alexey1312.github.io/ExFig/documentation/exfig)\n![Coverage](https://img.shields.io/badge/coverage-49.36%25-yellow)\n[![License](https://img.shields.io/github/license/alexey1312/ExFig.svg)](LICENSE)\n\nCommand-line utility to export colors, typography, icons, and images from Figma to Xcode, Android Studio, Flutter, and\nWeb (React/TypeScript) projects.\n\nAutomatically sync your design system from Figma to code with support for Dark Mode, SwiftUI, UIKit, Jetpack Compose,\nFlutter, and React/TypeScript.\n\n## Why ExFig?\n\n- **Eliminate manual export**: Figma doesn't natively export colors and images to Xcode/Android Studio\n- **Keep design and code in sync**: Automate updates to your component library\n- **Save time**: No more manual color palette management or icon exports\n\n## Features\n\n### Design Assets\n\n- ✨ Export light \u0026 dark color palettes\n- 🎨 High contrast color support (iOS)\n- 🖼️ Icons and images with Dark Mode variants\n- 📄 PDF vector icons (resolution-independent, iOS)\n- 🖥️ iPad-specific asset variants\n- 📝 Typography with Dynamic Type support (iOS)\n- 🔄 RTL (Right-to-Left) layout support\n- 🎯 Figma Variables support\n\n### Platform Support\n\n- 📱 SwiftUI and UIKit (iOS/macOS)\n- 🔗 Figma Code Connect integration (iOS, Android)\n- 🤖 Jetpack Compose and XML resources (Android)\n- ⚠️ Android pathData validation (errors on 32,767 bytes AAPT limit)\n- 🦋 Flutter / Dart\n- 🌐 React / TypeScript (CSS variables, TSX components)\n- 🔧 Customizable code templates (Stencil)\n\n### Export Formats\n\n- 🖼️ PNG, SVG, PDF, JPEG, WebP, HEIC (with quality control)\n- 📊 W3C Design Tokens (JSON export)\n- ⚡ Quick fetch mode (no config file needed)\n\n### Performance \u0026 Reliability\n\n- ⚡ Parallel downloads \u0026 writes\n- 📦 Batch processing with shared rate limiting\n- 🔁 Automatic retries with exponential backoff\n- 💾 Checkpoint/resume for interrupted exports\n- 🕐 Version tracking (skip unchanged files)\n- 🧬 Granular cache (per-node change detection, experimental)\n\n### Developer Experience\n\n- 🤖 CI/CD ready (quiet mode, exit codes, JSON reports)\n- 🔄 [GitHub Action](https://github.com/alexey1312/exfig-action) for automated exports\n- 📊 Rich progress indicators with ETA\n- 🔇 Verbose, normal, and quiet output modes\n- 🚀 Swift 6 / Strict Concurrency\n\n\u003e **Note:** Exporting icons and images requires a Figma Professional/Organization plan (uses Shareable Team Libraries).\n\n\u003e **Tip:** For optimal PNG sizes, use oxipng (`github:shssoichiro/oxipng` via `mise use -g`) to compress exported PNG\n\u003e files after export.\n\n## Quick Start\n\n### 1. Install ExFig\n\n```bash\n# Using Homebrew (recommended)\nbrew install alexey1312/exfig/exfig\n\n# Using Mint\nmint install alexey1312/ExFig\n\n# Using mise\nmise use -g github:alexey1312/ExFig\n```\n\n### 2. Set Figma Token\n\n```bash\nexport FIGMA_PERSONAL_TOKEN=your_token_here\n```\n\nGet your token from [Figma's developer settings](https://www.figma.com/developers/api#access-tokens). For secure token\nstorage, consider using [fnox](https://github.com/jdx/fnox) instead of plain `export`.\n\n### 3. Generate Configuration\n\n```bash\nexfig init -p ios       # or: android, flutter, web\n```\n\n### 4. Configure File IDs\n\nEdit `exfig.pkl` and add your Figma file IDs:\n\n```pkl\nfigma {\n  lightFileId = \"YOUR_FIGMA_FILE_ID\"\n}\n```\n\n### 5. Export Resources\n\n```bash\n# Export individual resource types\nexfig colors             # Export colors\nexfig icons              # Export icons\nexfig images             # Export images\nexfig typography         # Export typography\n\n# Export everything at once with batch\nexfig batch exfig.pkl    # All resource types from single config\n```\n\nSee [Configuration Reference](CONFIG.md) for all available options.\n\n## What Gets Generated\n\n### iOS\n\n```\nYourProject/\n├── Assets.xcassets/\n│   ├── Colors/              # Color sets with Light/Dark variants\n│   ├── Icons/               # PDF/SVG vector icons\n│   └── Images/              # PNG images with @1x, @2x, @3x\n└── Sources/\n    ├── UIColor+extension.swift      # Type-safe color access\n    ├── Color+extension.swift        # SwiftUI colors\n    ├── UIImage+extension.swift      # Image access\n    ├── UIFont+extension.swift       # Typography\n    └── Labels/                      # Pre-configured UILabel classes\n```\n\n### Android\n\n```\napp/src/main/\n├── res/\n│   ├── values/\n│   │   ├── colors.xml               # Color definitions\n│   │   └── typography.xml           # Text styles\n│   ├── values-night/\n│   │   └── colors.xml               # Dark mode colors\n│   ├── drawable/                    # Vector icons/images\n│   └── drawable-xxxhdpi/            # Raster images (multiple DPIs)\n└── java/.../ui/exfig/\n    ├── Colors.kt                    # Compose colors\n    ├── Icons.kt                     # Compose icons\n    └── Typography.kt                # Compose text styles\n```\n\n### Flutter\n\n```\nflutter_project/\n├── assets/\n│   ├── icons/\n│   │   ├── ic_add.svg               # Light icons\n│   │   └── ic_add_dark.svg          # Dark icons\n│   └── images/\n│       ├── logo.png                 # 1x scale\n│       ├── 2.0x/logo.png            # 2x scale\n│       └── 3.0x/logo.png            # 3x scale\n└── lib/\n    └── generated/\n        ├── colors.dart              # Color constants\n        ├── icons.dart               # Icon path constants\n        └── images.dart              # Image path constants\n```\n\n## Advanced Features\n\n### Batch Processing\n\nExport all resource types (colors, icons, images, typography) from a single unified config:\n\n```bash\nexfig batch exfig.pkl                         # All resources from one config\nexfig batch exfig.pkl --cache                 # With version tracking\n```\n\nProcess multiple configuration files in parallel with shared rate limiting:\n\n```bash\nexfig batch ./configs/                        # All configs in directory\nexfig batch ios.pkl android.pkl flutter.pkl   # Specific files\nexfig batch ./configs/ --parallel 5           # Custom parallelism\nexfig batch ./configs/ --report results.json  # JSON report\n```\n\nSupports `--fail-fast`, `--resume` (checkpoint/resume), and `--cache` (version tracking). See\n[documentation](https://alexey1312.github.io/ExFig/documentation/exfig/usage) for all options.\n\n### Quick Fetch (No Config File)\n\nDownload assets directly without a configuration file:\n\n```bash\nexfig fetch -f FILE_ID -r \"Icons\" -o ./icons --format svg\nexfig fetch -f FILE_ID -r \"Images\" -o ./images --format webp --webp-quality 90\n```\n\nSupports all formats (PNG, SVG, PDF, JPEG, WebP), filtering (`--filter`), name conversion (`--name-style`), and dark\nmode variants (`--dark-mode-suffix`). Run `exfig fetch --help` for all options.\n\n### JSON Export (Design Tokens)\n\nExport Figma data as [W3C Design Tokens](https://design-tokens.github.io/community-group/format/):\n\n```bash\nexfig download colors -o tokens/colors.json\nexfig download icons -o tokens/icons.json --asset-format svg\nexfig download all -o ./tokens/\n```\n\n### Version Tracking\n\nSkip unchanged exports using Figma file version tracking:\n\n```bash\nexfig colors --cache                                    # Enable version tracking\nexfig icons --cache --experimental-granular-cache       # Per-node change detection\n```\n\nConfigure in `exfig.pkl` via `common.cache` or use CLI flags. See [CONFIG.md](CONFIG.md) for details.\n\n### Fault Tolerance\n\nAll commands include automatic retries with exponential backoff, rate limit handling (respects `Retry-After`), and\ncheckpoint/resume for interrupted exports. Configurable via `--max-retries`, `--rate-limit`, `--fail-fast`, and\n`--resume`.\n\n## GitHub Action\n\nAutomate design exports in CI/CD with [exfig-action](https://github.com/alexey1312/exfig-action):\n\n```yaml\n- uses: alexey1312/exfig-action@v1\n  with:\n    figma_token: ${{ secrets.FIGMA_TOKEN }}\n    command: icons\n    cache: true\n```\n\n## Requirements\n\n- **Swift 6.2+** (for building from source)\n- **macOS 13.0+** or **Linux (Ubuntu 22.04)**\n- **[PKL](https://pkl-lang.org/)** - Configuration language (install via `brew install pkl` or `mise use -g pkl`)\n- **Figma Personal Access Token**\n\n## Documentation\n\nComplete documentation is available at\n**[alexey1312.github.io/ExFig](https://alexey1312.github.io/ExFig/documentation/exfig)** - including getting started\nguides, platform-specific export details, design requirements, and custom templates.\n\nSee [CONFIG.md](CONFIG.md) for the full configuration reference.\n\n## Contributing\n\nWe welcome contributions! See the\n[Development Guide](https://alexey1312.github.io/ExFig/documentation/exfig/development) for setup, testing, and code\nstyle guidelines.\n\n## License\n\nExFig is available under the MIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n**[Read the full documentation](https://alexey1312.github.io/ExFig/documentation/exfig)** |\n[Report an issue](https://github.com/alexey1312/ExFig/issues) |\n[Figma API](https://www.figma.com/developers/api)\n\n---\n\n\u003csub\u003eOriginally inspired by [figma-export](https://github.com/RedMadRobot/figma-export).\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexey1312%2Fexfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexey1312%2Fexfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexey1312%2Fexfig/lists"}