Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

ContributingCommunityRepository

Language Runtime

Built-ins

Standard Library

std.argsstd.assertstd.envstd.fsstd.jsonstd.pathstd.processstd.regexstd.string

Standard Library

std.process

Process execution for running subprocesses and capturing their output.

Exported functions

pub def run(command: String, args: List[String]) -> ProcessResult

Run a command synchronously and wait for it to complete.

pub def run_with_options(command: String, args: List[String], env: Dict[String, String], cwd: String, stdin: String) -> ProcessResult

Run a command with full options (env, cwd, stdin).

pub def spawn(command: String, args: List[String]) -> Int

Start a command without waiting for it to complete.

pub def spawn_with_options(command: String, args: List[String], env: Dict[String, String], cwd: String) -> Int

Spawn a command with full options (env, cwd).

pub def wait(handle: Int) -> ProcessResult

Wait for a spawned process to complete and return its result.

pub def kill(handle: Int) -> Bool

Terminate a spawned process.

pub def read_stdout(handle: Int) -> String

Read data from a spawned process's stdout.

pub def read_stdout_bytes(handle: Int, bytes: Int) -> String

Read up to the specified number of bytes from a spawned process's stdout.

pub def read_stderr(handle: Int) -> String

Read data from a spawned process's stderr.

pub def read_stderr_bytes(handle: Int, bytes: Int) -> String

Read up to the specified number of bytes from a spawned process's stderr.

pub def write_stdin(handle: Int, data: String) -> Void

Write data to a spawned process's stdin.

pub def close_stdin(handle: Int) -> Void

Close a spawned process's stdin pipe.

pub def close(handle: Int) -> Void

Close a spawned process handle without waiting for it.

pub def check(result: ProcessResult) -> ProcessResult

Require a process result to have exited successfully.

pub def run_checked(command: String, args: List[String]) -> ProcessResult

Run a command and fail when it exits with a non-zero status.

pub def run_checked_with_options(command: String, args: List[String], env: Dict[String, String], cwd: String, stdin: String) -> ProcessResult

Run a command with full options and fail when it exits with a non-zero status.

pub def stdout_lines(result: ProcessResult) -> List[String]

Split captured stdout into lines.

pub def stderr_lines(result: ProcessResult) -> List[String]

Split captured stderr into lines.