export interface CommandResult { success: boolean; code: number; stdout?: string; stderr?: string; /** True when captured output exceeded the configured byte limit. */ outputTruncated?: boolean; } export interface CommandOptions { args?: string[]; cwd?: string; env?: Record; /** Start from an empty environment before applying `env`. */ clearEnv?: boolean; /** Capture stdout/stderr to return in result */ capture?: boolean; /** Inherit stdio from parent process (shows output in terminal) */ inherit?: boolean; /** Use shell to run the command (needed for .cmd files on Windows) */ shell?: boolean; /** * Kill the command after this duration in milliseconds. Positive values are * floored to whole milliseconds and clamped to the portable timer maximum; * `undefined`, non-positive values, and NaN disable the timeout. */ timeoutMs?: number; /** Terminate the command when the caller cancels. */ signal?: AbortSignal; /** * Best-effort process-tree cleanup after the managed command settles. * Disabled by default so generic callers retain normal daemon/background * process behavior. Sandboxed or otherwise lifecycle-owning callers can * enable it to prevent ordinary descendants from outliving the command. */ terminateProcessTreeOnExit?: boolean; /** * Maximum combined stdout and stderr bytes retained when `capture` is true. * * @default 16777216 */ maxOutputBytes?: number; } /** @internal Exported so Windows tree-termination arguments can be tested on every host. */ export declare function buildWindowsTaskkillArgs(pid: number, force: boolean): string[]; /** * Run a command and return the result. * Works across Deno, Node.js, and Bun. * * @param cmd - Command to run * @param options - Command options * @param options.capture - Capture stdout/stderr to return in result * @param options.inherit - Inherit stdio from parent (shows output in terminal) * @param options.shell - Use shell to run command (needed for .cmd on Windows) */ export declare function runCommand(cmd: string, options?: CommandOptions): Promise; //# sourceMappingURL=command.d.ts.map