@counterposition/skill-pi 0.75.0 → 0.80.3
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/package.json +1 -1
- package/skills/pi/SKILL.md +1 -0
- package/skills/pi/references/extensions.md +27 -9
- package/skills/pi/references/packages.md +9 -6
- package/skills/pi/references/providers.md +23 -7
- package/skills/pi/references/sdk.md +17 -3
- package/skills/pi/references/settings.md +44 -10
- package/skills/pi/references/skills.md +1 -1
package/package.json
CHANGED
package/skills/pi/SKILL.md
CHANGED
|
@@ -53,6 +53,7 @@ Core packages on npm (source: [github.com/earendil-works/pi](https://github.com/
|
|
|
53
53
|
- **Skills** — Markdown capability packages (`SKILL.md` + frontmatter) following the Agent Skills standard. Pi loads names + descriptions into the system prompt; bodies load on demand. → `references/skills.md`
|
|
54
54
|
- **Settings** — Hierarchical JSON: project `.pi/settings.json` merges over global `~/.pi/agent/settings.json`. → `references/settings.md`
|
|
55
55
|
- **Packages** — Bundles of extensions/skills/prompts/themes via npm, git, or local paths. Installed with `pi install`. → `references/packages.md`
|
|
56
|
+
- **Project trust** — Pi 0.79+ asks before loading project-local settings, resources, and packages; decisions persist in `~/.pi/agent/trust.json`. `--approve`/`--no-approve` override per run; `defaultProjectTrust` sets the non-interactive fallback. → `references/settings.md`
|
|
56
57
|
- **Context files & prompt templates** — Pi loads `AGENTS.md` / `CLAUDE.md` from the agent dir and from `cwd` up through ancestors. `.pi/SYSTEM.md` replaces the system prompt; `APPEND_SYSTEM.md` appends. Prompt templates in `prompts/` become slash commands. → `references/settings.md`
|
|
57
58
|
- **SDK** — Programmatic embedding via `createAgentSession()`; `createAgentSessionRuntime()` for session replacement. → `references/sdk.md`
|
|
58
59
|
- **Custom providers & models** — `models.json` or extension `pi.registerProvider()` for any OpenAI-/Anthropic-/Google-compatible or custom LLM endpoint. → `references/providers.md`
|
|
@@ -25,6 +25,7 @@ import { Text } from "@earendil-works/pi-tui";
|
|
|
25
25
|
|
|
26
26
|
- Use `typebox` (1.x) for schemas.
|
|
27
27
|
- Use `StringEnum` from `@earendil-works/pi-ai` for Google-compatible string enums.
|
|
28
|
+
- Pi 0.80.0 moved pi-ai's old global API (`getModel`, `getModels`, `stream`, `complete`, `registerApiProvider`, ...) off the pi-ai root entrypoint to `@earendil-works/pi-ai/compat`. Extensions keep working unchanged at runtime (the extension loader aliases the root to the compat superset), but extension sources that typecheck against pi-ai's published types must import those APIs from `@earendil-works/pi-ai/compat`. `StringEnum` and the type surface remain on the root. The compat entrypoint and loader alias will be removed in a future release.
|
|
28
29
|
|
|
29
30
|
## Quick Start
|
|
30
31
|
|
|
@@ -75,14 +76,18 @@ Useful session events:
|
|
|
75
76
|
- `session_compact`
|
|
76
77
|
- `session_before_tree`
|
|
77
78
|
- `session_tree`
|
|
79
|
+
- `session_info_changed` — observe session display-name changes
|
|
78
80
|
- `session_shutdown`
|
|
79
81
|
- `resources_discover`
|
|
82
|
+
- `project_trust` — user/global and CLI extensions only, fired before project resources load; return `{ trusted: "yes" | "no" | "undecided" }` (optionally `remember: true` to persist). The first yes/no decision wins and suppresses the built-in trust prompt.
|
|
83
|
+
|
|
84
|
+
`session_before_compact` and `session_compact` carry `reason` and `willRetry` (Pi 0.79.10) so handlers can distinguish manual `/compact`, threshold auto-compaction, and overflow-retry compaction.
|
|
80
85
|
|
|
81
86
|
`session_start` carries `event.reason` — `"startup" | "reload" | "new" | "resume" | "fork"` — and `event.previousSessionFile` for `"new"`/`"resume"`/`"fork"`. The old post-transition `session_switch` / `session_fork` events were removed; route all of those flows through `session_start`.
|
|
82
87
|
|
|
83
88
|
Useful agent events:
|
|
84
89
|
|
|
85
|
-
- `input`
|
|
90
|
+
- `input` — carries `event.streamingBehavior` (`"steer" | "followUp" | undefined`) so handlers can distinguish idle prompts, mid-stream steers, and queued follow-ups; return `{ action: "transform" | "handled" | "continue" }`
|
|
86
91
|
- `before_agent_start` — receives `event.systemPromptOptions` (a `BuildSystemPromptOptions`) so handlers can inspect the structured inputs feeding the system prompt
|
|
87
92
|
- `agent_start`
|
|
88
93
|
- `agent_end`
|
|
@@ -111,18 +116,25 @@ Tool results may include `terminate: true` to end the current tool batch without
|
|
|
111
116
|
|
|
112
117
|
## Extension Context
|
|
113
118
|
|
|
114
|
-
`ctx` gives extensions access to:
|
|
119
|
+
`ctx` (`ExtensionContext`) gives extensions access to:
|
|
115
120
|
|
|
116
121
|
- `ctx.ui` for interactive UI hooks
|
|
122
|
+
- `ctx.mode` — `"tui" | "rpc" | "json" | "print"`; gate terminal-only features on `ctx.mode === "tui"`
|
|
117
123
|
- `ctx.cwd`
|
|
118
|
-
- `ctx.
|
|
119
|
-
- `ctx.
|
|
120
|
-
- `ctx.
|
|
121
|
-
- `ctx.
|
|
122
|
-
- `ctx.isIdle()`
|
|
123
|
-
- `ctx.abort()`
|
|
124
|
+
- `ctx.sessionManager` (read-only)
|
|
125
|
+
- `ctx.modelRegistry` / `ctx.model`
|
|
126
|
+
- `ctx.hasUI` — `true` in TUI and RPC modes
|
|
127
|
+
- `ctx.signal` — the active agent abort signal (or `undefined` when idle); pass it to `fetch`/model calls for abort-aware nested work
|
|
128
|
+
- `ctx.isIdle()` / `ctx.hasPendingMessages()`
|
|
129
|
+
- `ctx.abort()` / `ctx.shutdown()`
|
|
124
130
|
- `ctx.getContextUsage()`
|
|
131
|
+
- `ctx.compact(options?)` — trigger compaction without awaiting completion
|
|
125
132
|
- `ctx.getSystemPrompt()`
|
|
133
|
+
- `ctx.isProjectTrusted()` — the effective project trust decision, including temporary `--approve`/`--no-approve` decisions
|
|
134
|
+
|
|
135
|
+
Use `CONFIG_DIR_NAME` (exported from `@earendil-works/pi-coding-agent`) instead of hardcoding `.pi` when building project config paths, e.g. `join(ctx.cwd, CONFIG_DIR_NAME, "my-extension.json")`.
|
|
136
|
+
|
|
137
|
+
Command handlers receive `ExtensionCommandContext`, which extends the above with session-control methods that would deadlock from event handlers: `ctx.getSystemPromptOptions()` (inspect the base system-prompt inputs), `ctx.waitForIdle()`, `ctx.newSession()`, `ctx.fork()`, `ctx.switchSession()`, `ctx.navigateTree()`, and `ctx.reload()`.
|
|
126
138
|
|
|
127
139
|
## Tool Registration
|
|
128
140
|
|
|
@@ -149,6 +161,8 @@ pi.registerTool({
|
|
|
149
161
|
});
|
|
150
162
|
```
|
|
151
163
|
|
|
164
|
+
Optional prompt metadata: add `promptSnippet` to give the tool a one-line entry in the system prompt's `Available tools` list, and `promptGuidelines: string[]` to append bullets to the `Guidelines` section while the tool is active. Guidelines are appended flat with no tool-name prefix, so each bullet must name its tool (write `"Use my_tool when..."`, not `"Use this tool when..."`). `pi.getAllTools()` exposes each tool's `promptGuidelines` for attribution.
|
|
165
|
+
|
|
152
166
|
Important rules:
|
|
153
167
|
|
|
154
168
|
1. Truncate large output.
|
|
@@ -185,7 +199,11 @@ const editorFactory = ctx.ui.getEditorComponent(); // wrap the a
|
|
|
185
199
|
|
|
186
200
|
ctx.ui.setToolsExpanded(true);
|
|
187
201
|
|
|
188
|
-
ctx.ui.addAutocompleteProvider((
|
|
202
|
+
ctx.ui.addAutocompleteProvider((current) => ({ // stack on top of slash/path provider
|
|
203
|
+
triggerCharacters: ["#"], // optional natural triggers (Pi 0.79.1)
|
|
204
|
+
async getSuggestions(lines, cursorLine, cursorCol, options) { /* ... or delegate to current */ },
|
|
205
|
+
applyCompletion(...args) { return current.applyCompletion(...args); },
|
|
206
|
+
}));
|
|
189
207
|
|
|
190
208
|
const result = await ctx.ui.custom((tui, theme, keybindings, done) => {
|
|
191
209
|
return new Text("Press Enter", 0, 0);
|
|
@@ -16,16 +16,19 @@ pi install ./relative/path/to/package
|
|
|
16
16
|
pi remove npm:@foo/bar
|
|
17
17
|
pi uninstall npm:@foo/bar
|
|
18
18
|
pi list
|
|
19
|
-
pi update # update pi
|
|
20
|
-
pi update --
|
|
19
|
+
pi update # update pi only (changed in Pi 0.79.7)
|
|
20
|
+
pi update --all # update pi + packages, reconcile pinned git refs
|
|
21
21
|
pi update --extensions # update packages only
|
|
22
|
+
pi update --self # update pi only
|
|
22
23
|
pi update <source> # update one package
|
|
23
24
|
pi config
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead.
|
|
27
|
+
By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. `pi update` installs the exact version returned by the update check.
|
|
28
|
+
|
|
29
|
+
Package commands follow the project trust flow (`pi update` never prompts); pass `--approve`/`-a` or `--no-approve`/`-na` to trust or ignore project-local settings for one command.
|
|
27
30
|
|
|
28
|
-
Project installs are shareable with a team. Pi will install missing project packages automatically on startup.
|
|
31
|
+
Project installs are shareable with a team. Pi will install missing project packages automatically on startup once the project is trusted.
|
|
29
32
|
|
|
30
33
|
For temporary one-run testing, use `--extension` / `-e` with an npm or git source. Pi installs it into a temporary directory for that run only.
|
|
31
34
|
|
|
@@ -40,7 +43,7 @@ npm:pkg
|
|
|
40
43
|
|
|
41
44
|
- User installs go under `~/.pi/agent/npm/`
|
|
42
45
|
- Project installs go under `.pi/npm/`
|
|
43
|
-
- Version-pinned installs are skipped by `pi update`
|
|
46
|
+
- Version-pinned installs are skipped by `pi update --extensions` / `--all`
|
|
44
47
|
- Use `npmCommand` in settings if you need a wrapper such as `mise` or `asdf`
|
|
45
48
|
|
|
46
49
|
### git
|
|
@@ -54,7 +57,7 @@ ssh://git@github.com/user/repo@v1
|
|
|
54
57
|
|
|
55
58
|
- Global clones live in `~/.pi/agent/git/`
|
|
56
59
|
- Project clones live in `.pi/git/`
|
|
57
|
-
- Refs pin the package
|
|
60
|
+
- Refs pin the package; `pi update --extensions` / `--all` do not move them to newer refs but do reconcile the clone to the configured ref — use `pi install git:host/user/repo@new-ref` to move a pin
|
|
58
61
|
- Pi runs `npm install` after clone/pull when `package.json` exists
|
|
59
62
|
|
|
60
63
|
### local paths
|
|
@@ -7,7 +7,7 @@ Pi supports subscription-based providers via OAuth, API-key providers via env va
|
|
|
7
7
|
Use `/login` in interactive mode, then select a provider. The `/login` selector is fuzzy-searchable and shows where each entry's auth comes from (`--api-key`, env var, custom provider) without leaking the secret.
|
|
8
8
|
|
|
9
9
|
- Anthropic Claude Pro / Max — third-party usage draws from extra usage and is billed per token (suppress the warning via `warnings.anthropicExtraUsage`)
|
|
10
|
-
- OpenAI ChatGPT Plus / Pro (Codex)
|
|
10
|
+
- OpenAI ChatGPT Plus / Pro (Codex) — `/login` defaults to browser auth but can use a device-code flow for headless environments
|
|
11
11
|
- GitHub Copilot
|
|
12
12
|
|
|
13
13
|
Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Google Gemini CLI and Google Antigravity providers.
|
|
@@ -17,9 +17,11 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
|
|
|
17
17
|
| Provider | Env Var | `auth.json` key |
|
|
18
18
|
|----------|---------|-----------------|
|
|
19
19
|
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
20
|
+
| Ant Ling | `ANT_LING_API_KEY` | `ant-ling` |
|
|
20
21
|
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
21
22
|
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
22
23
|
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
|
|
24
|
+
| NVIDIA NIM | `NVIDIA_API_KEY` | `nvidia` |
|
|
23
25
|
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
24
26
|
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
25
27
|
| Groq | `GROQ_API_KEY` | `groq` |
|
|
@@ -30,6 +32,7 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
|
|
|
30
32
|
| OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
|
|
31
33
|
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
|
|
32
34
|
| ZAI | `ZAI_API_KEY` | `zai` |
|
|
35
|
+
| ZAI Coding Plan (China) | `ZAI_CODING_CN_API_KEY` | `zai-coding-cn` |
|
|
33
36
|
| OpenCode Zen | `OPENCODE_API_KEY` | `opencode` |
|
|
34
37
|
| OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
|
|
35
38
|
| Hugging Face | `HF_TOKEN` | `huggingface` |
|
|
@@ -49,16 +52,25 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
|
|
|
49
52
|
{
|
|
50
53
|
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
|
|
51
54
|
"openai": { "type": "api_key", "key": "!op read 'OpenAI API Key'" },
|
|
52
|
-
"google": { "type": "api_key", "key": "GEMINI_API_KEY" },
|
|
53
|
-
"
|
|
55
|
+
"google": { "type": "api_key", "key": "$GEMINI_API_KEY" },
|
|
56
|
+
"cloudflare-ai-gateway": {
|
|
57
|
+
"type": "api_key",
|
|
58
|
+
"key": "$CLOUDFLARE_API_KEY",
|
|
59
|
+
"env": {
|
|
60
|
+
"CLOUDFLARE_ACCOUNT_ID": "account-id",
|
|
61
|
+
"CLOUDFLARE_GATEWAY_ID": "gateway-id"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
54
64
|
}
|
|
55
65
|
```
|
|
56
66
|
|
|
57
67
|
`key` values can be:
|
|
58
68
|
|
|
59
69
|
- A literal secret
|
|
60
|
-
-
|
|
61
|
-
- A shell command prefixed with `!`
|
|
70
|
+
- `$ENV_VAR` / `${ENV_VAR}` environment interpolation (works inside larger literals). Plain uppercase names without `$` are treated as literals since Pi 0.79.4 — the old bare-env-var-name form no longer resolves.
|
|
71
|
+
- A shell command prefixed with `!` (stdout is used, cached for the process lifetime)
|
|
72
|
+
|
|
73
|
+
Entries may include an `env` object (Pi 0.79.5) for provider-scoped environment overrides — Cloudflare account/gateway IDs, Azure endpoints, Vertex project/location, Bedrock config, cache retention, proxies — applied without changing the project shell.
|
|
62
74
|
|
|
63
75
|
## Credential Resolution Order
|
|
64
76
|
|
|
@@ -74,8 +86,10 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
|
|
|
74
86
|
```bash
|
|
75
87
|
export AZURE_OPENAI_API_KEY=...
|
|
76
88
|
export AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com
|
|
77
|
-
# Cognitive Services
|
|
89
|
+
# Cognitive Services and modern Microsoft Foundry endpoint URLs are also
|
|
90
|
+
# supported; root endpoints are auto-normalized to /openai/v1:
|
|
78
91
|
# export AZURE_OPENAI_BASE_URL=https://your-resource.cognitiveservices.azure.com
|
|
92
|
+
# export AZURE_OPENAI_BASE_URL=https://your-resource.ai.azure.com
|
|
79
93
|
# Or supply the resource name only:
|
|
80
94
|
export AZURE_OPENAI_RESOURCE_NAME=your-resource
|
|
81
95
|
|
|
@@ -153,6 +167,8 @@ Use `models.json` for OpenAI-compatible, Anthropic-compatible, Google-compatible
|
|
|
153
167
|
}
|
|
154
168
|
```
|
|
155
169
|
|
|
170
|
+
`apiKey` is optional (Pi 0.80.0): omit it when auth comes from `/login`, `auth.json`, or CLI `--api-key`. Like `auth.json` keys, `apiKey` and `headers` values support `!command` execution and `$ENV_VAR` interpolation; plain uppercase strings are literals. Keyless local servers (e.g. Ollama) should keep a dummy value so their models appear in `/model`.
|
|
171
|
+
|
|
156
172
|
Common `api` values:
|
|
157
173
|
|
|
158
174
|
- `"openai-completions"`
|
|
@@ -168,7 +184,7 @@ Common `api` values:
|
|
|
168
184
|
|
|
169
185
|
- `thinkingLevelMap` (Pi 0.72) replaces `compat.reasoningEffortMap`. Map pi levels (`off`/`minimal`/`low`/`medium`/`high`/`xhigh`) to provider values; use `null` to hide a level.
|
|
170
186
|
- `openRouterRouting` is forwarded as-is in the OpenRouter `provider` field (fallbacks, ZDR, ignore lists, throughput/latency).
|
|
171
|
-
- `compat.thinkingFormat` supports OpenAI-compatible reasoning variants: `openrouter` sends `reasoning: { effort }`, `together` sends `reasoning: { enabled }` plus `reasoning_effort` when supported,
|
|
187
|
+
- `compat.thinkingFormat` supports OpenAI-compatible reasoning variants: `openrouter` sends `reasoning: { effort }`, `together` sends `reasoning: { enabled }` plus `reasoning_effort` when supported, `qwen-chat-template` targets local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking`, and `chat-template` (Pi 0.79.9) sends configurable `chat_template_kwargs` via `compat.chatTemplateKwargs` — e.g. `{ "thinking": { "$var": "thinking.enabled" } }` for DeepSeek models behind vLLM/Hugging Face chat templates (`"$var"` accepts `"thinking.enabled"` or `"thinking.effort"`).
|
|
172
188
|
- Advanced `compat` flags exist for proxy quirks (`cacheControlFormat`, `supportsReasoningEffort`, `supportsLongCacheRetention`, `supportsEagerToolInputStreaming`, `sendSessionIdHeader`, `sendSessionAffinityHeaders`). See [Pi `docs/models.md`](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/models.md) when a proxy rejects pi's defaults.
|
|
173
189
|
|
|
174
190
|
### Context Overflow Recovery
|
|
@@ -51,9 +51,11 @@ import {
|
|
|
51
51
|
ModelRegistry,
|
|
52
52
|
SessionManager,
|
|
53
53
|
} from "@earendil-works/pi-coding-agent";
|
|
54
|
-
import {
|
|
54
|
+
import { getBuiltinModel } from "@earendil-works/pi-ai/providers/all";
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
+
**pi-ai 0.80.0 API move:** the old global API (`getModel`, `getModels`, `getProviders`, `stream`, `complete`, `completeSimple`, `registerApiProvider`, `getEnvApiKey`, ...) moved off the `@earendil-works/pi-ai` root entrypoint to `@earendil-works/pi-ai/compat` (a deprecated shim slated for removal). For built-in model lookup use `getBuiltinModel(provider, modelId)` from `@earendil-works/pi-ai/providers/all`, or the provider-factory API (`createModels()` / `Models.getModel()`). Extensions loaded by Pi are unaffected at runtime — the extension loader aliases the pi-ai root to the compat superset — but standalone SDK scripts and typechecked extension sources must use the new paths. The selective `@earendil-works/pi-ai/base` / `@earendil-works/pi-agent-core/base` entrypoints introduced in 0.79.8 were removed again in 0.80.0.
|
|
58
|
+
|
|
57
59
|
## Core Options
|
|
58
60
|
|
|
59
61
|
```typescript
|
|
@@ -66,10 +68,10 @@ const { session } = await createAgentSession({
|
|
|
66
68
|
agentDir: "~/.pi/agent",
|
|
67
69
|
authStorage,
|
|
68
70
|
modelRegistry,
|
|
69
|
-
model:
|
|
71
|
+
model: getBuiltinModel("anthropic", "claude-opus-4-8"),
|
|
70
72
|
thinkingLevel: "medium",
|
|
71
73
|
scopedModels: [
|
|
72
|
-
{ model:
|
|
74
|
+
{ model: getBuiltinModel("anthropic", "claude-opus-4-8"), thinkingLevel: "high" },
|
|
73
75
|
],
|
|
74
76
|
tools: ["read", "bash", "edit", "write"],
|
|
75
77
|
customTools: [/* defineTool(...) entries */],
|
|
@@ -204,6 +206,18 @@ session.subscribe((event) => {
|
|
|
204
206
|
});
|
|
205
207
|
```
|
|
206
208
|
|
|
209
|
+
`compaction_end` results and RPC `compact` responses include estimated post-compaction token counts (Pi 0.79.8) so clients can show the approximate context reduction.
|
|
210
|
+
|
|
211
|
+
## RPC Mode
|
|
212
|
+
|
|
213
|
+
`pi --mode rpc` speaks newline-delimited JSON over stdio. Additions since Pi 0.79:
|
|
214
|
+
|
|
215
|
+
- `get_entries` / `get_tree` (Pi 0.80.3) read session entries and tree snapshots over RPC.
|
|
216
|
+
- `@earendil-works/pi-coding-agent/rpc-entry` (Pi 0.80.3) launches Pi directly in RPC mode from an importing process.
|
|
217
|
+
- RPC extension UI request/response types are exported from the public API (Pi 0.79.0).
|
|
218
|
+
- Package asset path helpers are exported from the public API (Pi 0.79.0).
|
|
219
|
+
- `CONFIG_DIR_NAME` and edit diff helpers (`generateDiffString`, `generateUnifiedPatch`, `EditDiffResult`) are exported for extensions and hosts (Pi 0.79.7).
|
|
220
|
+
|
|
207
221
|
## Resource Loader Hooks
|
|
208
222
|
|
|
209
223
|
`DefaultResourceLoader` supports overrides for extensions, skills, prompts, themes, and context files. Common patterns:
|
|
@@ -39,14 +39,19 @@ Edit JSON directly or use `/settings` for common interactive options.
|
|
|
39
39
|
"doubleEscapeAction": "tree",
|
|
40
40
|
"treeFilterMode": "default",
|
|
41
41
|
"editorPaddingX": 0,
|
|
42
|
+
"outputPad": 1,
|
|
42
43
|
"autocompleteMaxVisible": 5,
|
|
43
|
-
"showHardwareCursor": false
|
|
44
|
+
"showHardwareCursor": false,
|
|
45
|
+
"externalEditor": "code --wait"
|
|
44
46
|
}
|
|
45
47
|
```
|
|
46
48
|
|
|
47
49
|
- `doubleEscapeAction`: `"tree"`, `"fork"`, or `"none"`
|
|
48
50
|
- `treeFilterMode`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, or `"all"`
|
|
49
51
|
- In `/tree`, `Shift+T` toggles timestamps on entry labels
|
|
52
|
+
- `theme` also accepts `"light-name/dark-name"` (Pi 0.79.7) to switch themes automatically with the terminal color scheme; `/` is reserved in theme names for this. On first run Pi detects the terminal background and defaults to `dark` or `light`.
|
|
53
|
+
- `outputPad` (Pi 0.80.3, `0` or `1`) sets horizontal padding for user messages, assistant messages, and thinking blocks.
|
|
54
|
+
- `externalEditor` (Pi 0.80.3) sets the `Ctrl+G` external editor command and takes precedence over `$VISUAL`/`$EDITOR`.
|
|
50
55
|
|
|
51
56
|
## Compaction, Branch Summary, Retry
|
|
52
57
|
|
|
@@ -65,11 +70,10 @@ Edit JSON directly or use `/settings` for common interactive options.
|
|
|
65
70
|
"enabled": true,
|
|
66
71
|
"maxRetries": 3,
|
|
67
72
|
"baseDelayMs": 2000,
|
|
68
|
-
"maxDelayMs": 60000,
|
|
69
73
|
"provider": {
|
|
70
|
-
"timeoutMs":
|
|
74
|
+
"timeoutMs": 3600000,
|
|
71
75
|
"maxRetries": 0,
|
|
72
|
-
"maxRetryDelayMs":
|
|
76
|
+
"maxRetryDelayMs": 60000
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
}
|
|
@@ -77,8 +81,9 @@ Edit JSON directly or use `/settings` for common interactive options.
|
|
|
77
81
|
|
|
78
82
|
Notes:
|
|
79
83
|
|
|
80
|
-
- `retry.
|
|
81
|
-
- `retry.provider.*`
|
|
84
|
+
- `retry.maxRetries` (default `3`) and `retry.baseDelayMs` (default `2000`) govern Pi's own agent-level retry with exponential backoff.
|
|
85
|
+
- `retry.provider.*` controls the underlying provider SDK's request timeout and retry/backoff — useful for slow local LLMs and flaky proxies. `retry.provider.timeoutMs` sets the SDK request timeout; `retry.provider.maxRetries` defaults to `0` (keep it there unless you need SDK-level retries, since raising it can let provider retries swallow usage-limit errors before Pi handles them).
|
|
86
|
+
- `retry.provider.maxRetryDelayMs` (default `60000`) caps how long a server-requested retry delay can be before the request fails immediately with an informative error; set to `0` to disable the cap. The old top-level `retry.maxDelayMs` was renamed to this and is auto-migrated.
|
|
82
87
|
- `branchSummary.skipPrompt` skips the confirmation step when navigating with `/tree`.
|
|
83
88
|
|
|
84
89
|
## Message Delivery
|
|
@@ -87,12 +92,18 @@ Notes:
|
|
|
87
92
|
{
|
|
88
93
|
"steeringMode": "one-at-a-time",
|
|
89
94
|
"followUpMode": "one-at-a-time",
|
|
90
|
-
"transport": "
|
|
95
|
+
"transport": "auto",
|
|
96
|
+
"httpIdleTimeoutMs": 300000,
|
|
97
|
+
"websocketConnectTimeoutMs": 15000,
|
|
98
|
+
"httpProxy": "http://127.0.0.1:7890"
|
|
91
99
|
}
|
|
92
100
|
```
|
|
93
101
|
|
|
94
102
|
- `steeringMode` and `followUpMode`: `"all"` or `"one-at-a-time"`
|
|
95
|
-
- `transport
|
|
103
|
+
- `transport` (default `"auto"`): `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` — the preferred transport for providers that support several
|
|
104
|
+
- `httpIdleTimeoutMs` (default `300000`) is the HTTP header/body idle timeout, also applied as the default SDK request timeout for providers that support it (e.g. OpenAI Codex WebSocket waits, llama.cpp). Set to `0` to disable.
|
|
105
|
+
- `websocketConnectTimeoutMs` (default `15000`) bounds the WebSocket connect/open handshake. Set to `0` to disable.
|
|
106
|
+
- `httpProxy` (Pi 0.79.5, global settings only) is applied as `HTTP_PROXY` and `HTTPS_PROXY` for Pi-managed HTTP clients.
|
|
96
107
|
|
|
97
108
|
## Terminal, Images, and Shell
|
|
98
109
|
|
|
@@ -143,6 +154,21 @@ Notes:
|
|
|
143
154
|
|
|
144
155
|
When multiple sources specify a session directory, `--session-dir` takes precedence over `sessionDir` in settings. Pi 0.65.0 removed the old `session_directory` extension/settings hook.
|
|
145
156
|
|
|
157
|
+
## Project Trust
|
|
158
|
+
|
|
159
|
+
Since Pi 0.79.0, project-local settings, resources, and packages (`.pi/` settings/extensions/skills/prompts/themes, project packages) only load after the project is trusted. `AGENTS.md` / `CLAUDE.md` context files load regardless of trust. Trust is a loading gate, not a sandbox.
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"defaultProjectTrust": "ask"
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
- Interactive mode prompts on first use; `/trust` saves a decision (written to `~/.pi/agent/trust.json`; restart Pi to apply).
|
|
168
|
+
- `--approve`/`-a` and `--no-approve`/`-na` override trust for one run, including for `pi install` and other package commands. `pi update` never prompts.
|
|
169
|
+
- Non-interactive modes (`-p`, `--mode json`, `--mode rpc`) never prompt. Without a saved decision they follow `defaultProjectTrust` (global setting only): `"ask"` (default) and `"never"` skip project resources; `"always"` trusts them.
|
|
170
|
+
- Extensions can decide or defer trust via the `project_trust` event and inspect the outcome with `ctx.isProjectTrusted()` — see `references/extensions.md`.
|
|
171
|
+
|
|
146
172
|
## Resources
|
|
147
173
|
|
|
148
174
|
These settings control what Pi loads from disk or packages:
|
|
@@ -218,12 +244,15 @@ pi [options] [@files...] [messages...]
|
|
|
218
244
|
-c, --continue continue most recent session
|
|
219
245
|
-r, --resume browse and select
|
|
220
246
|
--session <path|id>
|
|
247
|
+
--session-id <id> use an exact project-local session id, creating it if missing
|
|
221
248
|
--fork <path|id>
|
|
222
249
|
--session-dir <dir>
|
|
250
|
+
-n, --name <name> set the session display name at startup
|
|
223
251
|
--no-session ephemeral
|
|
224
252
|
|
|
225
253
|
# tools and resources
|
|
226
254
|
--tools <list>, -t name allowlist (read,bash,edit,write,grep,find,ls,...)
|
|
255
|
+
--exclude-tools <list>, -xt disable specific built-in/extension/custom tools, keep the rest
|
|
227
256
|
--no-tools, -nt disable everything
|
|
228
257
|
--no-builtin-tools, -nbt disable built-ins, keep extension/custom
|
|
229
258
|
-e, --extension <source> repeatable; npm/git/path
|
|
@@ -233,6 +262,11 @@ pi [options] [@files...] [messages...]
|
|
|
233
262
|
--no-extensions / --no-skills / --no-prompt-templates / --no-themes
|
|
234
263
|
--no-context-files, -nc skip AGENTS.md / CLAUDE.md discovery
|
|
235
264
|
|
|
265
|
+
# trust and network
|
|
266
|
+
-a, --approve trust project-local files for this run
|
|
267
|
+
-na, --no-approve ignore project-local files for this run
|
|
268
|
+
--offline disable startup network operations (same as PI_OFFLINE=1)
|
|
269
|
+
|
|
236
270
|
# prompts and misc
|
|
237
271
|
--system-prompt <text> replace default
|
|
238
272
|
--append-system-prompt <text> repeatable; appended with double newlines
|
|
@@ -248,11 +282,11 @@ pi [options] [@files...] [messages...]
|
|
|
248
282
|
| `PI_PACKAGE_DIR` | Override package storage directory |
|
|
249
283
|
| `PI_SKIP_VERSION_CHECK` | Skip the `pi.dev` latest-version request at startup |
|
|
250
284
|
| `PI_OFFLINE` | Disable all startup network operations (update checks, telemetry) |
|
|
251
|
-
| `PI_TELEMETRY` |
|
|
285
|
+
| `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers (`1`/`0`); does not gate update checks |
|
|
252
286
|
| `PI_CACHE_RETENTION` | Set to `long` for extended prompt-cache retention where supported |
|
|
253
287
|
| `PI_OAUTH_CALLBACK_HOST` | Bind the OAuth callback server to a custom interface |
|
|
254
288
|
| `PI_CODING_AGENT=true` | Set automatically at startup so subprocesses can detect Pi |
|
|
255
|
-
| `VISUAL`, `EDITOR` | External editor for `Ctrl+G` |
|
|
289
|
+
| `VISUAL`, `EDITOR` | External editor for `Ctrl+G` (the `externalEditor` setting takes precedence) |
|
|
256
290
|
| Provider API key env vars | See `references/providers.md` |
|
|
257
291
|
|
|
258
292
|
## Practical Notes
|
|
@@ -18,7 +18,7 @@ Pi discovers skills from:
|
|
|
18
18
|
- Global:
|
|
19
19
|
- `~/.pi/agent/skills/`
|
|
20
20
|
- `~/.agents/skills/`
|
|
21
|
-
- Project:
|
|
21
|
+
- Project (loaded only after the project is trusted; see project trust in `references/settings.md`):
|
|
22
22
|
- `.pi/skills/`
|
|
23
23
|
- `.agents/skills/` in `cwd` and ancestor directories
|
|
24
24
|
- Packages:
|