shell

host module

Run external commands; opts is required; returns CmdOutput. Replaces wscript-std's process module.

use shell — external commands (replaces wscript-std's process, which is not registered). All take (cmd_or_script: string, opts: Value) and return Result[CmdOutput, string]. opts is required (wscript has fixed arity): pass Value::Null for defaults or a Value::Map with cwd (string), env (map), timeout (int/float secs), stdin (string). Timeout kills the child and returns Err.

functionbehaviour
runsplits cmd with shell-words, executes the program directly — no shell interpretation (no globs, pipes, $VAR)
run_streaminglike run, but streams output lines through log live (stdout → info, stderr → warn) — for long installs
bashbash -c script (falls back to sh) — the shell-features escape hatch
powershelltries powershell then pwsh with -NoProfile -NonInteractive; works on Linux with PowerShell Core

§ 1.1CmdOutput

rust
struct CmdOutput { stdout: string, stderr: string, code: int, success: bool }

use shell
use value
let out = shell::run("systemctl is-active nginx", Value::Null)?
if !out.success { return Ok(CheckResult::NotConfigured) }

Non-zero exit is not an Err

Inspect out.success/out.code. Err means the command could not run (spawn failure, timeout).