CLI

The stoaken command connects a project to a Brand and writes its live tokens as files you commit.

Connect a project

Terminal
npx stoaken init

It asks how to sign in (browser, or paste an API key from Settings > API keys) and which Brand the project is for, then writes stoaken.config.json (commit it), .stoaken/credentials.json (already git-ignored) and a skill file that tells AI agents how to work with your tokens.

Export tokens

Terminal
npx stoaken export --theme Default --format css --out src/tokens.css
npx stoaken export --format compose --mode color-scheme:dark --out app/src/main/java/Tokens.kt
OptionWhat it does
--themeTheme name or id (needed when the Brand has more than one).
--formatOne of css, css-auto, json-dtcg, json-sd4, js, ts, scss, tailwind, tailwind4, swift, compose, android. See export formats.
--modeA mode combination for one-mode formats, e.g. color-scheme:dark.
--prefixCSS: a prefix for every variable name.
--releaseA release id instead of the theme's live release.
--outFile to write, or - for stdout.
--checkWrite nothing; exit 1 if the file on disk is out of date.

Files have no timestamps, so a re-export with no token changes produces no diff.

Saved targets

List targets in stoaken.config.json and run npx stoaken export with no options to write them all:

stoaken.config.json
{
  "brandId": "…",
  "brandName": "Acme",
  "serverUrl": "https://stoaken.com",
  "exports": [
    { "theme": "Default", "format": "css-auto", "out": "src/tokens.css" },
    { "theme": "Default", "format": "swift", "mode": "color-scheme:dark", "out": "ios/TokensDark.swift" }
  ]
}

In CI

Create an API key, store it as a secret named STOAKEN_TOKEN, and fail the build when committed tokens are behind the live release:

.github/workflows/tokens.yml
name: Tokens up to date
on: [pull_request]
jobs:
  tokens:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npx stoaken export --check
        env:
          STOAKEN_TOKEN: ${{ secrets.STOAKEN_TOKEN }}