This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a command-line application that does not run on a network port.
- Install:
pnpm install - Build:
pnpm run build - Build (dev mode):
pnpm run build:dev - Format:
pnpm run format - Lint:
pnpm run lint - Type Check:
pnpm run check - Run CLI:
node ./dist/index.mjsor./dist/index.mjs(after building) - Development Mode:
pnpm tsx --watch index.ts - Quick CLI Command:
pnpm tsx src/index.tsx application <command>
GoDaddy CLI is a terminal-based application built using:
- React and Ink: Terminal UI rendering with React components
- Commander.js: Command definition and routing
- @clack/prompts: Interactive user prompts and input handling
- graphql-request/TanStack Query: Data fetching with GraphQL
- arktype: Runtime type validation
-
Entry Point (
src/index.tsx): Defines the CLI command structure using Commander.js and renders commands with Ink -
Command Structure:
- Root commands (application, webhook, auth, env)
- Subcommands (init, info, release, update, etc.)
- Commands are rendered as React components
-
Component Organization:
- Commands (
src/cmds/): React components that implement specific CLI commands - Services (
src/services/): Business logic, API interactions, and data handling - Components (
src/components/): Reusable UI components - Utils: Helper functions and utilities
- Commands (
-
Context Providers:
- Environment context for handling different deployment environments
- Help context for managing command help displays
- React Query for data fetching and state management
-
Build System:
- ESBuild for bundling with production/development modes
- Custom plugins for handling compatibility issues
- TypeScript: Strict mode enabled with noEmit. Use explicit types.
- Formatting:
- Tab indentation (via Biome)
- Double quotes for strings
- ES modules with explicit imports
- Naming:
- React components: PascalCase
- Functions/variables: camelCase
- Files: kebab-case.tsx
- Components: Use functional React components with hooks.
- Error Handling: Use typed validation with arktype for user inputs.
- Prompts: Use @clack/prompts for interactive user input.
- OAuth-based authentication with GoDaddy APIs
- Secure token storage using keytar
- Token retrieval and refresh handled by auth service
- Application settings stored in TOML format (godaddy.toml)
- Environment-specific configurations (ote, prod)
- Create, view, update, and release GoDaddy applications
- Application enablement and disablement on entities
- Component addition (actions, subscriptions, extensions)
- Event subscription and management
- Event type discovery
- When creating a new command always render the ink component. You should never have a new command without a corresponding component.