Documentation
¶
Overview ¶
Package gobash provides a sandboxed bash environment with a virtual filesystem.
gobash is a feature-for-feature Go port of the just-bash TypeScript interpreter (github.com/vercel-labs/just-bash). The public surface, the phase-by-phase build plan, and the resolved design decisions live in The spec at the repository root.
Phase 1 status ¶
Only the public skeleton is implemented: Bash, BashOptions, ExecOptions, BashExecResult, the limits/error types, and a stub Exec that delegates to mvdan.cc/sh/v3. The virtual filesystem (Phase 3), command registry (Phase 8), and network layer (Phase 9) are not yet wired. Until the virtual filesystem lands, file operations in scripts hit the host disk through mvdan/sh's default handlers.
Concurrency ¶
A *Bash is safe for concurrent Exec calls; calls serialize on an internal mutex.
Index ¶
- type AbortedError
- type ArithmeticError
- type Bash
- func (b *Bash) Aliases() command.AliasTable
- func (b *Bash) Exec(ctx context.Context, script string, opts ExecOptions) (BashExecResult, error)
- func (b *Bash) FS() gbfs.FileSystem
- func (b *Bash) History() command.HistoryRing
- func (b *Bash) RegisterTransformPlugin(p transform.Plugin)
- func (b *Bash) Registry() *command.Registry
- func (b *Bash) Shopt() command.ShoptTable
- type BashExecResult
- type BashOptions
- type ExecOptions
- type ExecResult
- type ExecutionLimitError
- type ExecutionLimits
- type ExitError
- type InvokeToolFunc
- type JavaScriptConfig
- type LexerError
- type Logger
- type ParseError
- type PosixFatalError
- type ProcessInfo
- type PythonConfig
- type ResolvedLimits
- type SecurityViolationError
- type SleepFunc
- type TraceEvent
- type TraceFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbortedError ¶
type AbortedError struct {
Reason string
}
AbortedError is returned when execution was aborted for a reason other than a limit or context cancellation (for example, a transform-plugin veto).
func (*AbortedError) Error ¶
func (e *AbortedError) Error() string
type ArithmeticError ¶
type ArithmeticError struct {
Msg string
}
ArithmeticError reports an arithmetic-expansion failure such as division by zero or an unparseable expression inside $((…)).
func (*ArithmeticError) Error ¶
func (e *ArithmeticError) Error() string
type Bash ¶
type Bash struct {
// contains filtered or unexported fields
}
Bash is a reusable shell environment. Concurrent Exec calls on a single *Bash are safe; they serialize on an internal mutex.
Phase 5 scope ¶
Parsing now goes through gobash/parser.Parse (which already enforces the §4.2 parser-side hard limits), and the mvdan/sh runner is built by gobash/interp.BuildRunner — moving the VFS handlers, the commandExecHandler middleware, and the runner.Dir-not-interp.Dir quirk out of bash.go and into the bridge package. Bash.Exec still owns: per-call limit state (CallHandler closure + MaxOutputSize ringbuf), env-mutation propagation across Exec calls, the loop-sentinel AST rewrite, and the final result shape.
Still missing (per build order): command registry (Phase 8), network (Phase 9), built-in commands (Phases 10–11). Until the registry lands, the commandExecHandler stub in the interp package falls through to mvdan/sh's DefaultExecHandler, which means unknown commands still reach the host via os/exec. That is the explicit gap Phase 8 closes.
func New ¶
func New(opts BashOptions) (*Bash, error)
New constructs a Bash environment from the supplied options. The zero value of BashOptions is valid and yields sane defaults; New returns a non-nil error only when option validation fails (no failure modes exist in Phases 1–2).
func (*Bash) Aliases ¶
func (b *Bash) Aliases() command.AliasTable
Aliases returns the live per-Bash alias table. Hosts can use this to seed aliases before running scripts; the `alias` / `unalias` built-ins read and mutate the same table.
func (*Bash) Exec ¶
func (b *Bash) Exec(ctx context.Context, script string, opts ExecOptions) (BashExecResult, error)
Exec parses and runs a bash script against this environment.
A non-zero exit code is reported via BashExecResult.ExitCode and does NOT produce a non-nil error. The returned error is reserved for harness failures: parse errors (*ParseError), execution-limit overruns (*ExecutionLimitError), context cancellation (context.Canceled / context.DeadlineExceeded), and host-side I/O failures.
Concurrent Exec calls on the same *Bash serialize via an internal mutex.
Per the resolved decisions in the spec, background jobs (`&`) and `wait` run synchronously with virtual PIDs; `wait` is a no-op. Function definitions made inside a script live only for that Exec.
The following limits from the spec are enforced in this phase: MaxCommandCount, MaxLoopIterations, MaxCallDepth, MaxOutputSize. The remaining limits land in their owning phases (Phase 4 for expansion caps, Phase 11 for source-depth via the source/. builtin, etc.).
func (*Bash) FS ¶
func (b *Bash) FS() gbfs.FileSystem
FS returns the virtual filesystem this Bash is bound to. Useful for host-side inspection or post-Exec assertions in tests.
func (*Bash) History ¶
func (b *Bash) History() command.HistoryRing
History returns the live per-Bash command history ring. The runtime does NOT currently push parsed commands into the ring; hosts can populate it (or read from the `history` built-in's view) directly.
func (*Bash) RegisterTransformPlugin ¶
RegisterTransformPlugin appends a transform-pipeline plugin to the per-Bash plugin slice. The plugin runs on every subsequent Exec call (parse → plugins → serialize → re-parse → run) and its metadata payload is surfaced in BashExecResult.Metadata under the plugin's Name().
Calls to RegisterTransformPlugin acquire b.mu, so it is safe to call concurrently from outside Exec. Calling from inside a plugin's own Transform method or from a custom command's Run (which both hold b.mu) will deadlock — don't do that.
func (*Bash) Registry ¶
Registry returns the command dispatch registry. The returned pointer is the live registry consulted by every Exec call; mutating it between calls is supported (additional Register calls will be honored by subsequent Execs). Concurrent Register calls are NOT safe — if a host needs that, wrap your own mutex around the Register sites.
func (*Bash) Shopt ¶
func (b *Bash) Shopt() command.ShoptTable
Shopt returns the live per-Bash shell-option table. Hosts can pre-seed options (e.g. `expand_aliases`) before running scripts; the `shopt` builtin reads and mutates the same table.
type BashExecResult ¶
type BashExecResult struct {
ExecResult
Env map[string]string
Metadata map[string]any
}
BashExecResult is the result type returned by Bash.Exec. It embeds ExecResult and adds the post-execution exported environment plus a free-form Metadata bag populated by registered transform plugins (Phase 13).
type BashOptions ¶
type BashOptions struct {
Env map[string]string
Cwd string
ExecutionLimits *ExecutionLimits
Python *PythonConfig
JavaScript *JavaScriptConfig
Sleep SleepFunc
Logger Logger
Trace TraceFunc
ProcessInfo *ProcessInfo
// Files seeds the initial in-memory filesystem with the given
// path → FileInit entries. When FS is also supplied, Files is
// applied to that FileSystem instead of constructing a new memfs.
Files map[string]fs.FileInit
// FS replaces the default in-memory filesystem. When nil, gobash
// creates an empty memfs.FS at construction time. When non-nil,
// any Files entries are applied to FS via the FileSystem methods.
FS fs.FileSystem
// Commands restricts which built-in commands are registered. A
// nil slice registers every built-in (the default); a non-nil
// slice filters to exactly the named subset. CustomCommands are
// NOT filtered through this list — they always register.
//
// Phase 8 lands the filter wiring; Phase 10 lands the built-ins
// the filter actually selects from. Until Phase 10 the only
// observable effect is on Bash.Registry().Names() and the
// derived the spec /bin/X stub set.
Commands []command.Name
// CustomCommands override or extend the built-in registry. Each
// entry is registered last, so any name collision with a built-in
// is resolved in favor of the CustomCommand. Tests use this hook
// to inject deterministic sample commands without touching the
// built-in registration order.
CustomCommands []command.Command
// Fetch is the network Doer used by Phase 10's `curl` and any
// future network-touching built-in. When non-nil it overrides
// the default SecureFetch built from Network; tests use this hook
// to inject stub Doers. When nil, gobash falls back to
// network.NewSecureFetch(Network). Combining Fetch != nil with
// Network != nil is legal: Network is ignored.
Fetch network.Doer
// Network is the allow-list and policy used to build the default
// SecureFetch Doer when Fetch is nil. When both Fetch and Network
// are nil, command.Context.Fetch is nil at dispatch time and
// network-touching built-ins must error out cleanly.
Network *network.Config
// TransformPlugins is the ordered list of transform-pipeline
// plugins applied to every Exec call on this Bash. The plugins
// are appended to the per-Bash slice at New() time; hosts can
// add more later via Bash.RegisterTransformPlugin. Each plugin's
// metadata payload surfaces in BashExecResult.Metadata under the
// plugin's Name(). When the slice is empty, Exec runs the
// fast-path that skips the parse → serialize → re-parse round
// trip entirely (no observable effect from Phase 13).
TransformPlugins []transform.Plugin
// Deprecated convenience knobs — honored to match the just-bash TS
// surface. Prefer ExecutionLimits.
MaxCallDepth int
MaxCommandCount int
MaxLoopIterations int
}
BashOptions configures a Bash environment at construction time.
Phase 1 wires only the fields whose types are defined in this package. Subsequent phases extend this struct in place —:
- Phase 3 added Files (map[string]FileInit) and FS (fs.FileSystem)
- Phase 8 added Commands ([]command.Name) and CustomCommands
- Phase 9 adds Fetch (network.Doer) and Network (*network.Config)
All adds are field-only; existing fields keep their names and meaning.
type ExecOptions ¶
type ExecOptions struct {
Env map[string]string
ReplaceEnv bool
Cwd string
RawScript bool
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
// Args is appended to the first command bypassing parsing. Wiring
// lands in Phase 5 alongside the interpreter bridge; declared here
// to freeze the public surface.
Args []string
}
ExecOptions configures a single Exec call. Per-call settings override the per-Bash defaults.
type ExecResult ¶
ExecResult is the basic outcome of a script execution. A non-zero ExitCode is not, by itself, an error.
type ExecutionLimitError ¶
ExecutionLimitError is returned by Exec when a script trips an execution limit threshold. Use errors.As to extract the offending Limit name and the configured Value at the time of the failure.
Enforcement of each limit lands across multiple phases (counters live in Phase 2, expansion-side caps in Phase 4); the error type itself is part of the Phase 1 public surface.
func (*ExecutionLimitError) Error ¶
func (e *ExecutionLimitError) Error() string
type ExecutionLimits ¶
type ExecutionLimits struct {
MaxCallDepth *int
MaxCommandCount *int
MaxLoopIterations *int
MaxAwkIterations *int
MaxSedIterations *int
MaxJqIterations *int
MaxSqliteTimeout *time.Duration
MaxPythonTimeout *time.Duration
MaxJsTimeout *time.Duration
MaxGlobOperations *int
MaxStringLength *int
MaxArrayElements *int
MaxHeredocSize *int
MaxSubstitutionDepth *int
MaxBraceExpansionResults *int
MaxOutputSize *int
MaxFileDescriptors *int
MaxSourceDepth *int
}
ExecutionLimits caps script behavior. A nil field falls through to the documented default; a non-nil pointer field overrides per-construction. The full default table is frozen in the spec
type ExitError ¶
type ExitError struct {
Code int
}
ExitError is the internal signal raised by the `exit N` builtin. The runtime translates it into BashExecResult.ExitCode at the Exec boundary; it is therefore rarely observed by callers but is exported for parity with the just-bash error class.
type InvokeToolFunc ¶
type InvokeToolFunc = command.InvokeToolFunc
InvokeToolFunc is the host hook invoked from JavaScript-side tool calls. It returns the tool's JSON-serialized result. Aliased to command.InvokeToolFunc.
type JavaScriptConfig ¶
type JavaScriptConfig struct {
Bootstrap string
InvokeTool InvokeToolFunc
}
JavaScriptConfig configures the opt-in JavaScript runtime (Phase 15).
type LexerError ¶
LexerError reports a lexer/tokenizer-level failure.
func (*LexerError) Error ¶
func (e *LexerError) Error() string
type Logger ¶
type Logger interface {
Info(msg string, fields map[string]any)
Debug(msg string, fields map[string]any)
}
Logger receives structured log records emitted by the runtime.
type ParseError ¶
type ParseError = parser.ParseError
ParseError is the typed error returned by the parser front-end. It is defined in the parser subpackage and re-exported here via a type alias so existing call sites and tests that reference gobash.ParseError continue to compile unchanged.
Consumers should match it with errors.As against either spelling.
type PosixFatalError ¶
PosixFatalError signals a POSIX-mode fatal shell error (e.g. `set -e` hitting a non-zero command in a POSIX-mandated context).
func (*PosixFatalError) Error ¶
func (e *PosixFatalError) Error() string
type ProcessInfo ¶
ProcessInfo carries virtualized process identifiers exposed to scripts via $$, $PPID, etc. Zero value yields the package defaults (see The spec: PID=1, PPID=0, UID=1000, GID=1000).
type PythonConfig ¶
type PythonConfig struct{}
PythonConfig configures the opt-in Python hook (Phase 16). The Runtime field is added in Phase 16 once the PythonRuntime interface is defined; the zero value here exists so callers can pass *PythonConfig today without breaking when the field is introduced.
type ResolvedLimits ¶
ResolvedLimits is ExecutionLimits with all defaults applied. The runtime threads a value of this type rather than ExecutionLimits so internal callsites never have to nil-check.
As of Phase 10 ResolvedLimits is a type alias for command.Limits so the dispatch Context can carry the same struct without conversion; the alias keeps the gobash.ResolvedLimits public surface stable.
func DefaultLimits ¶
func DefaultLimits() ResolvedLimits
DefaultLimits returns the fully-resolved default execution limits. The values are law — they must match the spec exactly. Tests assert this; do not adjust either side without updating the spec.
func ResolveLimits ¶
func ResolveLimits(in *ExecutionLimits) ResolvedLimits
ResolveLimits returns the effective limits, applying defaults to any nil-valued field of in. A nil in yields the defaults verbatim.
type SecurityViolationError ¶
type SecurityViolationError struct {
Msg string
}
SecurityViolationError mirrors the just-bash class of the same name. The Go port enforces its threat model architecturally (no os/exec, virtual FS, allow-listed network) so this error type is rarely emitted; it is kept for direct API parity so host code that switches on it ports over.
func (*SecurityViolationError) Error ¶
func (e *SecurityViolationError) Error() string
type SleepFunc ¶
SleepFunc replaces the real time.Sleep used by `sleep`, `timeout`, and related builtins. Returning a non-nil error aborts the sleeping call. Aliased to command.SleepFunc so dispatch Contexts and BashOptions share a single underlying func signature (no conversion needed).
type TraceEvent ¶
type TraceEvent = command.TraceEvent
TraceEvent describes a single instrumentation point. Aliased to command.TraceEvent so the dispatch Context's Trace hook and a host-supplied BashOptions.Trace share one type.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ast defines the typed Go AST that mirrors the just-bash TypeScript shape in src/ast/types.ts.
|
Package ast defines the typed Go AST that mirrors the just-bash TypeScript shape in src/ast/types.ts. |
|
Package builtins is the meta-package that side-effect-imports every Phase 10 built-in.
|
Package builtins is the meta-package that side-effect-imports every Phase 10 built-in. |
|
alias
Package alias implements the `alias` built-in.
|
Package alias implements the `alias` built-in. |
|
awk
Package awk implements the `awk` built-in.
|
Package awk implements the `awk` built-in. |
|
base64
Package base64 implements the `base64` built-in.
|
Package base64 implements the `base64` built-in. |
|
basename
Package basename implements the `basename` built-in.
|
Package basename implements the `basename` built-in. |
|
bash
Package bash implements the `bash` built-in.
|
Package bash implements the `bash` built-in. |
|
breakcmd
Package breakcmd implements the `break` shell built-in.
|
Package breakcmd implements the `break` shell built-in. |
|
cat
Package cat implements the `cat` built-in.
|
Package cat implements the `cat` built-in. |
|
cd
Package cd implements the `cd` shell built-in.
|
Package cd implements the `cd` shell built-in. |
|
chmod
Package chmod implements the `chmod` built-in.
|
Package chmod implements the `chmod` built-in. |
|
clear
Package clear implements the `clear` built-in.
|
Package clear implements the `clear` built-in. |
|
colon
Package colon implements the `:` (colon) shell built-in.
|
Package colon implements the `:` (colon) shell built-in. |
|
column
Package column implements the `column` built-in.
|
Package column implements the `column` built-in. |
|
comm
Package comm implements the `comm` built-in.
|
Package comm implements the `comm` built-in. |
|
compgen
Package compgen implements the `compgen` shell built-in.
|
Package compgen implements the `compgen` shell built-in. |
|
complete
Package complete implements the `complete` shell built-in.
|
Package complete implements the `complete` shell built-in. |
|
compopt
Package compopt implements the `compopt` shell built-in.
|
Package compopt implements the `compopt` shell built-in. |
|
continuecmd
Package continuecmd implements the `continue` shell built-in.
|
Package continuecmd implements the `continue` shell built-in. |
|
cp
Package cp implements the `cp` built-in.
|
Package cp implements the `cp` built-in. |
|
curl
Package curl implements the `curl` built-in.
|
Package curl implements the `curl` built-in. |
|
cut
Package cut implements the `cut` built-in.
|
Package cut implements the `cut` built-in. |
|
date
Package date implements the `date` built-in.
|
Package date implements the `date` built-in. |
|
declare
Package declare implements the `declare` shell built-in.
|
Package declare implements the `declare` shell built-in. |
|
diff
Package diff implements the `diff` built-in.
|
Package diff implements the `diff` built-in. |
|
dirname
Package dirname implements the `dirname` built-in.
|
Package dirname implements the `dirname` built-in. |
|
dirs
Package dirs implements the `dirs` shell built-in.
|
Package dirs implements the `dirs` shell built-in. |
|
du
Package du implements the `du` built-in.
|
Package du implements the `du` built-in. |
|
echo
Package echo implements the `echo` built-in.
|
Package echo implements the `echo` built-in. |
|
egrep
Package egrep implements the `egrep` built-in — grep with the extended-regex (-E) mode as the default.
|
Package egrep implements the `egrep` built-in — grep with the extended-regex (-E) mode as the default. |
|
env
Package env implements the `env` built-in.
|
Package env implements the `env` built-in. |
|
eval
Package eval implements the `eval` shell built-in.
|
Package eval implements the `eval` shell built-in. |
|
exit
Package exit implements the `exit` shell built-in.
|
Package exit implements the `exit` shell built-in. |
|
expand
Package expand implements the `expand` built-in.
|
Package expand implements the `expand` built-in. |
|
export
Package export implements the `export` shell built-in.
|
Package export implements the `export` shell built-in. |
|
expr
Package expr implements the `expr` built-in.
|
Package expr implements the `expr` built-in. |
|
falsecmd
Package falsecmd implements the `false` built-in.
|
Package falsecmd implements the `false` built-in. |
|
fgrep
Package fgrep implements the `fgrep` built-in — grep with the fixed-string (-F) mode as the default.
|
Package fgrep implements the `fgrep` built-in — grep with the fixed-string (-F) mode as the default. |
|
file
Package file implements the `file` built-in.
|
Package file implements the `file` built-in. |
|
find
Package find implements the `find` built-in.
|
Package find implements the `find` built-in. |
|
fold
Package fold implements the `fold` built-in.
|
Package fold implements the `fold` built-in. |
|
getopts
Package getopts implements the `getopts` shell built-in.
|
Package getopts implements the `getopts` shell built-in. |
|
grep
Package grep implements the `grep`, `egrep`, and `fgrep` built-ins.
|
Package grep implements the `grep`, `egrep`, and `fgrep` built-ins. |
|
gunzip
Package gunzip implements the `gunzip` built-in — gzip with the decompress mode as the default.
|
Package gunzip implements the `gunzip` built-in — gzip with the decompress mode as the default. |
|
gzip
Package gzip implements the `gzip`, `gunzip`, and `zcat` built-ins.
|
Package gzip implements the `gzip`, `gunzip`, and `zcat` built-ins. |
|
hash
Package hash implements the `hash` shell built-in.
|
Package hash implements the `hash` shell built-in. |
|
head
Package head implements the `head` built-in.
|
Package head implements the `head` built-in. |
|
help
Package help implements the `help` built-in.
|
Package help implements the `help` built-in. |
|
history
Package history implements the `history` built-in.
|
Package history implements the `history` built-in. |
|
hostname
Package hostname implements the `hostname` built-in.
|
Package hostname implements the `hostname` built-in. |
|
htmltomarkdown
Package htmltomarkdown implements the `html-to-markdown` built-in.
|
Package htmltomarkdown implements the `html-to-markdown` built-in. |
|
jobs
Package jobs implements the `jobs` shell built-in.
|
Package jobs implements the `jobs` shell built-in. |
|
join
Package join implements the `join` built-in.
|
Package join implements the `join` built-in. |
|
jq
Package jq implements the `jq` built-in.
|
Package jq implements the `jq` built-in. |
|
let
Package let implements the `let` shell built-in.
|
Package let implements the `let` shell built-in. |
|
ln
Package ln implements the `ln` built-in.
|
Package ln implements the `ln` built-in. |
|
local
Package local implements the `local` shell built-in.
|
Package local implements the `local` shell built-in. |
|
ls
Package ls implements the `ls` built-in.
|
Package ls implements the `ls` built-in. |
|
mapfile
Package mapfile implements the `mapfile` / `readarray` shell built-ins.
|
Package mapfile implements the `mapfile` / `readarray` shell built-ins. |
|
md5sum
Package md5sum implements the `md5sum` built-in.
|
Package md5sum implements the `md5sum` built-in. |
|
mkdir
Package mkdir implements the `mkdir` built-in.
|
Package mkdir implements the `mkdir` built-in. |
|
mv
Package mv implements the `mv` built-in.
|
Package mv implements the `mv` built-in. |
|
nl
Package nl implements the `nl` built-in.
|
Package nl implements the `nl` built-in. |
|
od
Package od implements the `od` built-in.
|
Package od implements the `od` built-in. |
|
paste
Package paste implements the `paste` built-in.
|
Package paste implements the `paste` built-in. |
|
popd
Package popd implements the `popd` shell built-in.
|
Package popd implements the `popd` shell built-in. |
|
printenv
Package printenv implements the `printenv` built-in.
|
Package printenv implements the `printenv` built-in. |
|
printf
Package printf implements the `printf` built-in (/ §10.18 details).
|
Package printf implements the `printf` built-in (/ §10.18 details). |
|
pushd
Package pushd implements the `pushd` shell built-in.
|
Package pushd implements the `pushd` shell built-in. |
|
pwd
Package pwd implements the `pwd` built-in.
|
Package pwd implements the `pwd` built-in. |
|
read
Package read implements the `read` shell built-in.
|
Package read implements the `read` shell built-in. |
|
readlink
Package readlink implements the `readlink` built-in.
|
Package readlink implements the `readlink` built-in. |
|
readonly
Package readonly implements the `readonly` shell built-in.
|
Package readonly implements the `readonly` shell built-in. |
|
returncmd
Package returncmd implements the `return` shell built-in.
|
Package returncmd implements the `return` shell built-in. |
|
rev
Package rev implements the `rev` built-in.
|
Package rev implements the `rev` built-in. |
|
rg
Package rg implements the `rg` (ripgrep) built-in subset (/ Wave D).
|
Package rg implements the `rg` (ripgrep) built-in subset (/ Wave D). |
|
rm
Package rm implements the `rm` built-in.
|
Package rm implements the `rm` built-in. |
|
rmdir
Package rmdir implements the `rmdir` built-in.
|
Package rmdir implements the `rmdir` built-in. |
|
sed
Package sed implements the `sed` built-in.
|
Package sed implements the `sed` built-in. |
|
seq
Package seq implements the `seq` built-in.
|
Package seq implements the `seq` built-in. |
|
set
Package set implements the `set` shell built-in.
|
Package set implements the `set` shell built-in. |
|
sh
Package sh implements the `sh` built-in — a thin shim around the `bash` built-in.
|
Package sh implements the `sh` built-in — a thin shim around the `bash` built-in. |
|
sha1sum
Package sha1sum implements the `sha1sum` built-in.
|
Package sha1sum implements the `sha1sum` built-in. |
|
sha256sum
Package sha256sum implements the `sha256sum` built-in.
|
Package sha256sum implements the `sha256sum` built-in. |
|
shopt
Package shopt implements the `shopt` shell built-in.
|
Package shopt implements the `shopt` shell built-in. |
|
sleep
Package sleep implements the `sleep` built-in.
|
Package sleep implements the `sleep` built-in. |
|
sort
Package sort implements the `sort` built-in.
|
Package sort implements the `sort` built-in. |
|
source
Package source implements the `source` and `.` shell built-ins.
|
Package source implements the `source` and `.` shell built-ins. |
|
split
Package split implements the `split` built-in.
|
Package split implements the `split` built-in. |
|
sqlite3
Package sqlite3 registers a stub `sqlite3` built-in (// §14).
|
Package sqlite3 registers a stub `sqlite3` built-in (// §14). |
|
stat
Package stat implements the `stat` built-in.
|
Package stat implements the `stat` built-in. |
|
strings
Package strings implements the `strings` built-in.
|
Package strings implements the `strings` built-in. |
|
tac
Package tac implements the `tac` built-in.
|
Package tac implements the `tac` built-in. |
|
tail
Package tail implements the `tail` built-in.
|
Package tail implements the `tail` built-in. |
|
tar
Package tar implements the `tar` built-in.
|
Package tar implements the `tar` built-in. |
|
tee
Package tee implements the `tee` built-in.
|
Package tee implements the `tee` built-in. |
|
test
Package test implements the `[` and `test` shell built-ins.
|
Package test implements the `[` and `test` shell built-ins. |
|
time
Package time implements the `time` built-in.
|
Package time implements the `time` built-in. |
|
timeout
Package timeout implements the `timeout` built-in.
|
Package timeout implements the `timeout` built-in. |
|
touch
Package touch implements the `touch` built-in.
|
Package touch implements the `touch` built-in. |
|
tr
Package tr implements the `tr` built-in.
|
Package tr implements the `tr` built-in. |
|
trap
Package trap implements the `trap` shell built-in.
|
Package trap implements the `trap` shell built-in. |
|
tree
Package tree implements the `tree` built-in.
|
Package tree implements the `tree` built-in. |
|
truecmd
Package truecmd implements the `true` built-in.
|
Package truecmd implements the `true` built-in. |
|
umask
Package umask implements the `umask` shell built-in.
|
Package umask implements the `umask` shell built-in. |
|
unalias
Package unalias implements the `unalias` built-in.
|
Package unalias implements the `unalias` built-in. |
|
unexpand
Package unexpand implements the `unexpand` built-in.
|
Package unexpand implements the `unexpand` built-in. |
|
uniq
Package uniq implements the `uniq` built-in.
|
Package uniq implements the `uniq` built-in. |
|
unset
Package unset implements the `unset` shell built-in.
|
Package unset implements the `unset` shell built-in. |
|
wait
Package wait implements the `wait` shell built-in.
|
Package wait implements the `wait` shell built-in. |
|
wc
Package wc implements the `wc` built-in.
|
Package wc implements the `wc` built-in. |
|
which
Package which implements the `which` built-in.
|
Package which implements the `which` built-in. |
|
whoami
Package whoami implements the `whoami` built-in.
|
Package whoami implements the `whoami` built-in. |
|
xan
Package xan implements the `xan` CSV toolkit built-in.
|
Package xan implements the `xan` CSV toolkit built-in. |
|
xargs
Package xargs implements the `xargs` built-in.
|
Package xargs implements the `xargs` built-in. |
|
yq
Package yq implements the `yq` data-format swiss-army built-in.
|
Package yq implements the `yq` data-format swiss-army built-in. |
|
zcat
Package zcat implements the `zcat` built-in — `gunzip -c` shorthand.
|
Package zcat implements the `zcat` built-in — `gunzip -c` shorthand. |
|
cmd
|
|
|
gobash
command
Command gobash is the CLI entry point for the go-bash runtime.
|
Command gobash is the CLI entry point for the go-bash runtime. |
|
Package command defines the Command interface every gobash builtin implements, the Context value those builtins receive at dispatch time, the Result value they return, and the Registry that maps names to implementations.
|
Package command defines the Command interface every gobash builtin implements, the Context value those builtins receive at dispatch time, the Result value they return, and the Registry that maps names to implementations. |
|
Package fs defines the virtual filesystem interface used by go-bash and utility functions for path manipulation.
|
Package fs defines the virtual filesystem interface used by go-bash and utility functions for path manipulation. |
|
fstest
Package fstest provides a contract test suite shared by every FileSystem implementation in go-bash.
|
Package fstest provides a contract test suite shared by every FileSystem implementation in go-bash. |
|
memfs
Package memfs implements an in-memory FileSystem suitable for use as the default backing store of a Bash sandbox.
|
Package memfs implements an in-memory FileSystem suitable for use as the default backing store of a Bash sandbox. |
|
mountfs
Package mountfs implements a mount-table FileSystem composed of one or more child FileSystems mounted at virtual paths over a base FS.
|
Package mountfs implements a mount-table FileSystem composed of one or more child FileSystems mounted at virtual paths over a base FS. |
|
overlayfs
Package overlayfs implements an overlay FileSystem where writes land in an in-memory overlay and reads come from the overlay-or-real-disk union.
|
Package overlayfs implements an overlay FileSystem where writes land in an in-memory overlay and reads come from the overlay-or-real-disk union. |
|
realfs
Package realfs holds the security helpers shared by the read-write and overlay filesystems.
|
Package realfs holds the security helpers shared by the read-write and overlay filesystems. |
|
rwfs
Package rwfs implements a read-write FileSystem that maps virtual paths under a sandbox root onto the host filesystem.
|
Package rwfs implements a read-write FileSystem that maps virtual paths under a sandbox root onto the host filesystem. |
|
internal
|
|
|
alias
Package alias implements parse-time alias expansion for go-bash.
|
Package alias implements parse-time alias expansion for go-bash. |
|
builtinutil
Package builtinutil contains small helpers shared by Phase 10's Wave A built-in command packages.
|
Package builtinutil contains small helpers shared by Phase 10's Wave A built-in command packages. |
|
cmpfixture
Package cmpfixture is the comparison-test harness for go-bash.
|
Package cmpfixture is the comparison-test harness for go-bash. |
|
ringbuf
Package ringbuf provides a bounded output writer used by the bash runtime to enforce the spec's MaxOutputSize limit.
|
Package ringbuf provides a bounded output writer used by the bash runtime to enforce the spec's MaxOutputSize limit. |
|
runtimestate
Package runtimestate carries the per-Bash mutable state shared between built-in commands and the runtime.
|
Package runtimestate carries the per-Bash mutable state shared between built-in commands and the runtime. |
|
Package interp builds and configures the mvdan.cc/sh/v3/interp runner with the gobash customization hooks.
|
Package interp builds and configures the mvdan.cc/sh/v3/interp runner with the gobash customization hooks. |
|
Package network is the gobash secure HTTP layer.
|
Package network is the gobash secure HTTP layer. |
|
Package parser exposes the public Parse / ParseString entry points and the typed ParseError returned on failure.
|
Package parser exposes the public Parse / ParseString entry points and the typed ParseError returned on failure. |
|
Package sandbox is an OPTIONAL convenience wrapper around *gobash.Bash that mimics the shape of Vercel's @vercel/sandbox SDK so code targeting that hosted runtime can swap to go-bash as a drop-in local mock.
|
Package sandbox is an OPTIONAL convenience wrapper around *gobash.Bash that mimics the shape of Vercel's @vercel/sandbox SDK so code targeting that hosted runtime can swap to go-bash as a drop-in local mock. |
|
Package sqlite is the OPTIONAL `sqlite3` runtime for go-bash.
|
Package sqlite is the OPTIONAL `sqlite3` runtime for go-bash. |
|
Package transform exposes the Serialize entry point that renders an *ast.Script back to bash source.
|
Package transform exposes the Serialize entry point that renders an *ast.Script back to bash source. |
|
plugins/collector
Package collector implements the CommandCollectorPlugin: a read-only transform plugin that walks the parsed AST and reports the command name of every leaf SimpleCommand it encounters.
|
Package collector implements the CommandCollectorPlugin: a read-only transform plugin that walks the parsed AST and reports the command name of every leaf SimpleCommand it encounters. |
|
plugins/tee
Package tee implements the TeePlugin: a transform plugin that wraps every non-trivial pipeline stage with `| tee /OUT/<idx>-<cmd>.stdout.txt` so the host can post-mortem the per-stage output of a script.
|
Package tee implements the TeePlugin: a transform plugin that wraps every non-trivial pipeline stage with `| tee /OUT/<idx>-<cmd>.stdout.txt` so the host can post-mortem the per-stage output of a script. |