container: Add Pi coding agent (pi.dev) as a third harness
- Install @earendil-works/pi-coding-agent globally via npm in the image so it survives the home directory bind mount - Add pi subcommand forwarding PI_* and provider key prefixes - Add pi shell wrapper alias - Build with --network host so image builds work on hosts where the Docker bridge network cannot create veth pairs
This commit is contained in:
parent
7984b9129a
commit
5c2f3ae83c
4 changed files with 58 additions and 4 deletions
12
README.md
12
README.md
|
|
@ -1,10 +1,10 @@
|
|||
# agent-container
|
||||
|
||||
Run OpenCode and Claude Code inside a shared Arch Linux Docker container that closely mirrors a local development environment, while limiting access to sensitive files on the host.
|
||||
Run OpenCode, Claude Code, and Pi (pi.dev) inside a shared Arch Linux Docker container that closely mirrors a local development environment, while limiting access to sensitive files on the host.
|
||||
|
||||
## Features
|
||||
|
||||
- Arch Linux-based image with both OpenCode and Claude Code pre-installed
|
||||
- Arch Linux-based image with OpenCode, Claude Code, and Pi pre-installed
|
||||
- Runs as the host user (same username, UID, GID)
|
||||
- **Per-project isolation**: Each project gets its own container (identified by project path hash)
|
||||
- **Shared persistent home**: All containers mount the same home directory from XDG_DATA_HOME, allowing tools and credentials to persist across projects
|
||||
|
|
@ -29,7 +29,7 @@ Source the helper file `agent.aliases` in your shell configuration (`.bashrc` or
|
|||
source ~/Projects/agent-container/agent.aliases
|
||||
```
|
||||
|
||||
This makes the `opencode`, `claude`, and `agent-container` commands available in new sessions.
|
||||
This makes the `opencode`, `claude`, `pi`, and `agent-container` commands available in new sessions.
|
||||
|
||||
The container home directory at `$XDG_DATA_HOME/agent-container/container-home/` serves as a central `$HOME` inside every container, independent of which project directory you start in. Everything written to `$HOME` inside the container persists there.
|
||||
|
||||
|
|
@ -39,6 +39,7 @@ Host environment variables matching the following prefixes are automatically for
|
|||
|
||||
- `OPENCODE_*` -- passed through to OpenCode
|
||||
- `ANTHROPIC_*`, `CLAUDE_*` -- passed through to Claude Code
|
||||
- `PI_*` plus provider key prefixes (`ANTHROPIC_*`, `OPENAI_*`, `GEMINI_*`, `GROQ_*`, `OLLAMA_*`, and others) -- passed through to Pi. Alternatively log in once with `/login` inside the container; credentials persist in the shared container home.
|
||||
|
||||
This means inline overrides work as expected: `OPENCODE_CONFIG=foo opencode`
|
||||
|
||||
|
|
@ -56,13 +57,16 @@ opencode
|
|||
|
||||
# Run Claude Code
|
||||
claude
|
||||
|
||||
# Run Pi
|
||||
pi
|
||||
```
|
||||
|
||||
The image is built automatically on first use if it does not already exist. The tool starts inside the container with the current directory mounted and set as the working directory.
|
||||
|
||||
### Updating
|
||||
|
||||
To rebuild the image with the latest versions of both OpenCode and Claude Code:
|
||||
To rebuild the image with the latest versions of OpenCode, Claude Code, and Pi:
|
||||
|
||||
```sh
|
||||
agent-container update
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue