--- id: bashkit version: "0.16.0" license: MIT license_treatment: permissive maintenance: active --- # bashkit — A sandboxed bash interpreter for AI agents License: permissive · Maintenance: active · Downloads: 272.1K/mo ## What it is and what it does Bashkit embeds a bash interpreter directly into Python via Rust native bindings, letting you execute bash scripts and commands in-process without spawning subprocesses or containers. It maintains persistent state (variables, working directory, virtual filesystem) across calls and includes 164 built-in commands like grep, sed, awk, jq, curl, and find. The package is designed for AI agents and automation workflows where you need fast, controlled bash execution with a virtual filesystem layer. The interpreter supports full bash syntax—pipelines, redirects, loops, functions, arrays—and offers both synchronous and asynchronous execution modes. You can mount real filesystem paths (read-only or writable), pre-populate virtual files, stream output via callbacks, and control network access through an explicit allowlist. Credentials can be injected transparently or via environment variable placeholders. It integrates with LangChain, PydanticAI, and Deep Agents for agent-based workflows. Use it for: - Run bash scripts inside AI agents without subprocess overhead or container orchestration. - Execute untrusted bash code in a sandboxed environment with controlled filesystem and network access. - Maintain bash interpreter state (variables, cwd, mounted files) across multiple Python function calls. - Stream live bash output during execution via callbacks for real-time monitoring or logging. - Inject secrets and credentials into bash scripts transparently without exposing them to the script itself. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Bashkit is a sandboxed bash interpreter for Python that runs bash scripts in-process with native bindings to a Rust core, providing full bash syntax support and 164 built-in commands without containers or subprocess overhead. Yes, if you need in-process bash execution for AI agents or automation. The active maintenance, zero runtime dependencies, permissive MIT license, and no known vulnerabilities make it low-risk. Medium install friction (compiled wheels) is typical for Rust-backed packages and not a blocker. Verify performance and sandboxing guarantees match your threat model before deploying to production. ## Install pip install bashkit uv add bashkit poetry add bashkit ## Installing bashkit Before you install: Medium install friction due to compiled wheels (cp39-abi3 bindings across multiple platforms). Active maintenance with a release 7 days ago and 236 repository stars. Supports Python 3.9 through 3.14 with no runtime dependencies, making it straightforward to add once installed. License in practice: MIT license (permissive) means you can use, modify, and distribute bashkit freely in commercial or proprietary projects with minimal restrictions—only attribution is required. Quickstart: from bashkit import Bash bash = Bash() result = bash.execute_sync("echo 'Hello, World!'") print(result.stdout) # Hello, World! Requires Python 3.9 or later; compiled wheels are provided for macOS (x86_64, arm64), Linux (x86_64, aarch64, musl), and Windows (x86_64). Verify before relying: - Performance characteristics and memory overhead compared to subprocess-based bash execution. - Completeness of the 164 built-in commands and edge cases in bash syntax compatibility. - Security audit status and threat model documentation for the sandboxing guarantees. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 272.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sandboxed bash interpreter python, in-process bash execution, bash sandbox for ai agents, virtual filesystem bash, bash scripting without subprocess, bash-sandbox, ai-agents, rust-bindings [View on SkillFed](https://skillfed.io/packages/bashkit) · [View on PyPI](https://pypi.org/project/bashkit/)