This guide helps users migrate from figma-export to ExFig.
ExFig v2 uses PKL configuration instead of YAML. To migrate:
- Generate a new PKL config for your platform:
exfig init -p ios # or android, flutter, web - Copy your settings from
figma-export.yamlinto the generatedexfig.pkl - Run exports as before:
exfig colors -i exfig.pkl exfig icons -i exfig.pkl exfig images -i exfig.pkl
| figma-export | ExFig | Notes |
|---|---|---|
figma-export colors |
exfig colors |
Same functionality |
figma-export icons |
exfig icons |
Same functionality |
figma-export images |
exfig images |
Same functionality |
figma-export typography |
exfig typography |
Same functionality |
figma-export init --platform ios |
exfig init -p ios |
Generates PKL config |
| — | exfig batch |
New: Process multiple configs |
| — | exfig download |
New: JSON export (W3C tokens) |
ExFig v2 uses PKL (Programmable, Scalable, Safe) instead of YAML. YAML configs are no longer supported.
Config discovery: ExFig looks for exfig.pkl in the current directory. Use -i to specify a custom path.
Skip exports when Figma file hasn't changed:
import ".exfig/schemas/Common.pkl"
common = new Common.CommonConfig {
cache = new Common.Cache {
enabled = true
path = ".exfig-cache.json"
}
}CLI flags:
--cache— Enable version tracking--force— Ignore cache, always export--experimental-granular-cache— Track per-node changes (even more efficient)
import ".exfig/schemas/Flutter.pkl"
flutter = new Flutter.FlutterConfig {
output = "./lib/generated"
colors = new Listing {
new Flutter.ColorsEntry {
colorDart = "colors.dart"
className = "AppColors"
}
}
icons = new Listing {
new Flutter.IconsEntry {
output = "assets/icons"
dartFile = "icons.dart"
className = "AppIcons"
}
}
images = new Listing {
new Flutter.ImagesEntry {
output = "assets/images"
dartFile = "images.dart"
className = "AppImages"
format = "png"
scales = new Listing { 1; 2; 3 }
}
}
}import ".exfig/schemas/Web.pkl"
web = new Web.WebConfig {
output = "./src/tokens"
colors = new Listing {
new Web.ColorsEntry {
cssFileName = "theme.css"
tsFileName = "variables.ts"
jsonFileName = "tokens.json"
}
}
icons = new Listing {
new Web.IconsEntry {
outputDirectory = "./src/icons"
svgDirectory = "assets/icons"
generateReactComponents = true
}
}
images = new Listing {
new Web.ImagesEntry {
outputDirectory = "./src/images"
assetsDirectory = "assets/images"
generateReactComponents = true
}
}
}Export assets from multiple Figma frames in a single config using PKL Listing:
import ".exfig/schemas/iOS.pkl"
ios = new iOS.iOSConfig {
xcodeprojPath = "MyApp.xcodeproj"
target = "MyApp"
xcassetsPath = "MyApp/Resources/Assets.xcassets"
icons = new Listing {
new iOS.IconsEntry {
figmaFrameName = "Actions"
format = "svg"
assetsFolder = "Actions"
nameStyle = "camelCase"
imageSwift = "./Generated/ActionsIcons.swift"
}
new iOS.IconsEntry {
figmaFrameName = "Navigation"
format = "svg"
assetsFolder = "Navigation"
nameStyle = "camelCase"
imageSwift = "./Generated/NavigationIcons.swift"
}
}
}Same pattern works for colors:
ios = new iOS.iOSConfig {
// ...
colors = new Listing {
new iOS.ColorsEntry {
tokensFileId = "abc123"
tokensCollectionName = "Base Palette"
lightModeName = "Light"
darkModeName = "Dark"
useColorAssets = true
assetsFolder = "BaseColors"
colorSwift = "./Generated/BaseColors.swift"
}
new iOS.ColorsEntry {
tokensFileId = "def456"
tokensCollectionName = "Theme Colors"
lightModeName = "Light"
useColorAssets = true
assetsFolder = "ThemeColors"
colorSwift = "./Generated/ThemeColors.swift"
}
}
}Process multiple config files in parallel:
exfig batch ./configs/
exfig batch ./configs/ --parallel 4
exfig batch ./configs/ --cache --experimental-granular-cacheExport Figma data as JSON for custom pipelines:
exfig download colors -o tokens/colors.json
exfig download icons -o tokens/icons.json --asset-format svg
exfig download all -o ./tokens/Output follows W3C Design Tokens specification:
{
"Background": {
"Primary": {
"$type": "color",
"$value": {
"Light": "#ffffff",
"Dark": "#1a1a1a"
}
}
}
}ExFig adds more nameStyle options:
| Style | Example |
|---|---|
camelCase |
myIconName |
snake_case |
my_icon_name |
PascalCase |
MyIconName |
kebab-case |
my-icon-name |
SCREAMING_SNAKE_CASE |
MY_ICON_NAME |
All commands support retry and rate limiting:
exfig icons --max-retries 6 --rate-limit 15 --timeout 90
exfig icons --concurrent-downloads 50 # Increase CDN parallelism- Run
exfig init -p <platform>to generate a freshexfig.pkl - Copy your Figma file IDs, frame names, and other settings from
figma-export.yamlintoexfig.pkl - Add new sections as needed (cache, additional platforms)
- Verify with
pkl eval --format json exfig.pkl(requires local schemas viaexfig schemas) - Run your export commands and compare output
- YAML configs removed — ExFig v2 uses PKL exclusively. Migrate your
figma-export.yaml/exfig.yamltoexfig.pkl. exfig migratecommand removed — useexfig initto generate a fresh PKL config and manually transfer your settings.- Config discovery changed — ExFig no longer searches for
figma-export.yamlorexfig.yaml. Onlyexfig.pklis auto-detected.
- Configuration reference: CONFIG.md
- PKL guide: PKLGuide
- Migration guide (YAML to PKL): Migration
- Issues: GitHub Issues