Defined in: shell.ts:70
A command builder mirroring Tauri's Command class. Streams stdout/stderr
via the ztron://shell-output / ztron://shell-error events.
new Command(
program,args?,options?):Command
Defined in: shell.ts:76
string
string[] = []
CommandOptions = {}
readonlyargs:string[]
Defined in: shell.ts:72
readonlyoptions:CommandOptions
Defined in: shell.ts:73
readonlyprogram:string
Defined in: shell.ts:71
execute():
Promise<ExecResult>
Defined in: shell.ts:163
Runs the command, collecting full output, and resolves with it.
Promise<ExecResult>
kill(
cid,signal?):Promise<void>
Defined in: shell.ts:158
Kills a spawned command (SIGTERM by default).
string
number = 15
Promise<void>
on(
event,handler):this
Defined in: shell.ts:87
Registers an event listener; returns this for chaining.
CommandEvent
(data) => void
this
spawn():
Promise<void>
Defined in: shell.ts:99
Spawns the command, streaming output events; resolves on exit.
Promise<void>
spawnInteractive():
Promise<string>
Defined in: shell.ts:126
Long-lived spawn: resolves with a command id once started; output keeps
streaming through on("stdout"/"stderr"), termination through
on("terminated") ({cid, code}). Use write and
kill to drive interactive processes.
Promise<string>
status():
Promise<number>
Defined in: shell.ts:197
Runs the command and resolves with its exit code.
Promise<number>
write(
cid,data):Promise<void>
Defined in: shell.ts:153
Writes to a spawned command's stdin (spawnInteractive cid).
string
string
Promise<void>
staticsidecar():never
Defined in: shell.ts:202
Not supported (Ztron has no sidecar bundling).
never
Defined in: shell.ts:59
optionalcwd?:string
Defined in: shell.ts:60
optionalenv?:Record<string,string>
Defined in: shell.ts:61
Defined in: shell.ts:5
code:
number
Defined in: shell.ts:6
stderr:
string
Defined in: shell.ts:8
stdout:
string
Defined in: shell.ts:7
constshell:object
Defined in: shell.ts:207
Command: typeof
Command
execute: (
program,args,options) =>Promise<ExecResult>
string
string[] = []
string
Record<string, string>
Promise<ExecResult>
executeStream: (
program,args,options) =>Promise<{code:number; }>
Executes a command and streams stdout chunks to onChunk as they arrive
(long-running commands). Resolves with the exit code.
string
string[] = []
object & object = {}
Promise<{ code: number; }>
open: (
url) =>Promise<{opened:boolean; }>
Opens an http(s) URL in the default browser (fire-and-forget).
string
Promise<{ opened: boolean; }>
execute(
program,args?,options?):Promise<ExecResult>
Defined in: shell.ts:11
string
string[] = []
string
Record<string, string>
Promise<ExecResult>
executeStream(
program,args?,options?):Promise<{code:number; }>
Defined in: shell.ts:27
Executes a command and streams stdout chunks to onChunk as they arrive
(long-running commands). Resolves with the exit code.
string
string[] = []
object & object = {}
Promise<{ code: number; }>
open(
url):Promise<{opened:boolean; }>
Defined in: shell.ts:55
Opens an http(s) URL in the default browser (fire-and-forget).
string
Promise<{ opened: boolean; }>