pi-containerized

for friends

by wrycode (z6MkuCL8…x3Mu)

rad:z43G4xtP3Z3ZEfKEDwBgWRXWYRMH9 branch main HEAD 9e7a678d updated 3mo ago
https git clone https://code.wrycode.com/rad:z43G4xtP3Z3ZEfKEDwBgWRXWYRMH9.git pi-containerized
radicle rad clone rad:z43G4xtP3Z3ZEfKEDwBgWRXWYRMH9 pi-containerized

Pi Containerized

Run Pi in a container! This is a template to containerize Pi so you can get work done without worrying about naughty agents. This setup also prevents Pi from modifying .git/, so you can always get back your files.

Design choices:

  • A single persistent container runs in the background.
  • Your current directory is bind-mounted to /workspace.
  • .git is shadowed by a tmpfs mount: reads work, writes are discarded.
  • Pi session state and config are stored on a tmpfs at /tmp/pi inside the container and discarded when the container stops
  • NPM_CONFIG_CACHE stored in /tmp/npm-cache, prevents Pi from polluting project when it uses e.g. brave search
  • Kimi K2.6 model set by default

You can use this repo in two ways:

  1. Start a new project — clone or fork this repository, delete README.md, build something new
  2. Add to an existing project — copy Containerfile and justfile into your repo

Provider

This setup defaults to OpenRouter. You can edit the justfile to change providers.

Prerequisites

  • Podman
  • just
  • secret-tool (from libsecret; usually pre-installed on GNOME)
  • OpenRouter API key

Quick start

1. Store your API keys

secret-tool store --label="OpenRouter API Key" type openrouter
secret-tool store --label="Brave API Key" type brave repo api   # optional

2. Use Pi

just pi

Start using Pi.

3. Update Container

You can use a prompt like this to install dependencies for Pi (or really make any change to this setup):

You are running inside an Alpine linux based container. Edit Containerfile so that you have the necessary base image and dependencies to work on this codebase. Then request the user run `rebuild-pi` to apply the changes.

Commands

Command Description
just pi Launch Pi (builds the image automatically if needed)
just shell Open an interactive shell in the container
just stop-pi Stop the persistent container
just rebuild-pi Rebuild the image and reset the container after Containerfile changes

justfile does not include a build command by default. Add one (or ask Pi to add one) once the project's build system is known.

Branches

Recent commits

Latest 4 commits on main.

9e7a678d Normalize strings for container names wrycode 3mo ago
6b6a0bec Update Pi upstream repo wrycode 4mo ago
a3555b1f Change permissions on /tmp/pi so Pi works after host reboot wrycode 4mo ago
07c17047 initial commit wrycode 4mo ago