Get started in Node, Bun & Deno#
Embed the Bashkit sandbox in a server-side JavaScript or TypeScript runtime.
@everruns/bashkit is a NAPI native addon — the fastest JS binding — for Node
(≥ 18), Bun, and Deno. For browsers and edge runtimes, use Get started in the
browser instead.
Install#
npm i @everruns/bashkit
First script#
import { Bash } from "@everruns/bashkit";
const bash = new Bash();
const result = bash.executeSync('echo "Hello, World!"');
console.log(result.stdout);
Persistent state#
A Bash instance keeps its environment and virtual filesystem across calls:
const bash = new Bash();
bash.executeSync("X=42");
console.log(bash.executeSync("echo $X").stdout); // 42
Sandbox options#
Pass resource limits, identity, and seed files to the constructor:
const bash = new Bash({
cwd: "/home/agent",
env: { HOME: "/home/agent" },
maxCommands: 1000,
maxLoopIterations: 10000,
maxMemory: 64 * 1024 * 1024,
});
See Sandbox configuration & limits for the full set.
Examples#
Runnable Node examples in the repo:
bash_basics.mjs— first scripts and persistent statedata_pipeline.mjs— pipes and data processingcustom_builtins.mjs— registering JS callbacks as bash commandsllm_tool.mjs— exposing Bashkit as an LLM tool- Agent integrations: LangChain, Vercel AI, OpenAI
Next steps#
- Custom builtins (JS) — add your own JavaScript-backed commands.
- Sandbox configuration & limits — resource limits and sandbox options.
- LLM tools — expose Bashkit as a sandboxed tool for agent frameworks.