ππ» Clerc: The full-featured cli library.
See the code
Clerc is a full-featured library (tool set) for building CLI Apps in Node.js, Deno or Bun.
[!NOTE]
This package is ESM-only.
Install clerc, and create a file named cli.mjs:
import { Cli } from "clerc";
Cli() // Create a new Clerc instance with help and version plugins installed
.scriptName("foo") // CLI Script Name
.description("A foo CLI") // CLI Description
.version("0.0.0") // CLI Version
.command(
"bar", // Command name
"A bar command", // Command description
)
.on(
"bar",
(
_ctx, // The command context, but we haven't used it yet
) => {
console.log("Hello, world from Clerc!");
},
)
.parse(); // Parse the arguments and run!
Then run: node cli.mjs bar. It should log in your shell: Hello, world from Clerc!
Please see https://clerc.so1ve.dev.
Check the examples made with Clerc:
Clerc uses @clerc/parser to parse arguments. It is strongly-typed, which brings you better DX. It is powerful(supports custom type) and quite small and performant!
Clerc has a plugin system, which means you can add features on demand (e.g. auto completions, help text generation...). It also provides chainable APIs for better composability.
Clerc's flexible architecture and plugin system offer vast potential for further exploration and customization in diverse CLI application scenarios. There are more and more opportunities to leverage Clerc's capabilities to create unique and powerful command-line tools!
TypeScript
99.8%
ππ» Clerc: The full-featured cli library.
See the code
Clerc is a full-featured library (tool set) for building CLI Apps in Node.js, Deno or Bun.
[!NOTE]
This package is ESM-only.
Install clerc, and create a file named cli.mjs:
import { Cli } from "clerc";
Cli() // Create a new Clerc instance with help and version plugins installed
.scriptName("foo") // CLI Script Name
.description("A foo CLI") // CLI Description
.version("0.0.0") // CLI Version
.command(
"bar", // Command name
"A bar command", // Command description
)
.on(
"bar",
(
_ctx, // The command context, but we haven't used it yet
) => {
console.log("Hello, world from Clerc!");
},
)
.parse(); // Parse the arguments and run!
Then run: node cli.mjs bar. It should log in your shell: Hello, world from Clerc!
Please see https://clerc.so1ve.dev.
Check the examples made with Clerc:
Clerc uses @clerc/parser to parse arguments. It is strongly-typed, which brings you better DX. It is powerful(supports custom type) and quite small and performant!
Clerc has a plugin system, which means you can add features on demand (e.g. auto completions, help text generation...). It also provides chainable APIs for better composability.
Clerc's flexible architecture and plugin system offer vast potential for further exploration and customization in diverse CLI application scenarios. There are more and more opportunities to leverage Clerc's capabilities to create unique and powerful command-line tools!
TypeScript
99.8%