ProcessModule
PackageAxial.Process
Summary
| Name | Signature | Synopsis |
|---|---|---|
| commandArgs | Process.commandArgs fileName arguments | Creates a one-command process specification from an executable and already-separated arguments. |
| command | Process.command commandLine | Creates a safely tokenized one-command process specification from an interpolated command template. |
| commandText | Process.commandText commandLine | Creates a safely tokenized one-command process specification from fixed command text. |
| fileName | Process.fileName specification | Returns the executable name of a one-command specification. |
| arguments | Process.arguments specification | Returns the real argument values of a one-command specification. |
| tryWorkingDirectory | Process.tryWorkingDirectory specification | Returns the configured working directory of a one-command specification. |
| environmentVariables | Process.environmentVariables specification | Returns environment overrides of a one-command specification. |
| acceptedExitCodes | Process.acceptedExitCodes specification | Returns accepted exit codes of a one-command specification. |
| arg | Process.arg value specification | Appends one ordinary argument. |
| secretArg | Process.secretArg value specification | Adds an argument whose value is replaced with <c>***</c> in rendered commands and transcripts. |
| workingDirectory | Process.workingDirectory path specification | Sets the working directory. |
| environment | Process.environment name value specification | Sets an environment override. |
| removeEnvironment | Process.removeEnvironment name specification | Removes an inherited environment variable. |
| encoding | Process.encoding value specification | Selects text decoding for this stage. |
| successCodes | Process.successCodes values specification | Replaces the set of exit codes considered successful for this command. |
| render | Process.render specification | Renders a redacted shell-like description of the complete process specification. |
| pipe | Process.pipe next source | Connects the current stdout to the next one-command specification's stdin. |
| pipeBoth | Process.pipeBoth next source | Connects both stdout and stderr from the current final stage to the next command's stdin. |
| merge | Process.merge commands | Creates a fan-in topology whose producers may be connected to one downstream command. |
| stdin | Process.stdin source specification | Supplies stdin to the first stage. |
| stdout | Process.stdout destination specification | Configures final stdout handling. |
| stderr | Process.stderr destination specification | Configures combined stderr handling. |
| mergeStderr | Process.mergeStderr specification | Routes final stderr through the final stdout targets, like the intent of <c>2>&1</c>. |
| framing | Process.framing value specification | Selects chunk or line event framing. |
| timeout | Process.timeout after specification | Sets the maximum execution time for the complete process topology. |
| plan | Process.plan specification | Returns a redacted execution plan without starting a process. |
| service | Process.service | Reads the process service from the environment. |
| toFlow | Process.toFlow specification | Converts a process specification into a lazy Flow in the current environment. |
| capture | Process.capture specification | Runs a process specification with complete stdout and stderr capture. |
| console | Process.console specification | Converts a process specification into a lazy Flow that forwards stdout and stderr to the host console. |
| stream | Process.stream specification | Streams process events in the current Flow runtime. |
| live | Process.live clock fileSystem console | Creates a live process service using an explicit clock for transcript timestamps and durations. |
| runWith | Process.runWith environment workflow | Runs a process workflow with its supplied application environment and returns a host exit code. |
| run | Process.run workflow | Runs a process workflow with live clock, filesystem, console, and process services. |
Creates a one-command process specification from an executable and already-separated arguments.
Example: Process.commandArgs "git" [ "status"; "--short" ] |> Process.toFlow
Parameters
| Name | Type | Description |
|---|---|---|
| fileName | string | |
| arguments | string list |
Returns
ProcessSpec
Creates a safely tokenized one-command process specification from an interpolated command template.
Each interpolation hole is one native argument.
Example: Process.command $"git show {revision}" |> Process.toFlow
Parameters
| Name | Type | Description |
|---|---|---|
| commandLine | FormattableString |
Returns
ProcessSpec
Creates a safely tokenized one-command process specification from fixed command text.
Parameters
| Name | Type | Description |
|---|---|---|
| commandLine | string |
Returns
ProcessSpec
Returns the executable name of a one-command specification.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
string
Returns the real argument values of a one-command specification.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
string list
Returns the configured working directory of a one-command specification.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
string option
Returns environment overrides of a one-command specification.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
Map<string, string option>
Returns accepted exit codes of a one-command specification.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
Set<int>
Appends one ordinary argument.
Example: command |> Process.arg "--verbose"
Parameters
| Name | Type | Description |
|---|---|---|
| value | string | |
| specification | ProcessSpec |
Returns
ProcessSpec
Adds an argument whose value is replaced with <c>***</c> in rendered commands and transcripts.
Parameters
| Name | Type | Description |
|---|---|---|
| value | string | |
| specification | ProcessSpec |
Returns
ProcessSpec
Sets the working directory. Example: command |> Process.workingDirectory repo
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| specification | ProcessSpec |
Returns
ProcessSpec
Sets an environment override. Example: command |> Process.environment "CI" "true"
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| value | string | |
| specification | ProcessSpec |
Returns
ProcessSpec
Removes an inherited environment variable. Example: command |> Process.removeEnvironment "TOKEN"
Parameters
| Name | Type | Description |
|---|---|---|
| name | string | |
| specification | ProcessSpec |
Returns
ProcessSpec
Selects text decoding for this stage. Example: command |> Process.encoding Encoding.Latin1
Parameters
| Name | Type | Description |
|---|---|---|
| value | Encoding | |
| specification | ProcessSpec |
Returns
ProcessSpec
Replaces the set of exit codes considered successful for this command.
Parameters
| Name | Type | Description |
|---|---|---|
| values | int seq | |
| specification | ProcessSpec |
Returns
ProcessSpec
Renders a redacted shell-like description of the complete process specification.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
string
Connects the current stdout to the next one-command specification's stdin.
Parameters
| Name | Type | Description |
|---|---|---|
| next | ProcessSpec | |
| source | ProcessSpec |
Returns
ProcessSpec
Connects both stdout and stderr from the current final stage to the next command's stdin.
Parameters
| Name | Type | Description |
|---|---|---|
| next | ProcessSpec | |
| source | ProcessSpec |
Returns
ProcessSpec
Creates a fan-in topology whose producers may be connected to one downstream command.
Parameters
| Name | Type | Description |
|---|---|---|
| commands | ProcessSpec seq |
Returns
ProcessSpec
Supplies stdin to the first stage.
Parameters
| Name | Type | Description |
|---|---|---|
| source | InputSource | |
| specification | ProcessSpec |
Returns
ProcessSpec
Configures final stdout handling. Example: specification |> Process.stdout OutputTarget.Console
Parameters
| Name | Type | Description |
|---|---|---|
| destination | OutputTarget | |
| specification | ProcessSpec |
Returns
ProcessSpec
Configures combined stderr handling. Example: specification |> Process.stderr (OutputTarget.CaptureTail 65536)
Parameters
| Name | Type | Description |
|---|---|---|
| destination | OutputTarget | |
| specification | ProcessSpec |
Returns
ProcessSpec
Routes final stderr through the final stdout targets, like the intent of <c>2>&1</c>.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
ProcessSpec
Selects chunk or line event framing. Example: specification |> Process.framing OutputFraming.Lines
Parameters
| Name | Type | Description |
|---|---|---|
| value | OutputFraming | |
| specification | ProcessSpec |
Returns
ProcessSpec
Sets the maximum execution time for the complete process topology.
Example: specification |> Process.timeout (TimeSpan.FromSeconds 30.0)
Parameters
| Name | Type | Description |
|---|---|---|
| after | TimeSpan | |
| specification | ProcessSpec |
Returns
ProcessSpec
Returns a redacted execution plan without starting a process.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
ProcessPlan
Reads the process service from the environment.
Returns
Flow<'env, 'error, IProcess>
Converts a process specification into a lazy Flow in the current environment.
Example: specification |> Process.toFlow
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
Flow<'env, ProcessError, ProcessResult>
Runs a process specification with complete stdout and stderr capture.
Example: Process.command $"dotnet --info" |> Process.capture
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
Flow<'env, ProcessError, ProcessResult>
Converts a process specification into a lazy Flow that forwards stdout and stderr to the host console.
Example: Process.command $"dotnet --version" |> Process.console
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
Flow<'env, ProcessError, ProcessResult>
Streams process events in the current Flow runtime. The last event is <c>Completed</c>.
Parameters
| Name | Type | Description |
|---|---|---|
| specification | ProcessSpec |
Returns
FlowStream<'env, ProcessError, ProcessEvent>
Creates a live process service using an explicit clock for transcript timestamps and durations.
Parameters
| Name | Type | Description |
|---|---|---|
| clock | IClock | |
| fileSystem | IFileSystem | |
| console | IConsole |
Returns
IProcess
Runs a process workflow with its supplied application environment and returns a host exit code.
The environment supplies the console used to report a typed process failure.
Parameters
| Name | Type | Description |
|---|---|---|
| environment | 'env | |
| workflow | Flow<'env, ProcessError, 'value> |
Returns
int

