Help
Add help command and --help / -h option to your CLI.
Using the Plugin
typescript
import { helpPlugin } from 'cheloni/std';
const cli = await createCli({
name: 'my-cli',
version: '1.0.0',
plugins: [helpPlugin],
});What It Adds
helpcommand — shows root help or help for a specific command--help/-hoption — shows help for the current command (short-circuits execution)
Behavior
- No root command exists — creates one with help as the default handler and injects
helpsubcommand - Root command exists — preserves existing definition and appends
helpsubcommand
Usage
bash
# Show root help
$ my-cli help
# Show command help
$ my-cli help deploy
$ my-cli deploy --helpUsing basicPluginKit
For most CLIs, spread basicPluginKit from cheloni/std/core (deprecation, help, version, and default error handling):
typescript
import { basicPluginKit } from 'cheloni/std/core';
const cli = await createCli({
name: 'my-cli',
version: '1.0.0',
plugins: [...basicPluginKit],
});