diff --git a/README.md b/README.md index b782deb..4340b7e 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ Just open this repo in a GitHub Codespace, start the container and you will get: - CodeServer at port 8888 with Hermes + Claude Code (cli + vscode extension) installed and preconfigured - Ollama server pre-installed and auto-started - ModelRelay pre-installed, auto-started and pre-configured as default model for Hermes and Claude Code +- **Pi coding agent** pre-installed, configured to proxy through OmniRoute (`auto-fastest`) — desktop launcher + default model - Hermes gateway accessible via desktop launcher - [Mnemon](https://github.com/mnemon-dev/mnemon) as your Hermes default [memory provider](https://github.com/gitricko/hermes-plugin-mnemon) - Persistent volume for your config and settings @@ -96,6 +97,7 @@ Perfect for: - **One-command everything** — powerful Makefile + clean `docker-compose.yml` - **Auto-start ModelRelay** — Default configuration for Free LLM API to Hermes - **Auto-start OmniRoute** — You need some configuration before it work but it is flexible and powerful +- **Pi coding agent** — pre-installed CLI; default model set to `omniroute` (`auto-fastest`). Launch it from the **Pi Agent** desktop icon or run `pi` / `pi -p "prompt"` in a terminal. Config lives in `~/.pi/agent/` (seeded once, then user-editable). - **Auto-start Ollama** — custom init script on WebTop boot - **Colima / local Docker support** ready - **Built-in code-server IDE** — browser-based VS Code on port `8888` diff --git a/docker/Dockerfile b/docker/Dockerfile index bc380f1..3bd2763 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -5,6 +5,7 @@ ARG OLLAMA_VERSION=0.32.6 ARG NODE_VERSION=26.7.0 ARG CODE_SERVER_VERSION=4.131.0 ARG MNEMON_VERSION=0.2.3 +ARG PI_VERSION=0.84.2 ARG TARGETARCH # Use the official Ollama image to get the binary @@ -71,6 +72,11 @@ RUN npm install -g omniroute@${OMNIROUTE_VERSION} && \ npm cache clean --force && \ mkdir -p /usr/local/lib/node_modules/omniroute/app/logs/application +# Install Pi coding agent (self-extensible coding-agent CLI, proxies through OmniRoute) +ARG PI_VERSION +RUN npm install -g --ignore-scripts @earendil-works/pi-coding-agent@${PI_VERSION} && \ + npm cache clean --force + # Install code-server and start automatically when desktop loads ARG CODE_SERVER_VERSION RUN curl -fsSL https://code-server.dev/install.sh | sh -s -- --version=${CODE_SERVER_VERSION} --method=standalone --prefix=/usr/local && \ diff --git a/docker/pi-models.json b/docker/pi-models.json new file mode 100644 index 0000000..03d4d2b --- /dev/null +++ b/docker/pi-models.json @@ -0,0 +1,16 @@ +{ + "providers": { + "omniroute": { + "baseUrl": "http://localhost:20128/v1", + "api": "openai-completions", + "apiKey": "***", + "compat": { + "supportsDeveloperRole": false, + "supportsReasoningEffort": false + }, + "models": [ + { "id": "auto-fastest" } + ] + } + } +} diff --git a/docker/pi-settings.json b/docker/pi-settings.json new file mode 100644 index 0000000..22644bf --- /dev/null +++ b/docker/pi-settings.json @@ -0,0 +1,4 @@ +{ + "defaultProvider": "omniroute", + "defaultModel": "auto-fastest" +} diff --git a/docker/start-pi.sh b/docker/start-pi.sh new file mode 100755 index 0000000..9c97ae3 --- /dev/null +++ b/docker/start-pi.sh @@ -0,0 +1,31 @@ +#!/bin/bash +source /custom-cont-init.d/common.sh || exit 1 + +# Ensure Pi is owned by abc (installed globally into /usr/local/lib/node_modules) +ensure_ownership "/usr/local/lib/node_modules/@earendil-works/pi-coding-agent" || true +ensure_ownership "/usr/local/lib/node_modules/pi-coding-agent" || true +ensure_ownership "/usr/local/bin/pi" || true + +runuser -l abc <<'EOF' +source /custom-cont-init.d/common.sh || exit 1 + +PI_DIR="$HOME/.pi/agent" +mkdir -p "$PI_DIR" + +# Seed Pi config only on first boot (preserve any user changes on restart). +# Source files are prefixed (pi-*) to avoid colliding with other *.json in /custom-cont-init.d; +# they are renamed to Pi's expected names when copied into ~/.pi/agent/. +if [ ! -f "$PI_DIR/models.json" ]; then + echo "[start-pi] Seeding Pi models.json (OmniRoute proxy)..." + cp /custom-cont-init.d/pi-models.json "$PI_DIR/models.json" + chown abc:abc "$PI_DIR/models.json" +fi + +if [ ! -f "$PI_DIR/settings.json" ]; then + echo "[start-pi] Seeding Pi settings.json (default model omniroute/auto-fastest)..." + cp /custom-cont-init.d/pi-settings.json "$PI_DIR/settings.json" + chown abc:abc "$PI_DIR/settings.json" +fi + +echo "[start-pi] Pi agent ready ($(pi --version 2>/dev/null || echo unknown)). Default model: omniroute/auto-fastest" +EOF