Windcraft

CLI reference

Every windcraft command, its flags, and what it writes.

Every command supports --help. --json on commands that produce output gives machine-readable JSON.

The bundle is a single file under 1 MB. Distributed via npm; run with npx windcraft — no global install needed.

windcraft login

Authorize this machine for a project.

windcraft login [--api-key <key> --project-id <uuid>]

Without flags, opens a browser to /cli-auth?code=… and polls for up to 5 minutes. Stores credentials at ~/.windcraft/credentials (chmod 600).

windcraft logout

windcraft logout

Clears stored credentials. Idempotent — exits 0 with an info line when nothing is stored.

windcraft whoami

windcraft whoami [--json]

Shows the active project + key prefix. Exits 1 when not signed in.

windcraft init

windcraft init [--yes] [--cwd <path>]

Detects package.json, git remote, tailwind.config, Expo, CSS entry. Writes .windcraft/config.json, adds .windcraft/backups/ and .windcraft/cache.json to .gitignore, pulls the initial sync.

windcraft sync

windcraft sync [--json] [--force-dirty] [--commit] [--watch] [--watch-interval <s>]

Pulls the manifest and writes the generated files atomically with SHA-256 comparison; skips no-ops; backs up to .windcraft/backups/<iso>-<file>. Warns when the working tree is dirty.

  • --commit stages and commits files written by this run as a chore(windcraft): sync vN commit.
  • --watch keeps the CLI open and re-runs sync whenever the cloud manifest version changes (default poll interval 30s, min 5s).

windcraft check

windcraft check [--json] [--fix] [--no-cache] [--workers <n>]

Runs the static analyzer over .tsx / .jsx files matched by the include patterns from .windcraft/config.json. Exits 1 on errors, 0 on warnings or clean.

  • --fix applies edits where rules implement fix().
  • --no-cache skips the persistent .windcraft/cache.json.
  • --workers <n> runs parsing in N Piscina worker threads — useful for

    500-file projects. Also honours WINDCRAFT_WORKERS.

windcraft mcp

windcraft mcp [--http <port>] [--host <addr>]

Run as an MCP server. Default transport is stdio — add to ~/.cursor/mcp.json or ~/.claude.json.

  • --http <port> exposes a Streamable HTTP transport on <host>:<port> (default host 127.0.0.1) for remote consumers.

Exposes 6 tools (get_design_tokens, get_component_contract, get_design_rules, validate_component_code, get_platform_mirror, get_page_pattern) and 4 resources (windcraft://project/tokens|contracts|rules|patterns). Manifest cached 60s with stale fallback on API outage.

Configuration file

.windcraft/config.json lives at your repo root:

{
  "projectId": "…",
  "include": ["app/**/*.tsx", "src/**/*.tsx"],
  "exclude": ["**/*.stories.tsx", "**/*.test.*"],
  "outputs": {
    "tailwind": "tailwind.config.ts",
    "cssVars": "app/globals.css",
    "rnTheme": "theme.ts",
    "tsTypes": "windcraft.types.d.ts",
    "tokens": "windcraft.tokens.json",
    "claudeSkill": ".claude/skills/windcraft.md"
  }
}

Set any output to null to skip writing that file.

On this page