CLI for the Recoup platform. Installed globally in sandboxes via npm install -g @recoupable/cli.
pnpm install # Install dependencies
pnpm build # Build with tsup
pnpm test # Run tests with vitest- Framework: Commander.js for subcommands
- Bundler: tsup → CJS dist for global install compat
- HTTP: Native fetch (Node 22)
- Auth:
RECOUP_API_KEYenv var →x-api-keyheader - Output: Plain text default,
--jsonflag for raw JSON
src/bin.ts— CLI entrypointsrc/client.ts— HTTP client (GET/POST to Recoup API)src/config.ts— Reads RECOUP_API_KEY from envsrc/output.ts— Formatters (table, json, error)src/commands/— One file per command group
Default: https://recoup-api.vercel.app
Override: RECOUP_API_URL env var
- SRP: One exported function per file
- TDD: Tests first, then implementation
- Keep it simple — this is a thin CLI wrapper over REST endpoints