RunResult
Structured result from runCommand.
Contains the exit code, captured stdout/stderr output, recorded activity events, and an error field. error is undefined when execution completed without throwing, even if the handler requested a non-zero status via Out.setExitCode.
- Import:
@kjanat/dreamcli - Export kind: interface
- Declared in:
src/core/schema/run.ts - Source link:
src/core/schema/run.ts:196
Signatures
interface RunResult {}Members
Properties
activity
Captured spinner and progress lifecycle events.
Recorded separately from stdout/stderr — handlers that call out.spinner() or out.progress() produce events here, enabling targeted assertions on activity lifecycle without parsing text.
activity: readonly ActivityEvent[];error
The error that caused a failure, or undefined when execution completed. A non-zero exitCode can still have no error when a handler calls Out.setExitCode. CLIError instances are preserved; unknown errors are wrapped.
error: CLIError | undefined;exitCode
Process exit code. 0 = success.
exitCode: number;stderr
Captured stderr lines (from out.warn and out.error).
stderr: readonly string[];stdout
Captured stdout lines (from out.log and out.info).
stdout: readonly string[];Examples
const result = await runCommand(greetCmd, ['World']);
expect(result.exitCode).toBe(0);
expect(result.stdout).toContain('Hello, World!');
expect(result.error).toBeUndefined();