cli
Generated reference page for the cli function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/cli/index.ts - Source link:
packages/dreamcli/src/core/cli/index.ts:947
Signatures
Overload 1
ts
function cli(name: string): CLIBuilder;Overload 2
ts
function cli(options: CLIOptions): CLIBuilder;Members
Members
cli
Create a new CLI program builder.
The CLI name is used in help text, usage lines, and generated completion scripts.
ts
(name: string): CLIBuilder;cli
Create a new CLI program builder from an options object.
ts
(options: CLIOptions): CLIBuilder;Examples
ts
cli('mycli')
.version('1.0.0')
.description('My awesome tool')
.command(deploy)
.command(login)
.run();
cli({ inherit: true })
.command(deploy)
.run();Related Examples
- Basic single-command CLI. -
examples/standalone/basic.ts - Interactive prompts with config file fallback. -
examples/standalone/interactive.ts - Mixed machine-readable JSON and human-readable side-channel output. -
examples/standalone/json-mode.ts - Middleware patterns: auth guard, request timing, error handling. -
examples/standalone/middleware.ts - Multi-command CLI with nested command groups (git-like). -
examples/standalone/multi-command.ts - Spinner and progress bar usage. -
examples/standalone/spinner-progress.ts