Skip to content

Out

Output channel available inside action handlers.

Provides structured methods for stdout/stderr, JSON output, spinners, progress bars, and tables. The real implementation lives in src/core/output/; this interface defines the shape that handlers consume.

Signatures

ts
interface Out {}

Members

Properties

isTTY

Whether stdout is connected to a TTY (terminal).

Handlers can check this to decide whether to emit decorative output (spinners, progress bars, ANSI color codes). When false, the output is being piped or redirected — skip interactive decorations.

Note: jsonMode takes precedence — when jsonMode is true, decorative output should be suppressed regardless of isTTY.

ts
isTTY: boolean;

jsonMode

Whether the output channel is in JSON mode (--json flag active).

Handlers can check this to skip decorative output (spinners, progress bars, ANSI formatting) when machine-readable output is expected.

ts
jsonMode: boolean;

Methods

error

ts
error(message: string): void;

info

ts
info(message: string): void;

json

ts
json(value: unknown): void;

log

ts
log(message: string): void;

progress

ts
progress(options: ProgressOptions): ProgressHandle;

spinner

ts
spinner(text: string, options?: SpinnerOptions): SpinnerHandle;

stopActive

ts
stopActive(): void;

table

ts
table<T extends Record<string, unknown>>(rows: readonly T[], options: TableOptions): void;

warn

ts
warn(message: string): void;

See Also

Released under the MIT License.