最近在使用 Pi Coding Agent,顺便记录一下自己的配置,方便后续迁移和参考。

Pi 是一个运行在终端中的 AI Coding Agent,可以直接读取和修改代码、执行命令、分析报错,并支持自定义模型、Provider 和 Extensions。

我比较喜欢它的几点:

  • CLI 优先,适合 SSH / 服务器环境
  • 支持多种模型和第三方 API
  • 配置灵活,方便自定义
  • 支持 Extensions,扩展能力强
  • 配置文件方便备份和迁移

下面直接分享我的实际配置。

配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"defaultProvider": "openai",
"lastChangelogVersion": "0.87.0",
"theme": "dark",
"hideThinkingBlock": false,
"transport": "websocket",
"packages": [
"npm:pi-cometix-footer",
{
"source": "npm:pi-hashline-edit-pro",
"extensions": [],
"skills": [],
"prompts": [],
"themes": []
},
"npm:@ff-labs/pi-fff",
"npm:@narumitw/pi-lsp",
"npm:pi-workspace-history",
"npm:pi-add-dir",
"npm:@narumitw/pi-plan-mode",
"npm:@juicesharp/rpiv-ask-user-question",
"npm:@juicesharp/rpiv-todo",
"npm:pi-mcp-adapter",
"npm:@gotgenes/pi-permission-system",
"npm:@tmustier/pi-raw-paste",
"npm:@tintinweb/pi-subagents",
"npm:pi-web-access",
"npm:@narumitw/pi-btw",
"npm:pi-rtk-optimizer"
],
"defaultModel": "gpt-6-sol",
"defaultThinkingLevel": "xhigh",
"enabledModels": [
"deepseek/deepseek-flash",
"openai/gpt-5.6-sol",
"openai/gpt-6-sol",
"openai/gpt-5.6-luna",
"openai/gpt-6-luna",
"openai/gpt-6-astra",
"anthropic/claude-sonnet-5",
"anthropic/claude-sonnet-4-5",
"anthropic/claude-opus-5",
"anthropic/claude-opus-4-8",
"anthropic/claude-opus-4-5",
"anthropic/claude-haiku-4-5",
"anthropic/claude-haiku-4-5-20251001",
"zai/glm-5.3",
"zai/glm-5.3-flash",
"zai/glm-5.3-highspeed"
]
}

可直接替换packages中的内容,使用和我同款插件
可选插件 npm:pi-sync-webdav , 通过webdav同步配置

pi-web

提供了web访问pi进行远程vibe coding的能力,其自带pi内核,和pi cli共享目录

启动

1
npx @agegr/pi-web@latest

Docker部署

Dockerfile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
FROM debian:13-slim

# =========================================================
# Build Args
# =========================================================

ARG NODE_MAJOR=24


# =========================================================
# Environment
# =========================================================

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Singapore


# =========================================================
# Base Tools + Python + PHP
# =========================================================

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
gnupg \
git \
openssh-client \
ripgrep \
fd-find \
zip \
unzip \
ffmpeg \
tzdata \
tini \
build-essential \
python3 \
python3-pip \
python3-venv \
php \
php-cli \
php-mbstring \
php-xml \
php-curl \
php-zip \
php-mysql \
&& ln -sf "$(command -v fdfind)" /usr/local/bin/fd \
&& mkdir -p /etc/apt/keyrings \
&& rm -rf /var/lib/apt/lists/*


# =========================================================
# Node.js 24
# =========================================================

RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo \
"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_MAJOR}.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*


# =========================================================
# pnpm + Bun
# =========================================================

RUN npm install -g \
pnpm \
bun \
&& npm cache clean --force


# =========================================================
# Pi Coding Agent
#
# 使用新版 @earendil-works/pi-coding-agent
# 不再安装旧的 @mariozechner/pi-coding-agent
# =========================================================

RUN npm install -g \
--ignore-scripts \
@earendil-works/pi-coding-agent@latest \
&& npm cache clean --force


# =========================================================
# RTK
#
# 只安装 RTK CLI
# 不执行:
# rtk init
#
# 不安装 Pi extension
# =========================================================

RUN curl -fsSL \
https://raw.githubusercontent.com/rtk-ai/rtk/master/install.sh \
| env RTK_INSTALL_DIR=/usr/local/bin sh \
&& rtk --version


# =========================================================
# Verify
# =========================================================

RUN node --version \
&& npm --version \
&& npx --version \
&& pnpm --version \
&& bun --version \
&& python3 --version \
&& pip3 --version \
&& php --version \
&& git --version \
&& rg --version \
&& fd --version \
&& pi --version \
&& rtk --version


# =========================================================
# Workspace
# =========================================================

WORKDIR /workspace


# =========================================================
# Init
#
# Compose command 会作为 tini 后面的启动命令
# =========================================================

ENTRYPOINT ["tini", "--"]

Compose

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
services:
pi-web:
build:
context: .
dockerfile: Dockerfile

container_name: pi-web
restart: unless-stopped

environment:
TZ: Asia/Singapore
PI_CODING_AGENT_DIR: /root/.pi/agent
PI_WEB_PASSWORD: ${PI_WEB_PASSWORD}
PI_WEB_ALLOWED_HOSTS: ${PI_WEB_ALLOWED_HOSTS}

volumes:
- ./agent:/root/.pi/agent
- /root/lnmp/nginx/web/air:/workspace:rw
- ./project:/project
- ./npm-cache:/root/.npm

working_dir: /workspace

ports:
- "30141:30141"

command:
- npx
- -y
- "@agegr/pi-web@latest"
- --hostname
- "0.0.0.0"
- --port
- "30141"
- --no-open

stdin_open: true
tty: true

此镜像需要本地编译,自带一些开发环境和pi-web、pi cli

总结

希望对你有所帮助