MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / runShellCommand

Method runShellCommand

packages/node-sdk/src/session.ts:115–125  ·  view source on GitHub ↗

Execute a user-initiated `!` shell command (silent — does not prompt the * model). Resolves with the command's stdout/stderr for immediate display. * Pass `commandId` to receive live `shell.output` events for this command.

(
    command: string,
    options?: { commandId?: string },
  )

Source from the content-addressed store, hash-verified

113 * model). Resolves with the command's stdout/stderr for immediate display.
114 * Pass `commandId` to receive live `shell.output` events for this command. */
115 async runShellCommand(
116 command: string,
117 options?: { commandId?: string },
118 ): Promise<{ stdout: string; stderr: string; isError?: boolean; backgrounded?: boolean }> {
119 this.ensureOpen();
120 return this.rpc.runShellCommand({
121 sessionId: this.id,
122 command,
123 commandId: options?.commandId,
124 });
125 }
126
127 /** Cancel a running `!` shell command by its commandId (e.g. on Esc / Ctrl+C). */
128 async cancelShellCommand(commandId: string): Promise<void> {

Callers 2

runShellCommandFunction · 0.45

Calls 1

ensureOpenMethod · 0.95

Tested by

no test coverage detected