Expand description
A virtual bash environment for AI agents.
Runs bash scripts in-process with a virtual filesystem. Includes
sed, awk, jq, and most common Unix commands.
use vbash::Shell;
let mut shell = Shell::builder()
.file("/data/names.txt", "alice\nbob\ncharlie")
.build();
let result = shell.exec("cat /data/names.txt | sort | head -n 2").unwrap();
assert_eq!(result.stdout, "alice\nbob\n");
assert_eq!(result.exit_code, 0);Structs§
- Builder
- Builder for configuring an
Shellinstance. - Command
Context - Provides filesystem, environment, and I/O access to commands.
- Exec
Options - Options for a single
execcall. - Exec
Result - Result of executing a bash command string.
- Execution
Limits - Configurable execution limits to prevent runaway scripts.
- InMemory
Fs - A pure in-memory filesystem. No disk I/O whatsoever.
- Mountable
Fs - A filesystem router that composes multiple backends at different mount points.
- Overlay
Fs - Copy-on-write overlay filesystem.
- Parse
Error - A syntax error with source location.
- Read
Write Fs - Direct read-write access to a real directory on the host filesystem.
- Session
Limits - Shell
- A virtual Bash environment.
Enums§
- Error
- Top-level error type for all vbash operations.
- Exec
Error - Errors that can occur during command execution.
- FsError
- Filesystem errors modeled after POSIX errno values.
- Limit
Kind - Which resource limit was exceeded.
Traits§
- Virtual
Fs - A virtual filesystem that shell commands operate on.
Type Aliases§
- Command
Fn - Signature for all command implementations.