bash-tool
A generic bash tool for AI agents, compatible with the AI SDK, that runs commands in a just-bash or Vercel Sandbox environment.
At a Glance
bash-tool is a generic bash tool for AI agents, released under the MIT License. It is free to use, copy, modify and distribute.
Engagement
Available On
Listed Oct 2026
About bash-tool
bash-tool is an open-source TypeScript package from Vercel Labs that gives AI agents a bash tool, a file-reading tool and a file-writing tool. It is compatible with the AI SDK and runs commands against the just-bash virtual environment by default, or against a full VM sandbox.
What It Is
bash-tool exposes three tools to an agent: bash (runs a command and returns stdout, stderr and exit code), readFile and writeFile (which creates parent directories as needed). A developer calls createBashTool with initial files or a local directory to upload, then passes the resulting tools to an AI SDK agent such as ToolLoopAgent. For analysis agents, the bash tool alone may be enough.
Sandbox Options
By default it pairs with just-bash, a TypeScript bash interpreter with an in-memory filesystem built for AI agents. The just-bash project describes itself as beta software. For full VM support, bash-tool can use @vercel/sandbox or another sandbox product, including reconnecting to an existing sandbox by ID across serverless invocations. Developers can also supply a custom just-bash instance or implement their own sandbox with executeCommand, readFile and writeFiles.
Control and Extensibility
onBeforeBashCall and onAfterBashCall hooks let developers log, rewrite or block commands and modify results. An experimental skills feature discovers directories containing a SKILL.md file, with optional scripts, and exposes them through a skill tool alongside the bash tool.
Community Discussions
Be the first to start a conversation about bash-tool
Share your experience with bash-tool, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
bash-tool is a generic bash tool for AI agents, released under the MIT License. It is free to use, copy, modify and distribute.
- MIT License
- Bash, readFile and writeFile tools for AI SDK agents
- Works with just-bash or @vercel/sandbox, which is a separate product
- Self-hosted via npm install
Capabilities
Key Features
- bash, readFile and writeFile tools for AI agents
- Upload local directories with glob filters
- Pre- and post-command interception hooks
- Custom sandbox implementation interface
- Persistent sandbox reconnection via Sandbox.get
- Experimental skill tool using SKILL.md directories
- Works with just-bash in-memory virtual filesystem
