Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.28 KB

File metadata and controls

40 lines (28 loc) · 1.28 KB

typescript-cli-template

This is intended to be a starter template repo for creating CLI programs with Typescript. The template project uses commander.js as the library for wiring up the CLI commands and comes with Typescript, ESLint and Prettier preconfigured. The ora library is also preinstalled for showing spinners.

Getting Started

  1. Use GitHub's "Use this Template" feature to genrate your own repo from this one.
  2. Clone your repo locally
  3. Install dependencies
yarn install
  1. Edit the package.json file to update the bin links to change the name of the generated binary to suit your needs.
"bin": {
	"test-prog": "./dist/index.js"
}
  1. Run the build command to transpile the Typescript to Javascript. This will output to the ./dist folder.
yarn build
  1. To enable running CLI commands locally link the project to your global NPM folder. This must be done with npm link since yarn link does not link bin files.
npm link --no-package-lock
  1. If you rename or add additional bin files, you will need to unlink and relink your project.
npm unlink
npm link --no-package-lock