Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Bashkit Examples

realfs_mount.sh

Mount host directories into a sandboxed bashkit session. Demonstrates --mount-ro (readonly) and --mount-rw (read-write) CLI flags.

cargo build -p bashkit-cli --features realfs
bash examples/realfs_mount.sh

ticket-cli.sh

Run the wedow/ticket issue tracker inside bashkit. Exercises plugin discovery via PATH, awk-heavy scripts, YAML frontmatter parsing, dependency trees, and filtered listing, all interpreted.

cargo build -p bashkit-cli --features realfs
bash examples/ticket-cli.sh

ticket-cli.sh checks out a pinned wedow/ticket commit by default for reproducibility/supply-chain safety. Override with TICKET_REF=<commit>.

Python

Python examples use PEP 723 inline script metadata. uv run resolves dependencies automatically, bashkit installs from PyPI as a pre-built wheel (no Rust toolchain needed).

bash_basics.py / k8s_orchestrator.py

Core features, live output callbacks, and ScriptedTool orchestration:

uv run crates/bashkit-python/examples/bash_basics.py
uv run crates/bashkit-python/examples/k8s_orchestrator.py

treasure_hunt_agent.py

LangChain agent with Bashkit sandbox.

export ANTHROPIC_API_KEY=your_key
uv run examples/treasure_hunt_agent.py

deepagent_coding_agent.py

Deep Agents with Bashkit middleware + backend.

export ANTHROPIC_API_KEY=your_key
uv run examples/deepagent_coding_agent.py

docs-grep-agent/

Minimal LangChain/LangGraph console agent for Bashkit docs Q&A. It exposes Bashkit's built-in bash tool to the model, which writes compact rg, grep, and sed search scripts against real docs and a curated examples view mounted read-only under /docs. The whole session filesystem is read-only, so copy/write attempts into /tmp fail too.

cd examples/docs-grep-agent
export OPENAI_API_KEY=sk-...
uv run docs-grep-agent "what is bashkit"
uv run docs-grep-agent --show-tools "give me example on how to use bashkit cli"

JavaScript / TypeScript

JS examples install @everruns/bashkit from npm. All dependencies are in examples/package.json:

cd examples && pnpm install

bash_basics.mjs

Core features: execution, pipelines, variables, loops, jq, error handling, reset.

node examples/bash_basics.mjs

data_pipeline.mjs

Real-world data tasks: CSV processing, JSON transformation, log analysis, report generation.

node examples/data_pipeline.mjs

llm_tool.mjs

Wire BashTool into any AI framework: tool definition, simulated tool-call loop, generic adapter.

node examples/llm_tool.mjs

custom_builtins.mjs

Register JS callbacks as persistent bash builtins via customBuiltins and addBuiltin(). Covers sync + async callbacks, VFS persistence across execute() calls, post-construction registration without rebuilding the interpreter, override precedence (shell function > custom builtin > baked-in builtin), error handling, and BashTool integration.

node examples/custom_builtins.mjs

openai_tool.mjs

OpenAI function calling with manual tool-call loop.

export OPENAI_API_KEY=sk-...
node examples/openai_tool.mjs

vercel_ai_tool.mjs

Vercel AI SDK tool() + generateText() with automatic tool-call loop.

export OPENAI_API_KEY=sk-...
node examples/vercel_ai_tool.mjs

langchain_agent.mjs

LangChain.js ReAct agent with DynamicStructuredTool.

export OPENAI_API_KEY=sk-...
node examples/langchain_agent.mjs

browser/

Bashkit running in the browser via WebAssembly. A minimal terminal UI that lets you type bash commands and see output, all executed client-side in a sandboxed WASM interpreter.

Requires Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers for SharedArrayBuffer support (Vite config handles this).

cd examples/browser
pnpm install
pnpm run dev