๐ป fbash
Token-budgeted shell execution with classification and session state
Section titled โToken-budgeted shell execution with classification and session stateโfbash is part of the fsuite toolkit โ a set of fourteen CLI tools built for AI coding agents.
fbash is bash with the same agent-aware budget discipline as the rest of fsuite. Output is capped, classified (stdout vs stderr vs status), and the working directory + fcase/session state persist between calls. Note: exported environment variables do not persist across fbash invocations โ each call starts a fresh shell with cd restored.
The MCP escape hatch. If youโre calling fsuite tools through the MCP server, every call is sequential โ MCP doesnโt pipe. But fbash runs a real shell, which means real Unix pipes work inside it. Wrap your chain in one fbash call and get full pipeline speed back, even from MCP-only agents.
Canonical chains
Section titled โCanonical chainsโ# Run a real Unix pipe from inside MCP โ the escape hatchfbash "fsearch -o paths '*.py' src | fmap -o json"
# Triple-chain inside one fbash callfbash "fsearch -o paths '*.py' src \ | fcontent -o paths 'class' \ | fmap -o json"
# Stateful session โ cd persists to the next call (env vars do not)fbash "cd /project"fbash "pwd" # โ /project (cd was preserved)
# Long-running with capfbash "find / -name '*.log' 2>/dev/null" # output capped automaticallyHelp output
Section titled โHelp outputโThe content below is the live --help output of fbash, captured at build time from the tool binary itself. It cannot drift from the source โ regenerating the docs regenerates this section.
fbash โ token-budgeted shell execution for fsuite
USAGE fbash --command '<cmd>' [options] fbash '<cmd>' [options]
OPTIONS --command <cmd> Bash command to execute (or pass as positional arg) --max-lines <n> Cap stdout to n lines (default: 200) --max-bytes <n> Cap stdout to n bytes (default: 51200) --no-truncate, --full Disable stdout line/byte caps --json Parse command output as JSON --cwd <path> Working directory (overrides session CWD) --timeout <secs> Timeout in seconds (auto-tuned by class if omitted) --env <KEY=VALUE> Environment override (repeatable) --filter <regex> Regex filter for output lines --quiet Suppress stdout/stderr, return exit code + metadata --tag <label> Label for fcase event logging --background Run in background, return job_id --tail Keep tail instead of head when truncating -o, --output <fmt> Output format: pretty (default) or json --history Show command history from session --version Show version -h, --help Show this help
INTERNAL COMMANDS __fbash_history Return command history __fbash_session Return full session state __fbash_reset Clear session state __fbash_poll <id> Check background job status __fbash_jobs List background jobs __fbash_set_case <s> Set active fcase slug __fbash_clear_case Clear active fcase
EXAMPLES fbash --command 'git status' fbash --command 'npm test' --tail --max-lines 100 fbash --command 'find . -name "*.ts"' -o json fbash --command 'npm run build' --background fbash --command '__fbash_poll fbash_1712035200_12345'See also
Section titled โSee alsoโ- fsuite mental model โ how fbash fits into the toolchain
- Cheat sheet โ one-line recipes for every tool
- View source on GitHub