A CLI tool for creating and managing CommanderJS CLI tools inspired by cobra-cli
- Scaffold initial typescript app structure
- Add new command
- Test CLI locally by building and linkingæ
- Publish to npmjs
npm i -g komutan
komutanClone and install dependencies:
git clone https://github.com/atasoya/komutan.git
cd komutan
npm install
npm run build
npm link
komutanCreates initial clean typescript CLI app structure
komutan init <name>./
├── src/
│ ├── index.ts # CLI entry (Commander)
│ └── program/
│ ├── metadata.ts # CLI metadata
│ ├── program.ts # Main program object
│ └── commands/ # CLI commands
│ ├── hello.ts
│ └── index.ts # Main entry
├── package.json
├── package-lock.json
├── tsconfig.json
└── .gitignore
Adds new command by creating name.ts and adding import to the index.ts
komutan add <name>import { program } from "../program";
program.command('#name#')
.description('Description of the command')
.action(() => {
console.log("#name#");
});
`;Combines npm run build and npm link to one command.
komutan testVersion and publish to npmjs (you may need to login first: npm login )
komutan publish