Add Oh My Pi and improve dev container config

- Install @oh-my-pi/pi-coding-agent and move Go binaries to /usr/local/bin
- Add omp-data volume and make web port configurable via PORT_WEB
- Replace aider self-check with omp in Makefile
- Harden entrypoint: avoid exporting API keys to SSH env and overwrite
  mounted public key into authorized_keys
- Add .dockerignore, simplify .env.example, and document omp in README
This commit is contained in:
2026-06-22 21:51:56 +08:00
parent a2eba73cef
commit 518eb5a90e
8 changed files with 106 additions and 66 deletions

View File

@@ -72,6 +72,28 @@ opencode "优化当前目录下 main.rs 的错误处理逻辑"
```
### 使用 Oh My Pi (交互式 AI Coding Agent)
[oh-my-pi](https://github.com/can1357/oh-my-pi)(命令名 `omp`)是一个终端优先的 AI Coding Agent内置 LSP / DAP / 浏览器 / 子代理 / Hindsight 记忆等能力,与 Zed 通过 ACP 协议深度集成。
```bash
# 首次使用:登录某个 provider (Anthropic / OpenAI / Codex / Cursor 等)
omp /login
# 交互式启动 (默认进入 TUI)
omp
# 单次指令模式
omp -p "为当前 Cargo 项目补全 unit test"
# 指定模型
omp --model anthropic/sonnet-4.5
```
* 配置与登录态保存在 `/root/.omp`(已挂载为命名卷 `omp-data``docker compose down` 后不会丢失。
* 若已在 `.env` 中配置了 `ANTHROPIC_API_KEY` / `OPENAI_API_KEY`omp 会自动识别,可跳过 `/login`
---
## 🚀 性能说明
@@ -89,7 +111,6 @@ opencode "优化当前目录下 main.rs 的错误处理逻辑"
| 任务 | 命令 |
| --- | --- |
| **彻底重启环境** | `docker compose restart` |
| **更新 AI 工具 (Aider)** | `pip install --upgrade aider-chat` (容器内运行) |
| **更换基础镜像 (OS)** | 修改 `docker-compose.yml` 中的 `dockerfile` 后运行 `docker compose up --build` |
| **清理所有构建缓存** | `docker compose down -v` (警告:这将清空 Cargo/Bun 缓存) |