pi-profile-switch 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -14
- package/README.zh-CN.md +13 -14
- package/bin/postinstall.js +3 -2
- package/examples/example.json +33 -0
- package/examples/profiles.json +7 -31
- package/package.json +1 -2
- package/defaults/profiles.json +0 -18
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Named profiles for [Pi](https://github.com/badlogic/pi-mono). A profile references a set of existing skills, extensions, MCP servers, and tools — switch between them in the same Pi process, without restarting.
|
|
6
6
|
|
|
7
|
-
Use a
|
|
7
|
+
Use a read-only profile for Q&A and code exploration, a full-powered one for implementation — all against the same installed resources.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -20,33 +20,32 @@ Requires [Pi](https://www.npmjs.com/package/@earendil-works/pi-coding-agent) (in
|
|
|
20
20
|
# Launch with the built-in default profile (all resources, plain Pi behavior)
|
|
21
21
|
pi-profile
|
|
22
22
|
|
|
23
|
-
# Launch with
|
|
24
|
-
pi-profile
|
|
23
|
+
# Launch with the seeded read-only ask profile
|
|
24
|
+
pi-profile ask
|
|
25
25
|
|
|
26
26
|
# Anything after -- is passed to pi verbatim
|
|
27
|
-
pi-profile
|
|
27
|
+
pi-profile ask -- --model openai/gpt-5.4
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
On install, pi-profile-switch seeds `~/.pi-profile-switch/profiles.json` (global, fallback to `~/.pi/agent/profiles.json` for migration; custom root via `PI_PROFILE_SWITCH_DIR`) with a starter **`ask`** profile — read-only Q&A and code exploration. It assumes nothing about your setup; edit or delete it freely:
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{
|
|
34
34
|
"schemaVersion": 1,
|
|
35
35
|
"profiles": {
|
|
36
|
-
"
|
|
37
|
-
"label": "
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
36
|
+
"ask": {
|
|
37
|
+
"label": "Ask & Discuss",
|
|
38
|
+
"description": "Read-only Q&A and code exploration; no file modifications or command execution",
|
|
39
|
+
"skills": [],
|
|
40
|
+
"extensions": [],
|
|
41
|
+
"tools": ["read", "grep", "find", "ls"],
|
|
42
|
+
"instructions": "You are in read-only discussion mode. Answer questions and explain code without modifying any files or running shell commands."
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
Profiles **reference** resources by name — they never copy them. Installed packages and files in standard locations are discovered automatically; no registration needed.
|
|
48
|
-
|
|
49
|
-
On install, pi-profile-switch seeds `~/.pi-profile-switch/profiles.json` with a starter **`ask`** profile — read-only Q&A and code exploration (`read`/`grep`/`find`/`ls`, no skills, extensions, or MCP). It assumes nothing about your setup; edit or delete it freely.
|
|
48
|
+
Project-level profiles live in `<project>/.pi/profiles.json` (trusted projects only). Profiles **reference** resources by name — they never copy them. Installed packages and files in standard locations are discovered automatically; no registration needed. Complete configuration examples live in [`examples/`](examples/): `profiles.json` is the seeded starter above, and `example.json` demonstrates every available field (skills, extensions, MCP servers, tools, model defaults, instructions).
|
|
50
49
|
|
|
51
50
|
## Commands
|
|
52
51
|
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[Pi](https://github.com/badlogic/pi-mono) 的命名 profile 扩展。一个 profile 引用一组已存在的 skills、extensions、MCP server 和 tools,并在同一 Pi 进程内切换,无需重启。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
问答与代码走读用只读 profile,实现需求用全量 profile——全部基于同一套已安装的资源。
|
|
8
8
|
|
|
9
9
|
## 安装
|
|
10
10
|
|
|
@@ -20,33 +20,32 @@ npm install -g pi-profile-switch
|
|
|
20
20
|
# 使用内建 default profile 启动(全量资源,等同原生 Pi)
|
|
21
21
|
pi-profile
|
|
22
22
|
|
|
23
|
-
#
|
|
24
|
-
pi-profile
|
|
23
|
+
# 使用安装时播种的只读 ask profile 启动
|
|
24
|
+
pi-profile ask
|
|
25
25
|
|
|
26
26
|
# -- 后面的参数原样传给 pi
|
|
27
|
-
pi-profile
|
|
27
|
+
pi-profile ask -- --model openai/gpt-5.4
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
安装时,pi-profile-switch 会向 `~/.pi-profile-switch/profiles.json`(全局,支持 `PI_PROFILE_SWITCH_DIR` 环境变量自定义,向下兼容 `~/.pi/agent/profiles.json`)写入一个初始 **`ask`** profile——只读的问答与代码走读模式。它不假设你安装过任何插件,可随意修改或删除:
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{
|
|
34
34
|
"schemaVersion": 1,
|
|
35
35
|
"profiles": {
|
|
36
|
-
"
|
|
37
|
-
"label": "
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
36
|
+
"ask": {
|
|
37
|
+
"label": "Ask & Discuss",
|
|
38
|
+
"description": "Read-only Q&A and code exploration; no file modifications or command execution",
|
|
39
|
+
"skills": [],
|
|
40
|
+
"extensions": [],
|
|
41
|
+
"tools": ["read", "grep", "find", "ls"],
|
|
42
|
+
"instructions": "You are in read-only discussion mode. Answer questions and explain code without modifying any files or running shell commands."
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
安装时,pi-profile-switch 会向 `~/.pi-profile-switch/profiles.json` 写入一个初始 **`ask`** profile——只读的问答与代码走读模式(仅 `read`/`grep`/`find`/`ls`,无 skill、extension 和 MCP)。它不假设你安装过任何插件,可随意修改或删除。
|
|
48
|
+
项目级 profile 定义在 `<项目>/.pi/profiles.json`(仅限已信任项目)。Profile 只**引用**资源,从不复制资源。已安装的包和标准目录下的文件会被自动发现,无需注册。完整配置案例见 [`examples/`](examples/):`profiles.json` 即上面的初始 profile,`example.json` 演示全部可用字段(skills、extensions、MCP server、tools、默认模型、instructions)。
|
|
50
49
|
|
|
51
50
|
## 命令
|
|
52
51
|
|
package/bin/postinstall.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Runs at package install time (`npm install pi-profile-switch` / `pi install`).
|
|
6
6
|
* Idempotent and conservative:
|
|
7
|
-
* - Writes `
|
|
7
|
+
* - Writes the shipped `examples/profiles.json` starter catalog to the
|
|
8
|
+
* profile-switch dir ONLY when no
|
|
8
9
|
* catalog exists there yet (COPYFILE_EXCL; an existing file — including
|
|
9
10
|
* one written concurrently — is never touched).
|
|
10
11
|
* - Skips entirely when a legacy `~/.pi/agent/profiles.json` exists, because
|
|
@@ -22,7 +23,7 @@ import { homedir } from "node:os";
|
|
|
22
23
|
import path from "node:path";
|
|
23
24
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
24
25
|
|
|
25
|
-
const DEFAULT_TEMPLATE = fileURLToPath(new URL("../
|
|
26
|
+
const DEFAULT_TEMPLATE = fileURLToPath(new URL("../examples/profiles.json", import.meta.url));
|
|
26
27
|
|
|
27
28
|
/** Mirrors getProfileSwitchDir() in src/workspace.ts.
|
|
28
29
|
* @param {NodeJS.ProcessEnv} env */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"profiles": {
|
|
4
|
+
"impl": {
|
|
5
|
+
"label": "Implementation",
|
|
6
|
+
"description": "Full-powered implementation profile: every available field, pinned model",
|
|
7
|
+
"skills": [
|
|
8
|
+
"tdd",
|
|
9
|
+
"internal-*"
|
|
10
|
+
],
|
|
11
|
+
"extensions": [
|
|
12
|
+
"pi-mcp-adapter"
|
|
13
|
+
],
|
|
14
|
+
"mcps": [
|
|
15
|
+
"github",
|
|
16
|
+
"linear"
|
|
17
|
+
],
|
|
18
|
+
"tools": [
|
|
19
|
+
"read",
|
|
20
|
+
"grep",
|
|
21
|
+
"find",
|
|
22
|
+
"ls",
|
|
23
|
+
"bash",
|
|
24
|
+
"edit",
|
|
25
|
+
"write"
|
|
26
|
+
],
|
|
27
|
+
"defaultProvider": "anthropic",
|
|
28
|
+
"defaultModel": "claude-sonnet-4-5",
|
|
29
|
+
"defaultThinkingLevel": "high",
|
|
30
|
+
"instructions": "Prefer small, verifiable changes. Run the test suite before claiming completion."
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/examples/profiles.json
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"profiles": {
|
|
4
|
-
"
|
|
5
|
-
"label": "
|
|
6
|
-
"description": "Read-
|
|
7
|
-
"skills": [
|
|
8
|
-
|
|
9
|
-
"diagnosing-bugs"
|
|
10
|
-
],
|
|
11
|
-
"extensions": [
|
|
12
|
-
"pi-mcp-adapter"
|
|
13
|
-
],
|
|
14
|
-
"mcps": [
|
|
15
|
-
"github"
|
|
16
|
-
],
|
|
4
|
+
"ask": {
|
|
5
|
+
"label": "Ask & Discuss",
|
|
6
|
+
"description": "Read-only Q&A and code exploration; no file modifications or command execution",
|
|
7
|
+
"skills": [],
|
|
8
|
+
"extensions": [],
|
|
17
9
|
"tools": [
|
|
18
10
|
"read",
|
|
19
11
|
"grep",
|
|
20
12
|
"find",
|
|
21
|
-
"
|
|
22
|
-
],
|
|
23
|
-
"instructions": "Review only; do not modify files."
|
|
24
|
-
},
|
|
25
|
-
"impl": {
|
|
26
|
-
"label": "Implementation",
|
|
27
|
-
"skills": [
|
|
28
|
-
"tdd"
|
|
29
|
-
],
|
|
30
|
-
"extensions": [
|
|
31
|
-
"pi-mcp-adapter"
|
|
32
|
-
],
|
|
33
|
-
"mcps": [
|
|
34
|
-
"github",
|
|
35
|
-
"linear"
|
|
13
|
+
"ls"
|
|
36
14
|
],
|
|
37
|
-
"
|
|
38
|
-
"defaultModel": "deepseek-v4-pro",
|
|
39
|
-
"defaultThinkingLevel": "high"
|
|
15
|
+
"instructions": "You are in read-only discussion mode. Answer questions and explain code without modifying any files or running shell commands."
|
|
40
16
|
}
|
|
41
17
|
}
|
|
42
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-profile-switch",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Named profiles for Pi: reference skills, extensions, MCP servers, and tools per workflow, switched without restarting.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -45,7 +45,6 @@
|
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"bin",
|
|
48
|
-
"defaults",
|
|
49
48
|
"extensions",
|
|
50
49
|
"src",
|
|
51
50
|
"schemas",
|
package/defaults/profiles.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": 1,
|
|
3
|
-
"profiles": {
|
|
4
|
-
"ask": {
|
|
5
|
-
"label": "Ask & Discuss",
|
|
6
|
-
"description": "Read-only Q&A and code exploration; no file modifications or command execution",
|
|
7
|
-
"skills": [],
|
|
8
|
-
"extensions": [],
|
|
9
|
-
"tools": [
|
|
10
|
-
"read",
|
|
11
|
-
"grep",
|
|
12
|
-
"find",
|
|
13
|
-
"ls"
|
|
14
|
-
],
|
|
15
|
-
"instructions": "You are in read-only discussion mode. Answer questions and explain code without modifying any files or running shell commands."
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|