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 initIt 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| Option | What it does |
|---|---|
--theme | Theme name or id (needed when the Brand has more than one). |
--format | One of css, css-auto, json-dtcg, json-sd4, js, ts, scss, tailwind, tailwind4, swift, compose, android. See export formats. |
--mode | A mode combination for one-mode formats, e.g. color-scheme:dark. |
--prefix | CSS: a prefix for every variable name. |
--release | A release id instead of the theme's live release. |
--out | File to write, or - for stdout. |
--check | Write 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 }}