See
Sandbox.runCommand to start a command.Extended by
Properties
exitCode
Accessors
cmdId
Get Signature
Returns
string
cwd
Get Signature
Returns
string
startedAt
Get Signature
Returns
number
Methods
logs()
Parameters
| Parameter | Type | Description | 
|---|---|---|
| opts? | { signal?:AbortSignal; } | Optional parameters. | 
| opts.signal? | AbortSignal | An AbortSignal to cancel log streaming. | 
Returns
AsyncGenerator<{
stream: "stdout" | "stderr";
data: string;
}, void, void> & Disposable & {
close: void;
}
An async iterable of log entries from the command output.
See
Command.stdout, Command.stderr, and Command.output to access output as a string.wait()
Parameters
| Parameter | Type | Description | 
|---|---|---|
| params? | { signal?:AbortSignal; } | Optional parameters. | 
| params.signal? | AbortSignal | An AbortSignal to cancel waiting. | 
Returns
Promise<CommandFinished>
A CommandFinished instance with populated exit code.
output()
stdout, stderr, or both as a string.
NOTE: This may throw string conversion errors if the command does
not output valid Unicode.
Parameters
| Parameter | Type | Default value | Description | 
|---|---|---|---|
| stream | "stdout"|"stderr"|"both" | "both" | The output stream to read: “stdout”, “stderr”, or “both”. | 
| opts? | { signal?:AbortSignal; } | undefined | Optional parameters. | 
| opts.signal? | AbortSignal | undefined | An AbortSignal to cancel output streaming. | 
Returns
Promise<string>
The output of the specified stream(s) as a string.
stdout()
stdout as a string.
NOTE: This may throw string conversion errors if the command does
not output valid Unicode.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| opts? | { signal?:AbortSignal; } | Optional parameters. | 
| opts.signal? | AbortSignal | An AbortSignal to cancel output streaming. | 
Returns
Promise<string>
The standard output of the command.
stderr()
stderr as a string.
NOTE: This may throw string conversion errors if the command does
not output valid Unicode.
Parameters
| Parameter | Type | Description | 
|---|---|---|
| opts? | { signal?:AbortSignal; } | Optional parameters. | 
| opts.signal? | AbortSignal | An AbortSignal to cancel output streaming. | 
Returns
Promise<string>
The standard error output of the command.
kill()
Parameters
| Parameter | Type | Description | 
|---|---|---|
| signal? | Signal | The signal to send the running process. Defaults to SIGTERM. | 
| opts? | { abortSignal?:AbortSignal; } | Optional parameters. | 
| opts.abortSignal? | AbortSignal | An AbortSignal to cancel the kill operation. | 
Returns
Promise<void>
Promise<void>.