A simple and flexible CLI framework built with TypeScript and Bun.
First, create a new project using the following command:
bunx create bun-cl1 [projectName]
This will clone the template and install the necessary dependencies.
To run the CLI:
bun cli <command> [options]
- Add a new file in
src/commands/
:
import { Command } from "@/core/command"
export default class HelloCommand extends Command {
prefix = "hello"
onExecute() {
console.log("Hello, world!")
}
}
- Run your new command:
bun cli hello
That's it!