@dyyz1993/pi-coding-agent 0.70.6 → 0.74.4
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/CHANGELOG.md +266 -80
- package/README.md +48 -20
- package/dist/bun/cli.d.ts.map +1 -1
- package/dist/bun/cli.js +4 -2
- package/dist/bun/cli.js.map +1 -1
- package/dist/bun/restore-sandbox-env.d.ts +13 -0
- package/dist/bun/restore-sandbox-env.d.ts.map +1 -0
- package/dist/bun/restore-sandbox-env.js +32 -0
- package/dist/bun/restore-sandbox-env.js.map +1 -0
- package/dist/cli/args.d.ts +2 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +34 -22
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +2 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -4
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +16 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +238 -66
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +10 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +14 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +25 -26
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1042 -1116
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-guidance.d.ts +5 -0
- package/dist/core/auth-guidance.d.ts.map +1 -0
- package/dist/core/auth-guidance.js +21 -0
- package/dist/core/auth-guidance.js.map +1 -0
- package/dist/core/auth-storage.d.ts +9 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +20 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +9 -6
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +0 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +1 -1
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/template.css +53 -4
- package/dist/core/export-html/template.js +84 -20
- package/dist/core/export-html/tool-renderer.d.ts +0 -6
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +15 -2
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +0 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +49 -137
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +24 -20
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +128 -253
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +88 -60
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +10 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/file-store/file-snapshot-manager.d.ts +95 -0
- package/dist/core/file-store/file-snapshot-manager.d.ts.map +1 -0
- package/dist/core/file-store/file-snapshot-manager.js +508 -0
- package/dist/core/file-store/file-snapshot-manager.js.map +1 -0
- package/dist/core/file-store/index.d.ts +5 -0
- package/dist/core/file-store/index.d.ts.map +1 -0
- package/dist/core/file-store/index.js +3 -0
- package/dist/core/file-store/index.js.map +1 -0
- package/dist/core/messages.d.ts +10 -2
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +23 -6
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry.d.ts +19 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +97 -16
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +24 -15
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +61 -35
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/provider-display-names.d.ts +2 -0
- package/dist/core/provider-display-names.d.ts.map +1 -0
- package/dist/core/provider-display-names.js +32 -0
- package/dist/core/provider-display-names.js.map +1 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +9 -21
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +9 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +39 -18
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +27 -17
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +133 -47
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +21 -3
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +51 -6
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +3 -8
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -3
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/tools/bash.d.ts +0 -2
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +155 -110
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +3 -2
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -3
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +1 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts +50 -0
- package/dist/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/core/tools/output-accumulator.js +178 -0
- package/dist/core/tools/output-accumulator.js.map +1 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +70 -13
- package/dist/core/tools/read.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +17 -39
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +3 -3
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +3 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -4
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +14 -56
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +5 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +19 -4
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +1 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +18 -6
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +93 -25
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +3 -7
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +5 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +53 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +20 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +423 -186
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +1 -1
- package/dist/modes/interactive/theme/light.json +1 -1
- package/dist/modes/print-mode.d.ts +3 -0
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +62 -19
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +80 -60
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +108 -93
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +106 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +115 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +238 -12
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/child-process.d.ts +1 -0
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +8 -0
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +2 -2
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +84 -45
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/paths.d.ts +9 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +31 -0
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +5 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/structured-output.d.ts +10 -0
- package/dist/utils/structured-output.d.ts.map +1 -0
- package/dist/utils/structured-output.js +57 -0
- package/dist/utils/structured-output.js.map +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +6 -2
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +14 -0
- package/dist/utils/version-check.d.ts.map +1 -0
- package/dist/utils/version-check.js +77 -0
- package/dist/utils/version-check.js.map +1 -0
- package/docs/compaction.md +14 -14
- package/docs/custom-provider.md +40 -31
- package/docs/development.md +1 -1
- package/docs/docs.json +148 -0
- package/docs/extensions.md +116 -56
- package/docs/index.md +70 -0
- package/docs/json.md +4 -4
- package/docs/models.md +150 -3
- package/docs/packages.md +10 -5
- package/docs/providers.md +62 -17
- package/docs/quickstart.md +142 -0
- package/docs/rollback-architecture.md +693 -0
- package/docs/rollback-test-cases.md +412 -0
- package/docs/rpc.md +1 -1
- package/docs/sdk.md +26 -26
- package/docs/{session.md → session-format.md} +6 -6
- package/docs/sessions.md +137 -0
- package/docs/settings.md +52 -9
- package/docs/termux.md +1 -1
- package/docs/themes.md +2 -2
- package/docs/tui.md +20 -20
- package/docs/usage.md +277 -0
- package/examples/extensions/README.md +2 -4
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/commands.ts +2 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/git-checkpoint.ts +1 -1
- package/examples/extensions/handoff.ts +49 -11
- package/examples/extensions/plan-mode/index.ts +1 -1
- package/examples/extensions/sandbox/package-lock.json +5 -5
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/README.md +2 -2
- package/package.json +7 -16
- package/docs/tree.md +0 -233
- package/examples/extensions/antigravity-image-gen.ts +0 -418
package/docs/models.md
CHANGED
|
@@ -11,7 +11,9 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.pi/ag
|
|
|
11
11
|
- [Model Configuration](#model-configuration)
|
|
12
12
|
- [Overriding Built-in Providers](#overriding-built-in-providers)
|
|
13
13
|
- [Per-model Overrides](#per-model-overrides)
|
|
14
|
+
- [Anthropic Messages Compatibility](#anthropic-messages-compatibility)
|
|
14
15
|
- [OpenAI Compatibility](#openai-compatibility)
|
|
16
|
+
- [Model Tier Aliases](#model-tier-aliases)
|
|
15
17
|
|
|
16
18
|
## Minimal Example
|
|
17
19
|
|
|
@@ -191,16 +193,59 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
|
|
|
191
193
|
| `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown in model details/status text. |
|
|
192
194
|
| `api` | No | provider's `api` | Override provider's API for this model |
|
|
193
195
|
| `reasoning` | No | `false` | Supports extended thinking |
|
|
196
|
+
| `thinkingLevelMap` | No | omitted | Maps pi thinking levels to provider values and marks unsupported levels (see below) |
|
|
194
197
|
| `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
|
|
195
198
|
| `contextWindow` | No | `128000` | Context window size in tokens |
|
|
196
199
|
| `maxTokens` | No | `16384` | Maximum output tokens |
|
|
197
200
|
| `cost` | No | all zeros | `{"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0}` (per million tokens) |
|
|
198
|
-
| `compat` | No | provider `compat` |
|
|
201
|
+
| `compat` | No | provider `compat` | Provider compatibility overrides. Merged with provider-level `compat` when both are set. |
|
|
199
202
|
|
|
200
203
|
Current behavior:
|
|
201
204
|
- `/model` and `--list-models` list entries by model `id`.
|
|
202
205
|
- The configured `name` is used for model matching and detail/status text.
|
|
203
206
|
|
|
207
|
+
### Thinking Level Map
|
|
208
|
+
|
|
209
|
+
Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
|
|
210
|
+
|
|
211
|
+
Values are tristate:
|
|
212
|
+
|
|
213
|
+
| Value | Meaning |
|
|
214
|
+
|-------|---------|
|
|
215
|
+
| omitted | Level is supported and uses the provider's default mapping |
|
|
216
|
+
| string | Level is supported and this value is sent to the provider |
|
|
217
|
+
| `null` | Level is unsupported and hidden/skipped/clamped away |
|
|
218
|
+
|
|
219
|
+
Example for a model that only supports off, high, and max reasoning:
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"id": "deepseek-v4-pro",
|
|
224
|
+
"reasoning": true,
|
|
225
|
+
"thinkingLevelMap": {
|
|
226
|
+
"minimal": null,
|
|
227
|
+
"low": null,
|
|
228
|
+
"medium": null,
|
|
229
|
+
"high": "high",
|
|
230
|
+
"xhigh": "max"
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Example for a model where thinking cannot be disabled:
|
|
236
|
+
|
|
237
|
+
```json
|
|
238
|
+
{
|
|
239
|
+
"id": "always-thinking-model",
|
|
240
|
+
"reasoning": true,
|
|
241
|
+
"thinkingLevelMap": {
|
|
242
|
+
"off": null
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Migration: older configs that used `compat.reasoningEffortMap` should move that mapping to model-level `thinkingLevelMap`. Use `null` for levels that should not appear in the UI.
|
|
248
|
+
|
|
204
249
|
## Overriding Built-in Providers
|
|
205
250
|
|
|
206
251
|
Route a built-in provider through a proxy without redefining models:
|
|
@@ -269,6 +314,40 @@ Behavior notes:
|
|
|
269
314
|
- You can combine provider-level `baseUrl`/`headers` with `modelOverrides`.
|
|
270
315
|
- If `models` is also defined for a provider, custom models are merged after built-in overrides. A custom model with the same `id` replaces the overridden built-in model entry.
|
|
271
316
|
|
|
317
|
+
## Anthropic Messages Compatibility
|
|
318
|
+
|
|
319
|
+
For providers or proxies using `api: "anthropic-messages"`, use `compat.supportsEagerToolInputStreaming` to control Anthropic fine-grained tool streaming compatibility.
|
|
320
|
+
|
|
321
|
+
By default pi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Pi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"providers": {
|
|
326
|
+
"anthropic-proxy": {
|
|
327
|
+
"baseUrl": "https://proxy.example.com",
|
|
328
|
+
"api": "anthropic-messages",
|
|
329
|
+
"apiKey": "ANTHROPIC_PROXY_KEY",
|
|
330
|
+
"compat": {
|
|
331
|
+
"supportsEagerToolInputStreaming": false,
|
|
332
|
+
"supportsLongCacheRetention": true
|
|
333
|
+
},
|
|
334
|
+
"models": [
|
|
335
|
+
{
|
|
336
|
+
"id": "claude-opus-4-7",
|
|
337
|
+
"reasoning": true,
|
|
338
|
+
"input": ["text", "image"]
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
| Field | Description |
|
|
347
|
+
|-------|-------------|
|
|
348
|
+
| `supportsEagerToolInputStreaming` | Whether the provider accepts per-tool `eager_input_streaming`. Default: `true`. Set to `false` to omit that field and use the legacy fine-grained tool streaming beta header on tool-enabled requests. |
|
|
349
|
+
| `supportsLongCacheRetention` | Whether the provider accepts Anthropic long cache retention (`cache_control.ttl: "1h"`) when cache retention is `long`. Default: `true`. |
|
|
350
|
+
|
|
272
351
|
## OpenAI Compatibility
|
|
273
352
|
|
|
274
353
|
For providers with partial OpenAI compatibility, use the `compat` field.
|
|
@@ -297,15 +376,16 @@ For providers with partial OpenAI compatibility, use the `compat` field.
|
|
|
297
376
|
| `supportsStore` | Provider supports `store` field |
|
|
298
377
|
| `supportsDeveloperRole` | Use `developer` vs `system` role |
|
|
299
378
|
| `supportsReasoningEffort` | Support for `reasoning_effort` parameter |
|
|
300
|
-
| `reasoningEffortMap` | Map pi thinking levels to provider-specific `reasoning_effort` values |
|
|
301
379
|
| `supportsUsageInStreaming` | Supports `stream_options: { include_usage: true }` (default: `true`) |
|
|
302
380
|
| `maxTokensField` | Use `max_completion_tokens` or `max_tokens` |
|
|
303
381
|
| `requiresToolResultName` | Include `name` on tool result messages |
|
|
304
382
|
| `requiresAssistantAfterToolResult` | Insert an assistant message before a user message after tool results |
|
|
305
383
|
| `requiresThinkingAsText` | Convert thinking blocks to plain text |
|
|
306
|
-
| `
|
|
384
|
+
| `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
|
|
385
|
+
| `thinkingFormat` | Use `reasoning_effort`, `deepseek`, `zai`, `qwen`, or `qwen-chat-template` thinking parameters |
|
|
307
386
|
| `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user/assistant text content. Currently only `anthropic` is supported. |
|
|
308
387
|
| `supportsStrictMode` | Include the `strict` field in tool definitions |
|
|
388
|
+
| `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
|
|
309
389
|
| `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
|
|
310
390
|
| `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
|
|
311
391
|
|
|
@@ -393,3 +473,70 @@ Vercel AI Gateway example:
|
|
|
393
473
|
}
|
|
394
474
|
}
|
|
395
475
|
```
|
|
476
|
+
|
|
477
|
+
## Model Tier Aliases
|
|
478
|
+
|
|
479
|
+
Pi provides built-in model aliases that work as shorthand for specific models:
|
|
480
|
+
|
|
481
|
+
| Alias | Default Model | Use Case |
|
|
482
|
+
|-------|--------------|----------|
|
|
483
|
+
| `fast` | `anthropic/claude-haiku-4` | Quick tasks: summaries, titles, classification |
|
|
484
|
+
| `pro` | `anthropic/claude-sonnet-4-20250514` | Day-to-day coding: write code, fix bugs, answer questions |
|
|
485
|
+
| `max` | `anthropic/claude-opus-4-6` | Deep reasoning: architecture design, code review, complex analysis |
|
|
486
|
+
|
|
487
|
+
### Where Aliases Work
|
|
488
|
+
|
|
489
|
+
Aliases are accepted everywhere a model can be specified:
|
|
490
|
+
|
|
491
|
+
- **CLI**: `pi --model fast`
|
|
492
|
+
- **CLI scoped models**: `pi --models "fast,pro,max"`
|
|
493
|
+
- **Settings**: `"defaultModel": "pro"`, `"enabledModels": ["fast", "pro", "max"]`
|
|
494
|
+
- **Interactive**: `/model fast`
|
|
495
|
+
- **Agent configs**: `model: max` in `.pi/agents/*.md`
|
|
496
|
+
- **Extension API**: `pi.callLLM({ model: "fast", ... })`, `pi.forkAgent("task", { model: "max" })`
|
|
497
|
+
- **RPC**: `{ type: "set_model", provider: "...", modelId: "fast" }`
|
|
498
|
+
|
|
499
|
+
### Resolution Order
|
|
500
|
+
|
|
501
|
+
When an alias is used, it resolves through this chain:
|
|
502
|
+
|
|
503
|
+
1. **Session-level** `tierModels` override (set via `pi.setTierModels()`)
|
|
504
|
+
2. **Global** `tierModels` from `settings.json`
|
|
505
|
+
3. **Hardcoded defaults** (`fast` → haiku, `pro` → sonnet, `max` → opus)
|
|
506
|
+
4. **Current session model** (if alias can't be resolved)
|
|
507
|
+
|
|
508
|
+
### Customizing Aliases
|
|
509
|
+
|
|
510
|
+
Override in `~/.pi/settings.json` (global) or `.pi/settings.json` (per-project):
|
|
511
|
+
|
|
512
|
+
```json
|
|
513
|
+
{
|
|
514
|
+
"tierModels": {
|
|
515
|
+
"fast": "openai/gpt-4o-mini",
|
|
516
|
+
"pro": "google/gemini-2.5-pro",
|
|
517
|
+
"max": "anthropic/claude-opus-4-6"
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
You only need to override the aliases you want to change. Unspecified aliases keep their defaults.
|
|
523
|
+
|
|
524
|
+
### Using in Extensions
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
// Quick task with fast model
|
|
528
|
+
const summary = await pi.callLLM({
|
|
529
|
+
model: "fast",
|
|
530
|
+
messages: [{ role: "user", content: "Summarize..." }],
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
// Background review with max model
|
|
534
|
+
pi.background(async (signal) => {
|
|
535
|
+
const result = await pi.forkAgent("Review this code", {
|
|
536
|
+
model: "max",
|
|
537
|
+
shareContext: false,
|
|
538
|
+
maxTurns: 5,
|
|
539
|
+
signal,
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
```
|
package/docs/packages.md
CHANGED
|
@@ -27,8 +27,13 @@ pi install /absolute/path/to/package
|
|
|
27
27
|
pi install ./relative/path/to/package
|
|
28
28
|
|
|
29
29
|
pi remove npm:@foo/bar
|
|
30
|
-
pi list
|
|
31
|
-
pi update
|
|
30
|
+
pi list # show installed packages from settings
|
|
31
|
+
pi update # update pi and all non-pinned packages
|
|
32
|
+
pi update --extensions # update all non-pinned packages only
|
|
33
|
+
pi update --self # update pi only
|
|
34
|
+
pi update --self --force # reinstall pi even if current
|
|
35
|
+
pi update npm:@foo/bar # update one package
|
|
36
|
+
pi update --extension npm:@foo/bar
|
|
32
37
|
```
|
|
33
38
|
|
|
34
39
|
By default, `install` and `remove` write to global settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup.
|
|
@@ -51,7 +56,7 @@ npm:@scope/pkg@1.2.3
|
|
|
51
56
|
npm:pkg
|
|
52
57
|
```
|
|
53
58
|
|
|
54
|
-
- Versioned specs are pinned and skipped by `pi update
|
|
59
|
+
- Versioned specs are pinned and skipped by package updates (`pi update`, `pi update --extensions`).
|
|
55
60
|
- Global installs use `npm install -g`.
|
|
56
61
|
- Project installs go under `.pi/npm/`.
|
|
57
62
|
- Set `npmCommand` in `settings.json` to pin npm package lookup and install operations to a specific wrapper command such as `mise` or `asdf`.
|
|
@@ -78,7 +83,7 @@ ssh://git@github.com/user/repo@v1
|
|
|
78
83
|
- HTTPS and SSH URLs are both supported.
|
|
79
84
|
- SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
|
|
80
85
|
- For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
|
|
81
|
-
- Refs pin the package and skip `pi update
|
|
86
|
+
- Refs pin the package and skip package updates (`pi update`, `pi update --extensions`).
|
|
82
87
|
- Cloned to `~/.pi/agent/git/<host>/<path>` (global) or `.pi/git/<host>/<path>` (project).
|
|
83
88
|
- Runs `npm install` after clone or pull if `package.json` exists.
|
|
84
89
|
|
|
@@ -158,7 +163,7 @@ If no `pi` manifest is present, pi auto-discovers resources from these directori
|
|
|
158
163
|
|
|
159
164
|
Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When pi installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
|
|
160
165
|
|
|
161
|
-
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@
|
|
166
|
+
Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@dyyz1993/pi-ai`, `@dyyz1993/pi-agent-core`, `@dyyz1993/pi-coding-agent`, `@dyyz1993/pi-tui`, `typebox`.
|
|
162
167
|
|
|
163
168
|
Other pi packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.
|
|
164
169
|
|
package/docs/providers.md
CHANGED
|
@@ -15,36 +15,31 @@ Pi supports subscription-based providers via OAuth and API key providers via env
|
|
|
15
15
|
|
|
16
16
|
Use `/login` in interactive mode, then select a provider:
|
|
17
17
|
|
|
18
|
-
- Claude Pro/Max
|
|
19
18
|
- ChatGPT Plus/Pro (Codex)
|
|
19
|
+
- Claude Pro/Max
|
|
20
20
|
- GitHub Copilot
|
|
21
|
-
- Google Gemini CLI
|
|
22
|
-
- Google Antigravity
|
|
23
21
|
|
|
24
22
|
Use `/logout` to clear credentials. Tokens are stored in `~/.pi/agent/auth.json` and auto-refresh when expired.
|
|
25
23
|
|
|
26
|
-
###
|
|
24
|
+
### OpenAI Codex
|
|
27
25
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
26
|
+
- Requires ChatGPT Plus or Pro subscription
|
|
27
|
+
- Officially endorsed by OpenAI: [Codex for OSS](https://developers.openai.com/community/codex-for-oss)
|
|
30
28
|
|
|
31
|
-
###
|
|
29
|
+
### Claude Pro/Max
|
|
32
30
|
|
|
33
|
-
-
|
|
34
|
-
- **Antigravity**: Sandbox with Gemini 3, Claude, and GPT-OSS models
|
|
35
|
-
- Both free with any Google account, subject to rate limits
|
|
36
|
-
- For paid Cloud Code Assist: set `GOOGLE_CLOUD_PROJECT` env var
|
|
31
|
+
Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party harness usage draws from [extra usage](https://claude.ai/settings/usage) and is billed per token, not against Claude plan limits.
|
|
37
32
|
|
|
38
|
-
###
|
|
33
|
+
### GitHub Copilot
|
|
39
34
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
35
|
+
- Press Enter for github.com, or enter your GitHub Enterprise Server domain
|
|
36
|
+
- If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
|
|
42
37
|
|
|
43
38
|
## API Keys
|
|
44
39
|
|
|
45
40
|
### Environment Variables or Auth File
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
Use `/login` in interactive mode and select a provider to store an API key in `auth.json`, or set credentials via environment variable:
|
|
48
43
|
|
|
49
44
|
```bash
|
|
50
45
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
@@ -56,10 +51,13 @@ pi
|
|
|
56
51
|
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
57
52
|
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
58
53
|
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
54
|
+
| DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
|
|
59
55
|
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
60
56
|
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
61
57
|
| Groq | `GROQ_API_KEY` | `groq` |
|
|
62
58
|
| Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
|
|
59
|
+
| Cloudflare AI Gateway | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_GATEWAY_ID`) | `cloudflare-ai-gateway` |
|
|
60
|
+
| Cloudflare Workers AI | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`) | `cloudflare-workers-ai` |
|
|
63
61
|
| xAI | `XAI_API_KEY` | `xai` |
|
|
64
62
|
| OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
|
|
65
63
|
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
|
|
@@ -71,8 +69,12 @@ pi
|
|
|
71
69
|
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
|
72
70
|
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
|
73
71
|
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
|
72
|
+
| Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
|
|
73
|
+
| Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` | `xiaomi-token-plan-cn` |
|
|
74
|
+
| Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
|
|
75
|
+
| Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
|
|
74
76
|
|
|
75
|
-
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/
|
|
77
|
+
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/dyyz1993/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/dyyz1993/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
|
|
76
78
|
|
|
77
79
|
#### Auth File
|
|
78
80
|
|
|
@@ -82,9 +84,14 @@ Store credentials in `~/.pi/agent/auth.json`:
|
|
|
82
84
|
{
|
|
83
85
|
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
|
|
84
86
|
"openai": { "type": "api_key", "key": "sk-..." },
|
|
87
|
+
"deepseek": { "type": "api_key", "key": "sk-..." },
|
|
85
88
|
"google": { "type": "api_key", "key": "..." },
|
|
86
89
|
"opencode": { "type": "api_key", "key": "..." },
|
|
87
|
-
"opencode-go": { "type": "api_key", "key": "..." }
|
|
90
|
+
"opencode-go": { "type": "api_key", "key": "..." },
|
|
91
|
+
"xiaomi": { "type": "api_key", "key": "..." },
|
|
92
|
+
"xiaomi-token-plan-cn": { "type": "api_key", "key": "..." },
|
|
93
|
+
"xiaomi-token-plan-ams": { "type": "api_key", "key": "..." },
|
|
94
|
+
"xiaomi-token-plan-sgp": { "type": "api_key", "key": "..." }
|
|
88
95
|
}
|
|
89
96
|
```
|
|
90
97
|
|
|
@@ -117,6 +124,8 @@ OAuth credentials are also stored here after `/login` and managed automatically.
|
|
|
117
124
|
```bash
|
|
118
125
|
export AZURE_OPENAI_API_KEY=...
|
|
119
126
|
export AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com
|
|
127
|
+
# also supported: https://your-resource.cognitiveservices.azure.com
|
|
128
|
+
# root endpoints are auto-normalized to /openai/v1
|
|
120
129
|
# or use resource name instead of base URL
|
|
121
130
|
export AZURE_OPENAI_RESOURCE_NAME=your-resource
|
|
122
131
|
|
|
@@ -168,6 +177,42 @@ export AWS_BEDROCK_SKIP_AUTH=1
|
|
|
168
177
|
export AWS_BEDROCK_FORCE_HTTP1=1
|
|
169
178
|
```
|
|
170
179
|
|
|
180
|
+
### Cloudflare AI Gateway
|
|
181
|
+
|
|
182
|
+
`CLOUDFLARE_API_KEY` can be set via `/login`. The account ID and gateway slug must be set as environment variables.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
export CLOUDFLARE_API_KEY=... # or use /login
|
|
186
|
+
export CLOUDFLARE_ACCOUNT_ID=...
|
|
187
|
+
export CLOUDFLARE_GATEWAY_ID=... # create at dash.cloudflare.com → AI → AI Gateway
|
|
188
|
+
pi --provider cloudflare-ai-gateway --model "claude-sonnet-4-5"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Routes to OpenAI, Anthropic, and Workers AI through Cloudflare AI Gateway. Workers AI uses the Unified API (`/compat`) and prefixed model IDs (`workers-ai/@cf/...`). OpenAI uses the OpenAI passthrough route (`/openai`) with native OpenAI model IDs such as `gpt-5.1`. Anthropic uses the Anthropic passthrough route (`/anthropic`) with native Anthropic model IDs such as `claude-sonnet-4-5`.
|
|
192
|
+
|
|
193
|
+
AI Gateway authentication uses `CLOUDFLARE_API_KEY` as `cf-aig-authorization`. Upstream authentication can be one of:
|
|
194
|
+
|
|
195
|
+
| Mode | Request auth | Upstream auth |
|
|
196
|
+
|------|--------------|---------------|
|
|
197
|
+
| Workers AI | Cloudflare token only | Cloudflare-native |
|
|
198
|
+
| Unified billing | Cloudflare token only | Cloudflare handles upstream auth and deducts credits |
|
|
199
|
+
| Stored BYOK | Cloudflare token only | Cloudflare injects provider keys stored in the AI Gateway dashboard |
|
|
200
|
+
| Inline BYOK | Cloudflare token plus upstream `Authorization` header | The request supplies the upstream provider key |
|
|
201
|
+
|
|
202
|
+
For normal pi usage, prefer unified billing or stored BYOK. Inline BYOK requires configuring an additional upstream `Authorization` header for the Cloudflare AI Gateway provider, for example via a `models.json` provider/model override.
|
|
203
|
+
|
|
204
|
+
### Cloudflare Workers AI
|
|
205
|
+
|
|
206
|
+
`CLOUDFLARE_API_KEY` can be set via `/login`. `CLOUDFLARE_ACCOUNT_ID` must be set as an environment variable.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
export CLOUDFLARE_API_KEY=... # or use /login
|
|
210
|
+
export CLOUDFLARE_ACCOUNT_ID=...
|
|
211
|
+
pi --provider cloudflare-workers-ai --model "@cf/moonshotai/kimi-k2.6"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Pi automatically sets `x-session-affinity` for [prefix caching](https://developers.cloudflare.com/workers-ai/features/prompt-caching/) discounts.
|
|
215
|
+
|
|
171
216
|
### Google Vertex AI
|
|
172
217
|
|
|
173
218
|
Uses Application Default Credentials:
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
This page gets you from install to a useful first pi session.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Pi is distributed as an npm package:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @dyyz1993/pi-coding-agent
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then start pi in the project directory you want it to work on:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cd /path/to/project
|
|
17
|
+
pi
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Authenticate
|
|
21
|
+
|
|
22
|
+
Pi can use subscription providers through `/login`, or API-key providers through environment variables or the auth file.
|
|
23
|
+
|
|
24
|
+
### Option 1: subscription login
|
|
25
|
+
|
|
26
|
+
Start pi and run:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
/login
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then select a provider. Built-in subscription logins include Claude Pro/Max, ChatGPT Plus/Pro (Codex), and GitHub Copilot.
|
|
33
|
+
|
|
34
|
+
### Option 2: API key
|
|
35
|
+
|
|
36
|
+
Set an API key before launching pi:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
40
|
+
pi
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
You can also run `/login` and select an API-key provider to store the key in `~/.pi/agent/auth.json`.
|
|
44
|
+
|
|
45
|
+
See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
|
|
46
|
+
|
|
47
|
+
## First session
|
|
48
|
+
|
|
49
|
+
Once pi starts, type a request and press Enter:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
Summarize this repository and tell me how to run its checks.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
By default, pi gives the model four tools:
|
|
56
|
+
|
|
57
|
+
- `read` - read files
|
|
58
|
+
- `write` - create or overwrite files
|
|
59
|
+
- `edit` - patch files
|
|
60
|
+
- `bash` - run shell commands
|
|
61
|
+
|
|
62
|
+
Additional built-in read-only tools (`grep`, `find`, `ls`) are available through tool options. Pi runs in your current working directory and can modify files there. Use git or another checkpointing workflow if you want easy rollback.
|
|
63
|
+
|
|
64
|
+
## Give pi project instructions
|
|
65
|
+
|
|
66
|
+
Pi loads context files at startup. Add an `AGENTS.md` file to tell it how to work in a project:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
# Project Instructions
|
|
70
|
+
|
|
71
|
+
- Run `npm run check` after code changes.
|
|
72
|
+
- Do not run production migrations locally.
|
|
73
|
+
- Keep responses concise.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Pi loads:
|
|
77
|
+
|
|
78
|
+
- `~/.pi/agent/AGENTS.md` for global instructions
|
|
79
|
+
- `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
|
|
80
|
+
|
|
81
|
+
Restart pi, or run `/reload`, after changing context files.
|
|
82
|
+
|
|
83
|
+
## Common things to try
|
|
84
|
+
|
|
85
|
+
### Reference files
|
|
86
|
+
|
|
87
|
+
Type `@` in the editor to fuzzy-search files, or pass files on the command line:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pi @README.md "Summarize this"
|
|
91
|
+
pi @src/app.ts @src/app.test.ts "Review these together"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Images can be pasted with Ctrl+V (Alt+V on Windows) or dragged into supported terminals.
|
|
95
|
+
|
|
96
|
+
### Run shell commands
|
|
97
|
+
|
|
98
|
+
In interactive mode:
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
!npm run lint
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The command output is sent to the model. Use `!!command` to run a command without adding its output to the model context.
|
|
105
|
+
|
|
106
|
+
### Switch models
|
|
107
|
+
|
|
108
|
+
Use `/model` or Ctrl+L to choose a model. Use Shift+Tab to cycle thinking level. Use Ctrl+P / Shift+Ctrl+P to cycle through scoped models.
|
|
109
|
+
|
|
110
|
+
### Continue later
|
|
111
|
+
|
|
112
|
+
Sessions are saved automatically:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
pi -c # Continue most recent session
|
|
116
|
+
pi -r # Browse previous sessions
|
|
117
|
+
pi --session <path|id> # Open a specific session
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Inside pi, use `/resume`, `/new`, `/tree`, `/fork`, and `/clone` to manage sessions.
|
|
121
|
+
|
|
122
|
+
### Non-interactive mode
|
|
123
|
+
|
|
124
|
+
For one-shot prompts:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
pi -p "Summarize this codebase"
|
|
128
|
+
cat README.md | pi -p "Summarize this text"
|
|
129
|
+
pi -p @screenshot.png "What's in this image?"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Use `--mode json` for JSON event output or `--mode rpc` for process integration.
|
|
133
|
+
|
|
134
|
+
## Next steps
|
|
135
|
+
|
|
136
|
+
- [Using Pi](usage.md) - interactive mode, slash commands, sessions, context files, and CLI reference.
|
|
137
|
+
- [Providers](providers.md) - authentication and model setup.
|
|
138
|
+
- [Settings](settings.md) - global and project configuration.
|
|
139
|
+
- [Keybindings](keybindings.md) - shortcuts and customization.
|
|
140
|
+
- [Pi Packages](packages.md) - install shared extensions, skills, prompts, and themes.
|
|
141
|
+
|
|
142
|
+
Platform notes: [Windows](windows.md), [Termux](termux.md), [tmux](tmux.md), [Terminal setup](terminal-setup.md), [Shell aliases](shell-aliases.md).
|