redb.Route.Exec 3.1.0

Prefix Reserved
dotnet add package redb.Route.Exec --version 3.1.0
                    
NuGet\Install-Package redb.Route.Exec -Version 3.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="redb.Route.Exec" Version="3.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="redb.Route.Exec" Version="3.1.0" />
                    
Directory.Packages.props
<PackageReference Include="redb.Route.Exec" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add redb.Route.Exec --version 3.1.0
                    
#r "nuget: redb.Route.Exec, 3.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package redb.Route.Exec@3.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=redb.Route.Exec&version=3.1.0
                    
Install as a Cake Addin
#tool nuget:?package=redb.Route.Exec&version=3.1.0
                    
Install as a Cake Tool

redb.Route.Exec

NuGet

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: exec URI: 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:

  1. JSON body{"command": "git", "args": ["status"]}
  2. HeadersredbExec.Command + redbExec.Args
  3. 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.
  • EnvironmentOverridesKEY=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

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
3.1.0 56 6/6/2026