git clone <repo>
cd ts-cli
npm install
npm run build
npm link # or: npm install -g .
# 1. Write code
vim src/commands/new-feature.ts
# 2. Register CLI + add import
vim src/cli.ts
# 3. Type-check
npx tsc --noEmit
# 4. Test
npx vitest run
# 5. Build + global install for local testing
npm run build && npm install -g .
- Type safety: zero
any types, complete interfaces
- Error handling: try/catch all async IO operations
- Logging: use
logger.info/warn/error from utils/logger, never console.log
- File operations: use
fs-extra, never raw fs
- Paths: use
join() from path, never string concatenation
- CLI parameters: register in
cli.ts with .option(), match the interface in the command file
- Documentation: every new command needs an entry in
docs/命令参考.md
- Create
src/commands/my-command.ts
- Export the interface and async function
- Import in
src/cli.ts
- Register with
.command() .alias() .description() .option() .action()
- Add to
src/core/next-steps.ts stage guide
- Add to
docs/命令参考.md
- Write tests in
tests/unit/commands/my-command.test.ts
feat: — new feature
fix: — bug fix
docs: — documentation
test: — tests
chore: — tooling/build
refactor: — code restructuring