Skip to content

Interface: CommandContext<TArgs>

Makaio Framework


Makaio Framework / kernel/cli / CommandContext

Defined in: ../../../packages/kernel/src/cli/types.ts:82

Execution context provided to CLI command handlers.

TArgs

Inferred from the command’s Zod schema via z.infer<T>.

readonly args: TArgs

Defined in: ../../../packages/kernel/src/cli/types.ts:84

Parsed and validated command arguments/options.


readonly bus: IMakaioBus

Defined in: ../../../packages/kernel/src/cli/types.ts:86

Bus client connected to the running Makaio instance.


readonly output: OutputWriter

Defined in: ../../../packages/kernel/src/cli/types.ts:88

Output channel for writing to stdout/stderr.


readonly signal: AbortSignal

Defined in: ../../../packages/kernel/src/cli/types.ts:99

Abort signal that is triggered when the process receives SIGINT (Ctrl-C).

Long-running commands (e.g. watch) should honour this signal to perform clean teardown instead of relying on process termination. Short-lived commands may ignore it.

Always present — contexts that cannot supply a meaningful signal must use AbortSignal.timeout(Infinity) or a never-aborting controller signal.

setExitCode(exitCode): void

Defined in: ../../../packages/kernel/src/cli/types.ts:108

Set the process-style exit code for the current command invocation.

Local CLI execution forwards this to process.exitCode. Remote execution buffers it into the cli.execute RPC response instead of mutating the server process.

number

Command exit code to report.

void