Classes
Commands
sbx.commands: run commands in the sandbox.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Commands(
sbx):Commands
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Commands
Methods
Section titled “Methods”connect()
Section titled “connect()”connect(
pid):Promise<CommandHandle>
A handle to a background command by pid.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<CommandHandle>
kill()
Section titled “kill()”kill(
pid):Promise<boolean>
SIGKILL a background command (and its process group). Resolves false if it had already exited.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<boolean>
list()
Section titled “list()”list():
Promise<ProcessInfo[]>
Background commands started in this sandbox (running and finished).
Returns
Section titled “Returns”Promise<ProcessInfo[]>
Call Signature
Section titled “Call Signature”run(
cmd,opts):Promise<CommandHandle>
Run a command and wait for it. cmd is a string (run with bash, so shell syntax
works) or an argv array (no shell). Rejects with CommandExitError on a non-zero
exit, TimeoutError after timeoutMs, FileNotFoundError if cwd is missing.
With background: true, resolves with a CommandHandle as soon as it starts.
Parameters
Section titled “Parameters”string | string[]
CommandStartOpts & object
Returns
Section titled “Returns”Promise<CommandHandle>
Call Signature
Section titled “Call Signature”run(
cmd,opts?):Promise<CommandResult>
Run a command and wait for it. cmd is a string (run with bash, so shell syntax
works) or an argv array (no shell). Rejects with CommandExitError on a non-zero
exit, TimeoutError after timeoutMs, FileNotFoundError if cwd is missing.
With background: true, resolves with a CommandHandle as soon as it starts.
Parameters
Section titled “Parameters”string | string[]
CommandStartOpts & object
Returns
Section titled “Returns”Promise<CommandResult>
