Skip to content

@tauri-apps/plugin-shell

Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application.

This API has a scope configuration that forces you to restrict the programs and arguments that can be used.

On the configuration object, open: true means that the open API can be used with any URL, as the argument is validated with the ^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+ regex. You can change that regex by changing the boolean value to a string, e.g. open: ^https://github.com/.

The plugin permissions object has a scope field that defines an array of CLIs that can be used. Each CLI is a configuration object { name: string, cmd: string, sidecar?: bool, args?: boolean | Arg[] }.

  • name: the unique identifier of the command, passed to the Command.create function. If it’s a sidecar, this must be the value defined on tauri.conf.json > bundle > externalBin.
  • cmd: the program that is executed on this configuration. If it’s a sidecar, this value is ignored.
  • sidecar: whether the object configures a sidecar or a system program.
  • args: the arguments that can be passed to the program. By default no arguments are allowed.
    • true means that any argument list is allowed.
    • false means that no arguments are allowed.
    • otherwise an array can be configured. Each item is either a string representing the fixed argument value or a { validator: string } that defines a regex validating the argument value.

CLI: git commit -m "the commit message"

Capability:

{
"permissions": [
{
"identifier": "shell:allow-execute",
"allow": [
{
"name": "run-git-commit",
"cmd": "git",
"args": ["commit", "-m", { "validator": "\\S+" }]
}
]
}
]
}

Usage:

import { Command } from '@tauri-apps/plugin-shell'
Command.create('run-git-commit', ['commit', '-m', 'the commit message'])

Trying to execute any API with a program not configured on the scope results in a promise rejection due to denied access.

function open(path: string, openWith?: string): Promise<void>;

Defined in: plugins/shell/guest-js/index.ts:923

Opens a path or URL with the system’s default app, or the one specified with openWith.

The openWith value must be one of firefox, google chrome, chromium safari, open, start, xdg-open, gio, gnome-open, kde-open or wslview.

import { open } from '@tauri-apps/plugin-shell';
// opens the given URL on the default browser:
await open('https://github.com/tauri-apps/tauri');
// opens the given URL using `firefox`:
await open('https://github.com/tauri-apps/tauri', 'firefox');
// opens a file using the default program:
await open('/path/to/file');
Parameter Type Description
path string The path or URL to open. This value is matched against the string regex defined on tauri.conf.json > plugins > shell > open, which defaults to `^((mailto:\w+)
openWith? string The app to open the file or URL with. Defaults to the system default application for the specified path type.

Promise<void>

2.0.0

Defined in: plugins/shell/guest-js/index.ts:447

A handle to a child process spawned with Command.spawn, which can be used to write to its stdin or to kill it.

2.0.0

new Child(pid: number): Child;

Defined in: plugins/shell/guest-js/index.ts:466

Creates a handle to the child process with the given process id.

import { Command } from '@tauri-apps/plugin-shell';
// a `Child` is usually obtained by spawning a command:
const child = await Command.create('node').spawn();
console.log(child.pid);
Parameter Type Description
pid number The process id of the child process.

Child

2.0.0

Property Type Description Defined in
pid number The child process pid. plugins/shell/guest-js/index.ts:449

kill(): Promise<void>;

Defined in: plugins/shell/guest-js/index.ts:509

Kills the child process.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
const child = await command.spawn();
await child.kill();

Promise<void>

A promise indicating the success or failure of the operation.

2.0.0

write(data: IOPayload | number[]): Promise<void>;

Defined in: plugins/shell/guest-js/index.ts:487

Writes data to the stdin.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
const child = await command.spawn();
await child.write('message');
await child.write([0, 1, 2, 3, 4, 5]);
Parameter Type Description
data IOPayload | number[] The message to write, either a string or a byte array.

Promise<void>

A promise indicating the success or failure of the operation.

2.0.0


Defined in: plugins/shell/guest-js/index.ts:560

The entry point for spawning child processes. It emits the close and error events.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('close', data => {
console.log(`command finished with code ${data.code} and signal ${data.signal}`)
});
command.on('error', error => console.error(`command error: "${error}"`));
command.stdout.on('data', line => console.log(`command stdout: "${line}"`));
command.stderr.on('data', line => console.log(`command stderr: "${line}"`));
const child = await command.spawn();
console.log('pid:', child.pid);

2.0.0

Type Parameter
O extends IOPayload
Property Modifier Type Description Defined in
stderr readonly EventEmitter<OutputEvents<O>> Event emitter for the stderr. Emits the data event. plugins/shell/guest-js/index.ts:570
stdout readonly EventEmitter<OutputEvents<O>> Event emitter for the stdout. Emits the data event. plugins/shell/guest-js/index.ts:568

addListener<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:147

Alias for emitter.on(eventName, listener).

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.addListener('error', (error) => console.error(error));
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to listen to.
listener (arg: CommandEvents[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.addListener

execute(): Promise<ChildProcess<O>>;

Defined in: plugins/shell/guest-js/index.ts:849

Executes the command as a child process, waiting for it to finish and collecting all of its output.

import { Command } from '@tauri-apps/plugin-shell';
const output = await Command.create('echo', 'message').execute();
assert(output.code === 0);
assert(output.signal === null);
assert(output.stdout === 'message');
assert(output.stderr === '');

Promise<ChildProcess<O>>

A promise resolving to the child process output.

2.0.0

listenerCount<N extends keyof CommandEvents>(eventName: N): number;

Defined in: plugins/shell/guest-js/index.ts:364

Returns the number of listeners listening to the event named eventName.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('close', () => {});
console.log(command.listenerCount('close')); // 1
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to count the listeners of.

number

The number of listeners registered for the given event.

2.0.0

EventEmitter.listenerCount

off<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:271

Removes the all specified listener from the listener array for the event eventName Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
const listener = (error: string) => console.error(error);
command.on('error', listener);
command.off('error', listener);
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to stop listening to.
listener (arg: CommandEvents[N]) => void The exact callback that was registered before.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.off

on<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:204

Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('close', (data) => {
console.log(`command finished with code ${data.code}`);
});
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to listen to.
listener (arg: CommandEvents[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.on

once<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:240

Adds a one-timelistener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.once('close', (data) => {
console.log(`command finished with code ${data.code}`);
});
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to listen to once.
listener (arg: CommandEvents[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.once

prependListener<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:393

Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.prependListener('error', (error) => console.error(error));
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to listen to.
listener (arg: CommandEvents[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.prependListener

prependOnceListener<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:427

Adds a one-timelistener function for the event named eventName to the_beginning_ of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.prependOnceListener('error', (error) => console.error(error));
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to listen to once.
listener (arg: CommandEvents[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.prependOnceListener

removeAllListeners<N extends keyof CommandEvents>(event?: N): this;

Defined in: plugins/shell/guest-js/index.ts:304

Removes all listeners, or those of the specified eventName.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('error', (error) => console.error(error));
command.removeAllListeners('error');
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
event? N The name of the event to remove the listeners of. When omitted, the listeners of every event are removed.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.removeAllListeners

removeListener<N extends keyof CommandEvents>(eventName: N, listener: (arg: CommandEvents[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:173

Alias for emitter.off(eventName, listener).

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
const listener = (error: string) => console.error(error);
command.addListener('error', listener);
command.removeListener('error', listener);
Type Parameter
N extends keyof CommandEvents
Parameter Type Description
eventName N The name of the event to stop listening to.
listener (arg: CommandEvents[N]) => void The exact callback that was registered before.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

EventEmitter.removeListener

spawn(): Promise<Child>;

Defined in: plugins/shell/guest-js/index.ts:798

Executes the command as a child process, returning a handle to it.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.stdout.on('data', (line) => console.log(line));
const child = await command.spawn();
console.log('pid:', child.pid);

Promise<Child>

A promise resolving to the child process handle.

2.0.0

Creates a command to execute the given program.

program

The program to execute. It must be configured in your project’s capabilities.

args

The arguments to pass to the program. Defaults to no arguments.

options

Spawn options such as the working directory, the environment variables and the character encoding of the process output.

2.0.0

static create(program: string, args?: string | string[]): Command<string>;

Defined in: plugins/shell/guest-js/index.ts:610

Creates a command to execute the given program, decoding its output as text.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('my-app', ['run', 'tauri']);
const output = await command.execute();
Parameter Type Description
program string The program to execute. It must be configured in your project’s capabilities.
args? string | string[] The arguments to pass to the program. Defaults to no arguments.

Command<string>

The command instance, ready to be spawned or executed.

2.0.0

static create(
program: string,
args?: string | string[],
options?: SpawnOptions & {
encoding: "raw";
}
): Command<Uint8Array>;

Defined in: plugins/shell/guest-js/index.ts:632

Creates a command to execute the given program, keeping its output as raw bytes.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('my-app', ['run', 'tauri'], { encoding: 'raw' });
const output = await command.execute();
console.log(output.stdout); // a Uint8Array
Parameter Type Description
program string The program to execute. It must be configured in your project’s capabilities.
args? string | string[] The arguments to pass to the program. Defaults to no arguments.
options? SpawnOptions & { encoding: "raw"; } Spawn options using the raw encoding, which makes the process output be delivered as Uint8Array instead of string.

Command<Uint8Array>

The command instance, ready to be spawned or executed.

2.0.0

static create(
program: string,
args?: string | string[],
options?: SpawnOptions
): Command<string>;

Defined in: plugins/shell/guest-js/index.ts:657

Creates a command to execute the given program with the given spawn options.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('my-app', ['run', 'tauri'], { cwd: '/path/to/project' });
const output = await command.execute();
Parameter Type Description
program string The program to execute. It must be configured in your project’s capabilities.
args? string | string[] The arguments to pass to the program. Defaults to no arguments.
options? SpawnOptions Spawn options such as the working directory, the environment variables and the character encoding of the process output.

Command<string>

The command instance, ready to be spawned or executed.

2.0.0

Creates a command to execute the given sidecar program.

program

The sidecar program to execute. It must be configured in your project’s capabilities and defined on tauri.conf.json > bundle > externalBin.

args

The arguments to pass to the program. Defaults to no arguments.

options

Spawn options such as the working directory, the environment variables and the character encoding of the process output.

2.0.0

static sidecar(program: string, args?: string | string[]): Command<string>;

Defined in: plugins/shell/guest-js/index.ts:703

Creates a command to execute the given sidecar program, decoding its output as text.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.sidecar('my-sidecar');
const output = await command.execute();
Parameter Type Description
program string The sidecar program to execute. It must be configured in your project’s capabilities and defined on tauri.conf.json > bundle > externalBin.
args? string | string[] The arguments to pass to the program. Defaults to no arguments.

Command<string>

The command instance, ready to be spawned or executed.

2.0.0

static sidecar(
program: string,
args?: string | string[],
options?: SpawnOptions & {
encoding: "raw";
}
): Command<Uint8Array>;

Defined in: plugins/shell/guest-js/index.ts:726

Creates a command to execute the given sidecar program, keeping its output as raw bytes.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.sidecar('my-sidecar', [], { encoding: 'raw' });
const output = await command.execute();
console.log(output.stdout); // a Uint8Array
Parameter Type Description
program string The sidecar program to execute. It must be configured in your project’s capabilities and defined on tauri.conf.json > bundle > externalBin.
args? string | string[] The arguments to pass to the program. Defaults to no arguments.
options? SpawnOptions & { encoding: "raw"; } Spawn options using the raw encoding, which makes the process output be delivered as Uint8Array instead of string.

Command<Uint8Array>

The command instance, ready to be spawned or executed.

2.0.0

static sidecar(
program: string,
args?: string | string[],
options?: SpawnOptions
): Command<string>;

Defined in: plugins/shell/guest-js/index.ts:752

Creates a command to execute the given sidecar program with the given spawn options.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.sidecar('my-sidecar', [], { cwd: '/path/to/project' });
const output = await command.execute();
Parameter Type Description
program string The sidecar program to execute. It must be configured in your project’s capabilities and defined on tauri.conf.json > bundle > externalBin.
args? string | string[] The arguments to pass to the program. Defaults to no arguments.
options? SpawnOptions Spawn options such as the working directory, the environment variables and the character encoding of the process output.

Command<string>

The command instance, ready to be spawned or executed.

2.0.0


Defined in: plugins/shell/guest-js/index.ts:124

A minimal event emitter modeled after Node.js’ EventEmitter, used by Command and by its stdout and stderr streams.

2.0.0

Type Parameter
E extends Record<string, any>

new EventEmitter<E extends Record<string, any>>(): EventEmitter<E>;

EventEmitter<E>

addListener<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:147

Alias for emitter.on(eventName, listener).

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.addListener('error', (error) => console.error(error));
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to listen to.
listener (arg: E[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

listenerCount<N extends string | number | symbol>(eventName: N): number;

Defined in: plugins/shell/guest-js/index.ts:364

Returns the number of listeners listening to the event named eventName.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('close', () => {});
console.log(command.listenerCount('close')); // 1
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to count the listeners of.

number

The number of listeners registered for the given event.

2.0.0

off<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:271

Removes the all specified listener from the listener array for the event eventName Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
const listener = (error: string) => console.error(error);
command.on('error', listener);
command.off('error', listener);
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to stop listening to.
listener (arg: E[N]) => void The exact callback that was registered before.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

on<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:204

Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('close', (data) => {
console.log(`command finished with code ${data.code}`);
});
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to listen to.
listener (arg: E[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

once<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:240

Adds a one-timelistener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.once('close', (data) => {
console.log(`command finished with code ${data.code}`);
});
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to listen to once.
listener (arg: E[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

prependListener<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:393

Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventNameand listener will result in the listener being added, and called, multiple times.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.prependListener('error', (error) => console.error(error));
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to listen to.
listener (arg: E[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

prependOnceListener<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:427

Adds a one-timelistener function for the event named eventName to the_beginning_ of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.prependOnceListener('error', (error) => console.error(error));
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to listen to once.
listener (arg: E[N]) => void The callback invoked with the event payload.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

removeAllListeners<N extends string | number | symbol>(event?: N): this;

Defined in: plugins/shell/guest-js/index.ts:304

Removes all listeners, or those of the specified eventName.

Returns a reference to the EventEmitter, so that calls can be chained.

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
command.on('error', (error) => console.error(error));
command.removeAllListeners('error');
Type Parameter
N extends string | number | symbol
Parameter Type Description
event? N The name of the event to remove the listeners of. When omitted, the listeners of every event are removed.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

removeListener<N extends string | number | symbol>(eventName: N, listener: (arg: E[N]) => void): this;

Defined in: plugins/shell/guest-js/index.ts:173

Alias for emitter.off(eventName, listener).

import { Command } from '@tauri-apps/plugin-shell';
const command = Command.create('node');
const listener = (error: string) => console.error(error);
command.addListener('error', listener);
command.removeListener('error', listener);
Type Parameter
N extends string | number | symbol
Parameter Type Description
eventName N The name of the event to stop listening to.
listener (arg: E[N]) => void The exact callback that was registered before.

this

A reference to the EventEmitter, so that calls can be chained.

2.0.0

Defined in: plugins/shell/guest-js/index.ts:106

The output collected from a child process that ran to completion.

2.0.0

Type Parameter
O extends IOPayload
Property Type Description Defined in
code number | null Exit code of the process. null if the process was terminated by a signal on Unix. plugins/shell/guest-js/index.ts:108
signal number | null If the process was terminated by a signal, represents that signal. plugins/shell/guest-js/index.ts:110
stderr O The data that the process wrote to stderr. plugins/shell/guest-js/index.ts:114
stdout O The data that the process wrote to stdout. plugins/shell/guest-js/index.ts:112

Defined in: plugins/shell/guest-js/index.ts:522

The events emitted by a Command instance.

2.0.0

Property Type Description Defined in
close TerminatedPayload Emitted when the child process terminated, carrying its exit code and signal. plugins/shell/guest-js/index.ts:524
error string Emitted when the child process could not be spawned or failed unexpectedly, carrying the error message. plugins/shell/guest-js/index.ts:526

Defined in: plugins/shell/guest-js/index.ts:534

The events emitted by the stdout and stderr streams of a Command.

2.0.0

Type Parameter
O extends IOPayload
Property Type Description Defined in
data O Emitted for each line the process wrote to the stream, or for each raw chunk when the raw encoding is used. plugins/shell/guest-js/index.ts:536

Defined in: plugins/shell/guest-js/index.ts:73

Options that configure how a child process is spawned.

2.0.0

Property Type Description Defined in
cwd? string Current working directory. plugins/shell/guest-js/index.ts:75
encoding? string Character encoding for stdout/stderr Since 2.0.0 plugins/shell/guest-js/index.ts:83
env? Record<string, string> Environment variables. set to null to clear the process env. plugins/shell/guest-js/index.ts:77
processGroup? boolean When enabled, spawns the child process in its own process group (POSIX) or job object (Windows). This allows killing the entire process tree when calling kill() on the child process. Useful for programs that spawn child processes, such as PyInstaller wrappers. Defaults to false. plugins/shell/guest-js/index.ts:93

Defined in: plugins/shell/guest-js/index.ts:877

Payload for the Terminated command event.

Property Type Description Defined in
code number | null Exit code of the process. null if the process was terminated by a signal on Unix. plugins/shell/guest-js/index.ts:879
signal number | null If the process was terminated by a signal, represents that signal. plugins/shell/guest-js/index.ts:881

type IOPayload =
| string
| Uint8Array;

Defined in: plugins/shell/guest-js/index.ts:888

The type of the data a child process writes to stdout and stderr: a string, or a Uint8Array when the raw encoding is configured.


© 2026 Tauri Contributors. CC-BY / MIT