shell/

September 4, 2026 · View on GitHub

English | 中文

Summary

The shell group provides command execution to agents: run a foreground command and read its bounded output, or start a background process and poll it, on POSIX with Bash and on Windows with PowerShell. Exactly one executor implementation is mounted per composition; the sandboxing executors confine every command through the sandbox capability, and the model-facing bash and pwsh tools sit on top of whichever executor is mounted. Choose a Bash executor for POSIX, a PowerShell executor for Windows, and pick the sandboxing variant when commands need file-level confinement.

Table of Contents


Packages

PackageRolectx key
shellDefines the executor contract: foreground runs, background handles, and request resolutionctx.shell
bash-localRuns Bash commands as fresh bash -c processes on POSIXregisters ctx.shell
bash-sandboxRuns Bash commands confined through the sandbox capability, reporting denials as factsregisters ctx.shell
pwsh-localRuns PowerShell commands as fresh pwsh -Command processes on Windowsregisters ctx.shell
pwsh-sandboxRuns PowerShell commands confined through the sandbox capabilityregisters ctx.shell
shell-envSupplies the managed DSH_* environment every shell command receivesctx.shellEnv
tool-bashExposes Bash execution and background jobs to the model as the bash toolregisters on ctx.tools
tool-bash-persistentRuns model shell calls in one owner-isolated persistent Bash sessionregisters on ctx.tools
tool-pwshExposes PowerShell execution to the model as the pwsh toolregisters on ctx.tools
tool-pwsh-persistentRuns model shell calls in one owner-isolated persistent PowerShell sessionregisters on ctx.tools

A profile layer selects exactly one executor implementation (the win32 layer swaps the POSIX rows for the pwsh ones; mounting two fails loud on the duplicate service registration) and the model-facing tools it needs. A sandboxed composition also selects a ctx.sandbox provider and ctx.sandboxPolicy; the base bundle owns the shipped wiring.


  • Bash executor subsystem — the shared request/spec vocabulary, results, background processes, and the service contract.
  • Sandbox subsystem — the confinement capability the sandboxing executors consume.

Dev Note

None.