Skip to main content
function Command.arg
def Command.arg(
arg: str,
/
) -> typing.Any
function Command.args
def Command.args(
args: list[str],
/
) -> typing.Any
function Command.current_dir
def Command.current_dir(
dir: str,
/
) -> typing.Any
function Command.env
def Command.env(
key: str,
value: None | str,
/
) -> typing.Any
function Command.process_group
def Command.process_group(
group: int,
/
) -> typing.Any
Assign the command to process group group. On Unix, 0 starts the command as the leader of a new process group. Cancelling a grouped child’s token, or calling [Child.kill], reaches every process in the group, not just the child. This setting has no effect on Windows. function Command.spawn
def Command.spawn(
*,
cancellation: None | cancellation.Token = None
) -> std.process.Child
Executes the command as a child process, returning a handle to it. By default, stdin, stdout and stderr are inherited from the parent. The child is bound to cancellation, ctx.cancellation.root unless given: when that token is cancelled (Ctrl+C for the root) the child is sent a terminate signal, to its whole process group if it leads one, and killed three seconds later if it is still running. Bind to ctx.cancellation.new() to keep a child out of that and stop it yourself. A child spawned from a post-task hook or ctx.defer after a cancel is cleanup, not part of what was cancelled: without an explicit token it gets one of its own and runs to completion. function Command.status
def Command.status(
*,
cancellation: None | cancellation.Token = None
) -> std.process.ExitStatus
Executes a command as a child process, waiting for it to finish and collecting its status. By default, stdin, stdout and stderr are inherited from the parent. The child is bound to cancellation as in [spawn], and the wait ends the task if the root is cancelled meanwhile. function Command.stderr
def Command.stderr(
io: std.io.Writable | str,
/
) -> typing.Any
Configuration for the child process’s standard error (stderr) handle. Defaults to [inherit] when used with [spawn] or [status], and defaults to [piped] when used with [output]. Accepts the same values as [stdout]. function Command.stdin
def Command.stdin(
io: str,
/
) -> typing.Any
Configuration for the child process’s standard input (stdin) handle. Defaults to [inherit] when used with [spawn] or [status], and defaults to [piped] when used with [output]. function Command.stdout
def Command.stdout(
io: std.io.Writable | str,
/
) -> typing.Any
Configuration for the child process’s standard output (stdout) handle. Defaults to [inherit] when used with [spawn] or [status], and defaults to [piped] when used with [output]. Accepts the strings "null", "piped", "inherit", or a writable file stream from fs.create(...) to redirect output straight to that file — letting a caller poll the child’s liveness with try_wait and read the file afterwards instead of draining a pipe with wait_with_output.