Skip to main content
fs.bash(...) builds a just-bash interpreter rooted at the mounted filesystem. Commands run against MesaFS; no host shell is spawned.

Options

Record<string, string> | undefined
Environment variables for the shell. The host process environment is not inherited unless you pass it explicitly.
string | undefined
Working directory inside the mount. Defaults to /.
object | undefined
Limits for command count, loops, output sizes, and related execution safety controls.
CommandName[] | undefined
Restrict available built-in command names.
Record<string, CustomCommand> | undefined
Register custom command implementations.
NetworkConfig | undefined
Enable network commands with explicit URL policy.
SecureFetch | undefined
Custom secure fetch implementation used by network-enabled commands.
object | undefined
Python execution configuration. Disabled by default.
object | undefined
JavaScript execution configuration. Disabled by default.
BashLogger | undefined
Receives command execution logs.

exec()

exec(command) takes one string containing one or more shell statements.
string
required
Shell script to execute.

Response

exec(...) returns ExecResult from just-bash.
string
Standard output.
string
Standard error.
number
Process exit code. 0 indicates success.
Record<string, string>
Resulting shell environment when included by just-bash.

Command failures

Command failures usually return a non-zero exitCode; they do not automatically raise.

Binary files

Use fs.readFileBuffer(...) for binary files. Text-oriented shell commands such as cat are intended for text output.