Interface: CommandContext<TArgs>
Makaio Framework / kernel/cli / CommandContext
Interface: CommandContext<TArgs>
Section titled “Interface: CommandContext<TArgs>”Defined in: ../../../packages/kernel/src/cli/types.ts:82
Execution context provided to CLI command handlers.
Type Parameters
Section titled “Type Parameters”TArgs
Inferred from the command’s Zod schema via z.infer<T>.
Properties
Section titled “Properties”
readonlyargs:TArgs
Defined in: ../../../packages/kernel/src/cli/types.ts:84
Parsed and validated command arguments/options.
readonlybus:IMakaioBus
Defined in: ../../../packages/kernel/src/cli/types.ts:86
Bus client connected to the running Makaio instance.
output
Section titled “output”
readonlyoutput:OutputWriter
Defined in: ../../../packages/kernel/src/cli/types.ts:88
Output channel for writing to stdout/stderr.
signal
Section titled “signal”
readonlysignal: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.
Methods
Section titled “Methods”setExitCode()
Section titled “setExitCode()”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.
Parameters
Section titled “Parameters”exitCode
Section titled “exitCode”number
Command exit code to report.
Returns
Section titled “Returns”void