← Catalog

pi-extension-e2b

E2B cloud sandbox integration for pi — redirects all tool execution to a remote E2B sandbox

Package

Install

Install with PiG

pig install npm:pi-extension-e2b

Install with Pi

pi install npm:pi-extension-e2b
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 2.0.0 (README.md). PiG does not review it.

pi-extension-e2b

E2B cloud sandbox integration for pi. Redirects all tool execution (bash, read, write, edit, ls, find, grep) to an E2B cloud sandbox, giving the agent a full Linux environment with internet access — completely isolated from your local machine.

Install

pi install npm:pi-extension-e2b

Setup

Set your E2B API key:

export E2B_API_KEY=your_key_here

Requirements

  • pi >=0.80.0
  • e2b SDK v2 requires Node >=20.18.1 when pi runs under Node
  • Custom templates built with envd <0.2.0 must be rebuilt; v2 sandboxes are secure by default

Usage

pi --e2b                          # Create new sandbox (no file sync)
pi --e2b --e2b-sync              # Create new sandbox and sync local files
pi --e2b --e2b-persist           # Pause sandbox on session end or timeout
pi --e2b --e2b-template custom    # Use a custom E2B template
pi --e2b --e2b-sandbox <id>       # Reconnect to an existing sandbox

Commands

CommandDescription
/e2bShow sandbox status & info
/e2b-uploadUpload local file(s) to the sandbox
/e2b-downloadDownload file(s) from the sandbox
/e2b-pausePause the sandbox and restore local tools
/e2b-listList pi-created sandboxes; reconnect or kill one
/e2b-reconnectConnect to an existing sandbox by ID

Persistence

With --e2b-persist, the sandbox is paused instead of killed when the session ends or its timeout fires. Use /e2b-reconnect <id> or /e2b-list to resume it later; /e2b-list can also kill paused sandboxes. Paused sandboxes retain their state but accrue E2B storage charges until they are killed.

Keyboard Shortcut

Ctrl+Shift+E — Toggle E2B sandbox on/off mid-session. With --e2b-persist, disabling pauses the sandbox instead of killing it.

LLM-Callable Tools

ToolDescription
e2b_port_urlGet the public URL for a port running in the sandbox

How It Works

When enabled, the extension replaces all 7 built-in pi tools (bash, read, write, edit, ls, find, grep) with E2B-backed implementations that execute in the remote sandbox. New sandboxes are tagged with app=pi-e2b and the local project name for listing. File sync uses git archive (or tar fallback) to upload your project. A keepalive timer extends the sandbox timeout automatically.

License

MIT