The design system lives in Figma; Den CLI brings it into code — the theme into managed // @theme blocks, icons into assets/svgs — sharing credentials and version state with the VS Code extension.
1yarn global add @fewbox/den-cli1yarn global remove @fewbox/den-cliThe same package exports five generators — denc / denp / denr / dene / dena (component, page, reducer, epic, action) — for the Den UI library.
The design lives in Figma, the code lives in the repo, and the two used to be copied by hand. Now the plugin publishes the design system as one package (theme + icons + brand) and den sync writes it into the project — the same tokens both drive the style variables and select the icon set. A different person, machine or CI run gets the same result.
Packages are keyed by Figma file: one personal package and one per organization, independent of each other.
1den loginDevice-code sign-in (RFC 8628): the terminal shows a code and the browser confirms it once. The token is stored in ~/.fewbox/credentials.json (0600), keyed by account origin, and refreshed automatically.
1den logoutClears the token for the current account origin on this machine only. The browser session is left alone — it is shared with every other FewBox product.
Output follows the real Den CLI format (timestamps vary per run); organization ids come from myOrganizations.
1den profileShows the signed-in account, the account origin, the gateway, the credentials file, and every organization you belong to with its id. Pass the id to den packages use --org <id>.
1den packages
2den packages use <fileKey> [--org <id>]Lists the packages you can pull, keyed by Figma file. use writes the selection to .fewbox/figma.json, which the next den sync reads.
.fewbox/figma.json is kept out of git by default — teammates cannot pull your personal package. To share, publish an organization package and use --org.
1den sync
2den sync --dry-runWrites the package's theme and icons into the current project. Start with --dry-run to see the changes: + create, ~ update, = unchanged; drop the flag to write.
Switch packages on the fly with --package <fileKey>; organization packages with --org <id>. --figma is the legacy path (reads the Figma REST API, needs FIGMA_TOKEN) for files without a published package.
Versions, paths and line counts are examples; the format matches the CLI.
The theme only rewrites the lines between // @theme:<id> and // @theme:end in style/_variables.scss — nothing outside the markers is touched. Missing markers mean nothing is written, and the missing blocks are listed.
Icons are written to assets/svgs/<name>.svg, named exactly as Figma exports them; fills are switched to currentColor so they work on light and dark themes.
The selection is decided by "--only > .fewbox/icons.json and code references > everything in the package". Names starting with 🚧 / wip / draft are always skipped.
Progress lives in .fewbox/design-system.json (one version per block) and is shared with the VS Code extension — the "update available" hint is the same check.
Old icon files that were not selected this run are kept by default; --prune deletes them.
Do not run device-code sign-in in CI: set FEWBOX_TOKEN and commands use it as-is — never stored, never refreshed. Point FEWBOX_ACCOUNTS / FEWBOX_GATEWAY at a private deployment when needed.
The same three variables are the switch for private deployments; accounts and gateway fall back to the official environment when unset.
The fb scaffold already ships the // @theme markers. Hand-maintained style files need them added by hand. Markers come in pairs; a missing one skips the whole file.
// @theme:colors
$primary: #e7b516;
$secondary: #353535;
// @theme:end
// @theme:font-size
$normal: 1rem;
$small: $normal * 0.8;
// @theme:end