@briklab/lib/cli-john
cli-john is a Node.js command-line framework with command routing, option parsing, and formatted logging helpers.
Node.js Required
This module runs on Node.js runtime. Requires @briklab/lib installed.
Quick Start (ESM)
js
import { CLI } from "@briklab/lib/cli-john";
import * as process from "node:process";
const cli = new CLI(process);
cli.command("echo").on("command", ({ commandArgs }) => {
console.log(commandArgs.join(" "));
});
cli.run();Quick Start (CJS)
js
const { CLI } = require("@briklab/lib/cli-john");
const process = require("node:process");
const cli = new CLI(process);
cli.command("echo").on("command", ({ commandArgs }) => console.log(commandArgs.join(" ")));
cli.run();Pages
Live Demo
Recommended to test it in your browser. The test here might not work properly
Console
No logs yet.
