Raised: $0
0% of monthly goal Help us cross the finish line!
Goal: $12,000
Raised: $0 Goal: $12,000
0% of monthly goal Help us cross the finish line!
Sponsor DDEV

If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.

add-on registry tests last commit release

DDEV add-on for Pi Coding Agent

This DDEV add-on provides a fully containerized, isolated environment for the Pi Coding Agent.

Architecture & security

For a detailed diagram and breakdown of the system’s components and security boundaries, please see the Architecture document.

Warning

While process isolation is provided by the container, running coding agents on a local read-write workspace carries inherent security risks (such as prompt injection, credential leaks and host-execution escapes). Please see the Security Advisory to understand these risks and learn how to harden your setup.

Requirements

Installation

ddev add-on get mxr576/ddev-pi
ddev restart && ddev start --profiles=pi

Updating

When updating this add-on (or changing files that affect the Pi Docker image), a standard ddev restart or ddev restart --no-cache will not rebuild the Pi container image because the Pi service is gated behind an optional Docker Compose profile (tracked in ddev/ddev#8817).

To update the add-on and properly rebuild and restart the Pi service:

ddev add-on get mxr576/ddev-pi
ddev debug rebuild -s pi
ddev restart && ddev start --profiles=pi

Note: ddev debug rebuild -s <service> (or its alias ddev utility rebuild -s <service>) for profile-gated services requires DDEV >= v1.25.3 (ddev/ddev#8463). Following up with ddev restart && ddev start --profiles=pi ensures all project containers and profile services restart cleanly together (see ddev/ddev#7904).

Usage

The Pi agent runs as a DDEV service under the pi profile. You must start DDEV with that profile active.

  1. Start DDEV with the Pi profile enabled:
    ddev start --profiles=pi
    
  2. Run Pi commands via the ddev pi wrapper:
    ddev pi [command]
    

Example:

ddev pi status

Note: The ddev pi command is a thin wrapper that runs ddev exec --service=pi pi "$@" inside the sidecar container. The container’s working directory is /var/www/html (your project root).

Configuration

Default configurations are initialized in your project’s .pi/ directory during installation (settings.json is copied from the add-on defaults). Modify settings.json there to configure providers and agent preferences.

Note: Re-running ddev add-on get will not overwrite an existing .pi/ directory. Defaults are only copied when .pi/ is empty.

Extensibility

This add-on provides several ways to customize the container environment, manage Pi extensions, and easily install AI skills:

Experimental Host Clipboard Integration

This add-on features a cross-platform clipboard integration that bridges the containerized Pi Coding Agent to your host system’s clipboard using a hybrid strategy:

  1. Shared Volume File Bridge (Default): When python3 is available on your host, using the /copy command writes payload content to a temporary pending file inside the shared workspace volume (.ddev/pi/.clipboard_pending). A lightweight, background Python daemon (pi/clipboard-helper.py) running on your host monitors this file, copies its contents to your host clipboard using native system utilities (pbcopy, clip.exe, powershell.exe, or wl-copy/xclip), and deletes the file.
    • Advantages: Universal terminal compatibility (including macOS Terminal.app and GNOME Terminal) and unlimited payload sizes (handles large code files and transcripts without truncation).
  2. Terminal OSC 52 Fallback (Zero Host Dependencies): If python3 is not found on your host machine, ddev pi automatically falls back to Pi’s native remote session clipboard support (PI_CLIPBOARD_OSC52=1). Copied text is emitted directly through standard ANSI OSC 52 terminal escape sequences to your host terminal.
    • Requirements: Requires an OSC 52-compatible terminal emulator (such as Ghostty, iTerm2, Windows Terminal, Kitty, WezTerm, or Alacritty). Payloads are capped by Pi at ~75 KB (100,000 base64 characters).

You can explicitly force or disable OSC 52 sync at any time by setting PI_CLIPBOARD_OSC52=1 or PI_CLIPBOARD_OSC52=0.

OS Support & Feedback

Since clipboard tools vary depending on your host OS and available terminal utilities, this feature is currently marked as experimental. We welcome your feedback, bugs, and success stories for different operating systems!

If clipboard sharing is not working on your host, check the log file at .ddev/pi/clipboard.log for debugging details.

Uninstalling

ddev addon remove pi

The .pi/ folder in your project root and the pi-agent Docker volume are not removed automatically. Clean them up manually if needed:

# Remove the project Pi configuration
rm -rf .pi/

# Remove the named Docker volume
docker volume rm ddev-<your-project-name>-pi-agent

Credits

Contributed and maintained by @mxr576. The initial proof of concept and early development were sponsored by Pronovix.

If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.