Skip to content
Effect Days 2026 Get your ticket

CommandExecutor

14 exports Added in v1.0.0 Source

Constructors

ExitCode

Added in v1.0.0 Source

Signature

declare const ExitCode: Constructor<ExitCode>

makeExecutor

Added in v1.0.0 Source

Signature

declare const makeExecutor: (start: (command: Command) => Effect<Process, PlatformError, Scope>) => CommandExecutor

ProcessId

Added in v1.0.0 Source

Signature

declare const ProcessId: Constructor<ProcessId>

Models

CommandExecutor interface

Added in v1.0.0 Source

Signature

interface CommandExecutor {
readonly [TypeId]: typeof TypeId;
readonly exitCode: (command: Command) => Effect<ExitCode, PlatformError>;
readonly lines: (command: Command, encoding?: string) => Effect<Array<string>, PlatformError>;
readonly start: (command: Command) => Effect<Process, PlatformError, Scope>;
readonly stream: (command: Command) => Stream<Uint8Array<ArrayBufferLike>, PlatformError>;
readonly streamLines: (command: Command, encoding?: string) => Stream<string, PlatformError>;
readonly string: (command: Command, encoding?: string) => Effect<string, PlatformError>;
}

ExitCode type

Added in v1.0.0 Source

Signature

type ExitCode = Brand.Branded<number, "ExitCode">

Process interface

Added in v1.0.0 Source

Signature

interface Process extends Inspectable {
readonly [ProcessTypeId]: typeof ProcessTypeId;
readonly exitCode: Effect<ExitCode, PlatformError>;
readonly isRunning: Effect<boolean, PlatformError>;
readonly kill: (signal?: Signal) => Effect<void, PlatformError>;
readonly pid: ProcessId;
readonly stderr: Stream<Uint8Array<ArrayBufferLike>, PlatformError>;
readonly stdin: Sink<void, Uint8Array<ArrayBufferLike>, never, PlatformError>;
readonly stdout: Stream<Uint8Array<ArrayBufferLike>, PlatformError>;
}

ProcessId type

Added in v1.0.0 Source

Signature

type ProcessId = Brand.Branded<number, "ProcessId">

Signal type

Added in v1.0.0 Source

Signature

type Signal = "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"

Other

Process

Added in v1.0.0 Source

Symbols

Signature

declare const ProcessTypeId: unique symbol

ProcessTypeId type

Added in v1.0.0 Source

Signature

type ProcessTypeId = typeof ProcessTypeId

Tags

Signature

declare const CommandExecutor: Tag<CommandExecutor, CommandExecutor>

Type Ids

TypeId

Added in v1.0.0 Source

Signature

declare const TypeId: unique symbol

TypeId type

Added in v1.0.0 Source

Signature

type TypeId = typeof TypeId