Команды / CommandStartOpts
Interface: CommandStartOpts
Options for starting a new command.
Extends
Properties
background?
optionalbackground?:boolean
If true, starts command in the background and the method returns immediately. You can use CommandHandle.wait to wait for the command to finish.
cwd?
optionalcwd?:string
Working directory for the command.
Default
// home directory of the user used to start the commandenvs?
optionalenvs?:Record<string,string>
Environment variables used for the command.
This overrides the default environment variables from Sandbox constructor.
Default
{}
onStderr?
optionalonStderr?: (data) =>void|Promise<void>
Callback for command stderr output.
Parameters
data
string
Returns
void | Promise<void>
onStdout?
optionalonStdout?: (data) =>void|Promise<void>
Callback for command stdout output.
Parameters
data
string
Returns
void | Promise<void>
requestTimeoutMs?
optionalrequestTimeoutMs?:number
Timeout for requests to the API in milliseconds.
Default
60_000 // 60 secondsInherited from
CommandRequestOpts.requestTimeoutMs
signal?
optionalsignal?:AbortSignal
An optional AbortSignal that can be used to cancel the in-flight request. When the signal is aborted, the underlying fetch is aborted and the returned promise rejects with an AbortError.
Inherited from
stdin?
optionalstdin?:boolean
If true, command stdin is kept open and you can send data to it using Commands.sendStdin or CommandHandle.sendStdin.
Default
falsetimeoutMs?
optionaltimeoutMs?:number
Timeout for the command in milliseconds.
Default
60_000 // 60 secondsuser?
optionaluser?:string
User to run the command as.
Default
default Sandbox user (as specified in the template)