vtcode-bash-runner
Cross-platform shell execution helpers extracted from VT Code.
The crate exposes a trait-based executor so downstream applications can swap the underlying process strategy (system shell, pure-Rust emulation, or dry-run logging) while reusing higher-level helpers for workspace-safe filesystem manipulation.
Modules
executor– Command execution strategies (process, dry-run, pure-rust)runner– High-levelBashRunnerfor workspace-safe operationsbackground– Background task managementpipe– Async pipe-based process spawning with unified handlesprocess– Process handle types for PTY and pipe backendsprocess_group– Process group management for reliable cleanupstream– Stream utilities for reading outputpolicy– Command allow/deny policies (AllowAllPolicy,WorkspaceGuardPolicy)
Public entrypoints
| Export | Description |
|---|---|
CommandExecutor |
Core trait for executing commands |
ProcessCommandExecutor |
Default system-shell executor |
CommandOutput, CommandStatus |
Result types returned by executors |
CommandInvocation |
Describes a single command to run |
ShellKind, CommandCategory |
Shell and command classification enums |
BashRunner |
High-level runner wrapping an executor with workspace guards |
BackgroundCommandManager, BackgroundTaskHandle |
Spawn and manage background tasks |
Feature-gated exports
| Export | Feature flag |
|---|---|
DryRunCommandExecutor |
dry-run |
PureRustCommandExecutor |
pure-rust |
EventfulExecutor |
exec-events |
Usage
use ;
async