Use this guide when changing the CLI, tests, package metadata, or release workflow.
- Node.js 24 or newer
- pnpm 11 or newer
Install dependencies from the lockfile:
pnpm install --frozen-lockfile| Task | Command |
|---|---|
| Show CLI help in development | pnpm dev:help |
| Run the sample greeting | pnpm dev:hello |
| Check public env output | pnpm dev:env |
| Check local toolchain readiness | pnpm dev:doctor |
| Run tests once | pnpm test |
| Run tests in watch mode | pnpm test:watch |
| Typecheck once | pnpm typecheck |
| Typecheck in watch mode | pnpm typecheck:watch |
| Format and apply safe Biome fixes | pnpm fix |
| Remove generated artifacts | pnpm clean |
| Run the full local gate | pnpm verify |
Run this before opening a pull request or preparing a release:
pnpm verifypnpm verify runs:
pnpm checkpnpm buildpnpm smoke:distpnpm pack:check
The package check builds a dry-run npm tarball, confirms the package name and version, checks the required public files, rejects local-only files, and verifies that dist/cli.js is executable with the Node.js shebang.
- Add a handler in
src/commands/. - Register it in
src/index.ts. - Export any public helper from
src/index.tsif tests or consumers need it. - Write tests in
tests/cli.test.ts. - Document the command in
README.md. - Mention the workflow or behavior change in
CHANGELOG.md.
Command handlers should write through the injected CliContext streams instead of direct console.log calls.
Environment parsing lives in src/config/env.ts.
When adding an environment value:
- Add a safe example to
.env.example. - Update the zod schema.
- Decide whether the value is safe to display.
- Add tests for defaults, valid values, invalid values, and secret-safe output.
- Update the README configuration section.
Never include unrelated secrets in CLI output.
Use these commands when changing package metadata, build output, or release files:
pnpm build
pnpm smoke:dist
pnpm pack:check
npm pack --dry-runThe package should include generated dist files, public metadata, README, changelog, license text, and .env.example. It should not include .env, .github, src, tests, node_modules, coverage, or lockfiles.