0.4.0 โข Published 6 months ago
climonad v0.4.0
climonad.js
Next-Gen CLI framework
Overview
climonad.js
is a feature-rich framework for building structured and maintainable command-line tools.
!WARNING This library is in early development, and APIs may change.
Key Features:
- ๐ณ Hierarchical Commands: Build nested commands and subcommands effortlessly.
- ๐ ๏ธ Powerful Flag Parsing: Manage flags with defaults, requirements, and validation.
- ๐ Custom Usage Messages: Provide clear and tailored help text for every command.
- ๐๏ธ Scoped Management: Separate global and local flags for better organization.
Installation
Install via npm:
npm install climonad
Quick Example
Hereโs a simple CLI configuration:
const app = cli({
name: "cli",
description: "A simple CLI",
flags: [str({ name: "config", alias: "c", description: "Config file", required: true })],
commands: [
cmd({
name: "init",
description: "Initialize a new project",
flags: [str({ name: "name", description: "Project name", required: true })],
action: async ({ flags }) => {
console.log("Initializing project:", flags.get("name"))
console.log("Using config file:", flags.get("config"))
},
}),
],
})
app.run(process.argv)
Run your CLI:
node cli init --name my-project -c config.json
Output:
Initializing project: my-project
Using config file: config.json
Learn More
License
This project is licensed under the MIT License.