This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
@truyman/cli is a TypeScript CLI framework library for building command-line applications. The project is in early development.
bun run lint- Check formatting and linting (oxfmt + oxlint)bun run format- Auto-fix formatting and lint issuesbun run typecheck- Run TypeScript type checkingbun test- Run all testsbun test path/to/file- Run a single test file
- Runtime: Bun
- Language: TypeScript (strict mode, ESNext target)
- Formatter/Linter: oxfmt + oxlint
- Git Hooks: husky with lint-staged (runs oxfmt + oxlint on all files pre-commit)
src/index.ts- Public API exports (command,run) and top-level error handlingsrc/command.ts-Commandclass with argv parsing (via mri) and handler executionsrc/types.ts- Type definitions with generics for type-safe args/options inferencesrc/help.ts- Help text formattingsrc/errors.ts- Custom error classes (MissingArgumentError,InvalidOptionError)
Key pattern: Command.run() throws errors, run() (top-level) catches and pretty-prints them.