Skip to content
/ cli-starter Public template
forked from peterroe/cli-starter

A command line tool template.

License

Notifications You must be signed in to change notification settings

royllik/cli-starter

 
 

Repository files navigation

cli-starter

A command line tool template.

Try it now!

Create repo from this template on Github

Or:

$ npx degit peterroe/cli-starter my-cli
$ cd my-cli
$ pnpm i    # npm install -g pnpm

Development

You can debug your cli tool before you publish it.

$ npx esno src/index.ts  # run your cli tool in debug mode

Example

This command will help you understand how cli tool works:

$ npx esno src/index.ts -h # show help
$ npx esno src/index.ts -v # show version
$ npx esno src/index.ts lint one two --name peterroe # demo usage

And then you can rewrite src/index.ts to what you want

Here are some projects that use cli-starter: renamestind

More usage about cac please see cac

Build && Publish

Update the name:

{
- "name": "cli-starter",
+ "name": "xxx",
  "bin": {
-   "cli-starter": "./dist/index.mjs"
+   "xxx": "./dist/index.mjs"
  },

Build it:

$ pnpm build

Publish to npm:

$ pnpm release # or npm publish directly

Try yourself!

Install your own command line tool:

$ npm install -g xxx
$ xxx -h
$ xxx -v

Then use it...

About

A command line tool template.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.6%
  • JavaScript 6.4%