GitHub Copilot Instructions for Node CLI Template
March 10, 2026 · View on GitHub
Related Templates (Choose the Right Template First)
This repository is a GitHub Template Repo for Node.js CLI tools.
| If you are building… | Pick this template |
|---|---|
| Command-line tools and terminal workflows | node-cli-template |
| Web APIs, workers, long-running services | node-app-template |
| Reusable libraries published for import | node-module-template |
Default behavior in this repo: proceed in CLI mode.
Fast Path
- Use ESM only (
import/export) - Keep command wiring in
cli.jsand CLI logic inlib/ - Write runtime tests in
test/*.spec.jswithnode:test+node:assert/strict - Write type tests in
typetests/*.tst.tswithtstyche - Validate with
npm testbefore finalizing
Commands
npm run husky-enable- enable git hooks (opt-in)npm run husky-disable- disable git hooksnpm run test:node- runtime tests with coveragenpm run check-type-tests- type-level testsnpm test- full checks + tests
Lockfile policy: this CLI template does not commit a lockfile by default (package-lock=false in .npmrc).
Guardrails
MUST
- Preserve CLI ergonomics (
bin, help output, exit codes) - Keep changes minimal and template-focused
- Keep docs aligned with actual scripts
ASK FIRST
- Runtime dependency changes
- Public CLI interface changes (flags/commands/output)
- Large file moves or broad refactors
NEVER
- Introduce CommonJS runtime code
- Claim validation without running it
- Leave template docs with stale commands