runCommand
Generated reference page for the runCommand function export.
- Import:
@kjanat/dreamcli/testkit - Export kind: function
- Declared in:
src/core/testkit/index.ts - Source link:
packages/dreamcli/src/core/testkit/index.ts:46
Signatures
ts
function runCommand(cmd: RunnableCommand, argv: readonly string[], options?: RunOptions): Promise<RunResult>;| Parameter | Type | Description |
|---|---|---|
cmd | RunnableCommand | The command builder (must have an action handler) |
argv | readonly string[] | Raw argv strings (NOT including the command name itself) |
options | RunOptions | undefined | Injectable runtime state |
Members
Members
runCommand
Run a command builder against the given argv with injected options.
This is the testkit wrapper around the shared executor:
- Create or reuse capture output
- Build standalone schema/meta defaults when CLI dispatch did not
- Delegate parse -> resolve -> execute to the shared executor
- Return the structured result with captured buffers
Errors are normalized by the shared executor into structured RunResults with appropriate exit codes. The function never throws.
ts
(cmd: RunnableCommand, argv: readonly string[], options?: RunOptions): Promise<RunResult>;Related Examples
- Testing examples using @kjanat/dreamcli/testkit. -
examples/standalone/testing.ts