This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
bun run src/index.ts # show help
bun run src/index.ts domain add myapp -p proj # human output
bun run src/index.ts domain add myapp -p proj --json --domain crafter.ing # agent output
bun run src/index.ts domain add myapp -p proj --dry-run --json # preview
bun run src/index.ts schema domain.add --json # introspect command
bun run src/index.ts schema --json # list all commands
bun run src/index.ts mcp # start MCP server
bun run src/index.ts tui # interactive TUIAgent-first CLI (crafters) for managing Crafter Station infrastructure. Built with Bun + citty framework.
src/
├── index.ts # Entry point, subcommand routing
├── commands/
│ ├── domain.ts # domain add/remove/list (--json, --domain, --dry-run)
│ ├── agent.ts # agent list/info/setup/status/doctor
│ ├── claude.ts # claude install/update (syncs claude-dx + local skills)
│ ├── projects.ts # projects sync (GitHub metadata)
│ ├── login.ts # login/logout/whoami
│ └── schema.ts # schema introspection for agents
├── lib/
│ ├── output.ts # Dual output: human (clack) vs JSON (structured)
│ ├── common-args.ts # Shared --json and --domain flags
│ ├── validate.ts # Input hardening (subdomain, domain, project slug)
│ ├── errors.ts # Typed error codes + CraftersError class
│ ├── command-registry.ts # Command tree for schema introspection
│ ├── config.ts # Config file (~/.crafters/config.json)
│ ├── spaceship.ts # Spaceship DNS API client
│ ├── vercel.ts # Vercel SDK wrapper
│ ├── domain-ops.ts # Domain orchestration (Vercel + DNS + Clerk)
│ ├── claude-ops.ts # Claude DX sync (commands, agents, skills)
│ └── agent-ops.ts # Kai executor management
├── mcp/
│ └── server.ts # MCP server over stdio
├── tui/ # Interactive TUI (OpenTUI/Solid.js, secondary)
└── ui/ # Shared colors
- All commands support
--jsonfor structured output:{ ok: boolean, data: T, error?: { code, message } } --domainflag overrides base domain (crafter.run vs crafter.ing)--dry-runon mutating commands previews actions without executingcreateOutput({ json })auto-detects TTY for output mode- API clients are factory functions (
createSpaceshipClient,createVercelClient) - MCP server calls
src/lib/directly (no shell-out) crafters schemaintrospects the command tree for agent consumption- Skills auto-install from
.claude/skills/duringcrafters claude install
Both crafter.run and crafter.ing share the same Spaceship creds and Vercel team.
The --domain flag only changes which DNS zone the Spaceship API operates on.