This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Run the CLI in development
bun run src/index.ts
# Build standalone executable
bun build src/index.ts --compile --outfile crafters
# Run with specific command
bun run src/index.ts claude install
bun run src/index.ts claude update
bun run src/index.ts domain add myapp -p my-vercel-project
bun run src/index.ts login --spaceshipKey="..." --spaceshipSecret="..." --vercelToken="..."This is a CLI tool (crafters) for managing domains on Vercel projects with Spaceship DNS. Built with Bun and the citty CLI framework.
src/index.ts- Entry point, defines main command and subcommands using citty'sdefineCommandsrc/commands/- Command implementationsclaude.ts-claude install/updatefor syncing Claude Code config from claude-dxdomain.ts-domain add/remove/listcommands (core functionality)login.ts-login/logout/whoamicredential management
src/lib/- API clients and utilitiesspaceship.ts- Spaceship DNS API client (CNAME management)vercel.ts- Vercel SDK wrapper for project domain operationsconfig.ts- Config file management (~/.crafters/config.json)
- Commands use citty's
defineCommandwithmeta,args, andrunproperties - API clients are factory functions (
createSpaceshipClient,createVercelClient) returning method objects - Configuration supports both file-based (
~/.crafters/config.json) and environment variable fallbacks - Domain operations coordinate both Vercel (add domain to project) and Spaceship (create CNAME record)