redb.Route.Exec
4.7.1
Prefix Reserved
dotnet add package redb.Route.Exec --version 4.7.1
NuGet\Install-Package redb.Route.Exec -Version 4.7.1
<PackageReference Include="redb.Route.Exec" Version="4.7.1" />
<PackageVersion Include="redb.Route.Exec" Version="4.7.1" />
<PackageReference Include="redb.Route.Exec" />
paket add redb.Route.Exec --version 4.7.1
#r "nuget: redb.Route.Exec, 4.7.1"
#:package redb.Route.Exec@4.7.1
#addin nuget:?package=redb.Route.Exec&version=4.7.1
#tool nuget:?package=redb.Route.Exec&version=4.7.1
redb.Route.Exec
Process-execution transport for the redb.Route ESB framework. Run shell commands as part of a route — synchronously (request/response) or on a fixed schedule — with first-class allowlisting, working-directory and environment overrides, wall-clock timeouts, and stdout/stderr byte caps.
Scheme:
execURI:exec://run?command=git&args=status&timeoutMs=5000&allowedCommands=git,ls,pwd
Why
The framework already speaks 22+ transports (HTTP, Kafka, SQL, …) but reaching out to the
operating system itself was a gap. redb.Route.Exec closes it. Two patterns dominate:
- Tool execution from an LLM agent. Wire the producer into
.AsLlmTool("shell")and the language model can issue commands through your route — with the same allowlist, timeout and audit you put in front of every other tool. - Scheduled jobs. Need a cron-less daily backup, health probe, or log rotation? The consumer fires any command on a fixed interval and pipes the result into the next step of your route (Slack, Kafka, S3, redb persistence, …).
Install
dotnet add package redb.Route.Exec
Quick start — request/response producer
using redb.Route.Exec;
services.AddRedbRoute()
.AddRedbRouteExec();
routes.From(Direct.From("git-status"))
.To(ExecDsl.Run("git")
.Args("status", "--short")
.WorkingDirectory("/srv/app")
.AllowedCommands("git")
.TimeoutMs(5_000));
The exchange Out.Body is JSON shaped for the LLM tool ABI:
{ "stdout": "M README.md\n", "stderr": "", "exitCode": 0, "timedOut": false }
Headers also expose redbExec.ExitCode, redbExec.Stdout, redbExec.Stderr,
redbExec.DurationMs, redbExec.TimedOut, redbExec.CommandLine.
Quick start — scheduled consumer
routes.From(ExecDsl.Run("./scripts/health-check.sh")
.Schedule("5m")
.TimeoutMs(30_000))
.Choice()
.When(e => e.In.Headers["redbExec.ExitCode"]?.ToString() != "0")
.To(slackAlerts)
.Otherwise()
.To(metricsLog);
Schedule accepts 500ms, 30s, 5m, 1h. For cron, chain From("quartz://<cron>").
Inputs (producer)
The producer resolves the command in this order:
- JSON body —
{"command": "git", "args": ["status"]} - Headers —
redbExec.Command+redbExec.Args - URI options —
?command=git&args=status
This is exactly the shape an LLM agent will produce when the producer is exposed as a tool — no glue code required.
Security
AllowedCommands is the primary control. When set, any request that resolves to a
command outside the list is rejected with UnauthorizedAccessException. Match is on the
file-name-only (case-insensitive), so /usr/bin/git and git.exe both match git.
Other controls:
WorkingDirectory— pin the cwd; the spawned process cannot escape it on its own.EnvironmentOverrides—KEY=VALUE,KEY2=VALUE2. Overlaid on the host environment.ScrubEnvironment— start with an empty environment and apply only the overrides.TimeoutMs— wall-clock kill-switch. The whole process tree is terminated.MaxStdoutBytes/MaxStderrBytes— caps protect the host from runaway processes.
Headers reference
| Header | Direction | Type | Notes |
|---|---|---|---|
redbExec.Command |
in | string | Overrides the URI option |
redbExec.Args |
in | string | string[] | Whitespace-split or array |
redbExec.ExitCode |
out | int | -1 when the process timed out |
redbExec.Stdout |
out | string | Capped at MaxStdoutBytes |
redbExec.Stderr |
out | string | Capped at MaxStderrBytes |
redbExec.StdoutBytes |
out | long | Total bytes captured (post-cap may be lower) |
redbExec.StderrBytes |
out | long | Total bytes captured (post-cap may be lower) |
redbExec.DurationMs |
out | long | Wall-clock execution time |
redbExec.TimedOut |
out | bool | true when the watchdog killed the process |
redbExec.CommandLine |
out | string | Exact command line launched |
License
Apache-2.0
Tracing
On the redb.Route activity source (AddSource("redb.Route")), with redb.route.endpoint:
- Consumer (schedule). One
Consumerspan per tick,exec {executable} receive. A tick carries no trace context, so the span is a root, never a child of the activity the timer loop inherited from whoever started the routes; the run of the command and the route are its children. A failed tick marks it an error; our own stop does not. - Producer. One
Clientspan per run,exec {executable}, withprocess.executable.name= the file name of the resolved command andprocess.exit.code. The arguments, which often carry secrets, are never on the span. A refused command, a failed start or a cancellation that is not our own marks it an error; a non-zero exit code does not, it is inredbExec.ExitCode. RouteEngineOptions.EnableTelemetry = falseopens neither span.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- JsonPath.Net (>= 2.2.0)
- JsonSchema.Net (>= 7.3.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- redb.Route (>= 4.7.1)
-
net8.0
- JsonPath.Net (>= 2.2.0)
- JsonSchema.Net (>= 7.3.4)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- redb.Route (>= 4.7.1)
- System.Text.Encoding.CodePages (>= 10.0.13)
-
net9.0
- JsonPath.Net (>= 2.2.0)
- JsonSchema.Net (>= 7.3.4)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.13)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Options (>= 10.0.13)
- redb.Route (>= 4.7.1)
- System.Text.Encoding.CodePages (>= 10.0.13)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.7.1 | 0 | 11/11/2026 |
| 4.7.0 | 59 | 11/7/2026 |
| 4.6.2 | 82 | 11/5/2026 |
| 4.6.1 | 97 | 11/4/2026 |
| 4.6.0 | 93 | 11/3/2026 |
| 4.5.1 | 102 | 10/30/2026 |
| 4.5.0 | 98 | 10/29/2026 |
| 4.4.2 | 103 | 10/23/2026 |
| 4.4.1 | 109 | 10/21/2026 |
| 4.3.0 | 114 | 10/14/2026 |
| 4.2.3 | 107 | 10/8/2026 |
| 4.2.2 | 107 | 10/5/2026 |
| 4.2.0 | 107 | 9/30/2026 |
| 4.1.1 | 104 | 9/25/2026 |
| 4.1.0 | 117 | 9/21/2026 |
| 4.0.1 | 115 | 9/18/2026 |
| 4.0.0 | 135 | 9/11/2026 |
| 3.7.2 | 129 | 8/26/2026 |
| 3.7.1 | 120 | 8/26/2026 |