@openadapter/koda 1.0.0-beta.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/CHANGELOG.md +4448 -0
- package/README.md +665 -0
- package/dist/bun/cli.d.ts +2 -0
- package/dist/bun/cli.js +2 -0
- package/dist/bun/register-bedrock.d.ts +1 -0
- package/dist/bun/register-bedrock.js +1 -0
- package/dist/bun/restore-sandbox-env.d.ts +12 -0
- package/dist/bun/restore-sandbox-env.js +1 -0
- package/dist/cli/args.d.ts +55 -0
- package/dist/cli/args.js +167 -0
- package/dist/cli/config-selector.d.ts +13 -0
- package/dist/cli/config-selector.js +1 -0
- package/dist/cli/file-processor.d.ts +14 -0
- package/dist/cli/file-processor.js +7 -0
- package/dist/cli/import-sessions.d.ts +34 -0
- package/dist/cli/import-sessions.js +6 -0
- package/dist/cli/initial-message.d.ts +17 -0
- package/dist/cli/initial-message.js +1 -0
- package/dist/cli/list-models.d.ts +8 -0
- package/dist/cli/list-models.js +2 -0
- package/dist/cli/openadapter-setup.d.ts +29 -0
- package/dist/cli/openadapter-setup.js +3 -0
- package/dist/cli/session-picker.d.ts +8 -0
- package/dist/cli/session-picker.js +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2 -0
- package/dist/config.d.ts +92 -0
- package/dist/config.js +1 -0
- package/dist/core/agent-session-runtime.d.ts +116 -0
- package/dist/core/agent-session-runtime.js +1 -0
- package/dist/core/agent-session-services.d.ts +86 -0
- package/dist/core/agent-session-services.js +1 -0
- package/dist/core/agent-session.d.ts +747 -0
- package/dist/core/agent-session.js +32 -0
- package/dist/core/auth-guidance.d.ts +4 -0
- package/dist/core/auth-guidance.js +8 -0
- package/dist/core/auth-storage.d.ts +140 -0
- package/dist/core/auth-storage.js +1 -0
- package/dist/core/bash-executor.d.ts +31 -0
- package/dist/core/bash-executor.js +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +89 -0
- package/dist/core/compaction/branch-summarization.js +38 -0
- package/dist/core/compaction/compaction.d.ts +120 -0
- package/dist/core/compaction/compaction.js +104 -0
- package/dist/core/compaction/index.d.ts +6 -0
- package/dist/core/compaction/index.js +1 -0
- package/dist/core/compaction/utils.d.ts +37 -0
- package/dist/core/compaction/utils.js +19 -0
- package/dist/core/defaults.d.ts +2 -0
- package/dist/core/defaults.js +1 -0
- package/dist/core/diagnostics.d.ts +14 -0
- package/dist/core/diagnostics.js +0 -0
- package/dist/core/event-bus.d.ts +8 -0
- package/dist/core/event-bus.js +1 -0
- package/dist/core/exec.d.ts +28 -0
- package/dist/core/exec.js +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +21 -0
- package/dist/core/export-html/ansi-to-html.js +1 -0
- package/dist/core/export-html/index.d.ts +36 -0
- package/dist/core/export-html/index.js +2 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +72 -0
- package/dist/core/export-html/tool-renderer.d.ts +33 -0
- package/dist/core/export-html/tool-renderer.js +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +8 -0
- package/dist/core/export-html/vendor/marked.min.js +56 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.js +1 -0
- package/dist/core/extensions/loader.d.ts +23 -0
- package/dist/core/extensions/loader.js +1 -0
- package/dist/core/extensions/runner.d.ts +160 -0
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/types.d.ts +1180 -0
- package/dist/core/extensions/types.js +1 -0
- package/dist/core/extensions/wrapper.d.ts +19 -0
- package/dist/core/extensions/wrapper.js +1 -0
- package/dist/core/footer-data-provider.d.ts +53 -0
- package/dist/core/footer-data-provider.js +1 -0
- package/dist/core/http-dispatcher.d.ts +20 -0
- package/dist/core/http-dispatcher.js +1 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/index.js +1 -0
- package/dist/core/keybindings.d.ts +352 -0
- package/dist/core/keybindings.js +1 -0
- package/dist/core/messages.d.ts +76 -0
- package/dist/core/messages.js +17 -0
- package/dist/core/model-registry.d.ts +149 -0
- package/dist/core/model-registry.js +9 -0
- package/dist/core/model-resolver.d.ts +109 -0
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/output-guard.d.ts +6 -0
- package/dist/core/output-guard.js +1 -0
- package/dist/core/package-manager.d.ts +203 -0
- package/dist/core/package-manager.js +3 -0
- package/dist/core/prompt-templates.d.ts +51 -0
- package/dist/core/prompt-templates.js +2 -0
- package/dist/core/provider-attribution.d.ts +3 -0
- package/dist/core/provider-attribution.js +1 -0
- package/dist/core/provider-display-names.d.ts +1 -0
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/resolve-config-value.d.ts +30 -0
- package/dist/core/resolve-config-value.js +1 -0
- package/dist/core/resource-loader.d.ts +193 -0
- package/dist/core/resource-loader.js +1 -0
- package/dist/core/sdk.d.ts +108 -0
- package/dist/core/sdk.js +1 -0
- package/dist/core/session-cwd.d.ts +18 -0
- package/dist/core/session-cwd.js +7 -0
- package/dist/core/session-manager.d.ts +331 -0
- package/dist/core/session-manager.js +11 -0
- package/dist/core/settings-manager.d.ts +265 -0
- package/dist/core/settings-manager.js +1 -0
- package/dist/core/skills.d.ts +59 -0
- package/dist/core/skills.js +4 -0
- package/dist/core/slash-commands.d.ts +13 -0
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/source-info.d.ts +17 -0
- package/dist/core/source-info.js +1 -0
- package/dist/core/system-prompt.d.ts +27 -0
- package/dist/core/system-prompt.js +52 -0
- package/dist/core/telemetry.d.ts +2 -0
- package/dist/core/telemetry.js +1 -0
- package/dist/core/timings.d.ts +7 -0
- package/dist/core/timings.js +3 -0
- package/dist/core/tools/bash.d.ts +67 -0
- package/dist/core/tools/bash.js +18 -0
- package/dist/core/tools/edit-diff.d.ts +86 -0
- package/dist/core/tools/edit-diff.js +16 -0
- package/dist/core/tools/edit.d.ts +50 -0
- package/dist/core/tools/edit.js +2 -0
- package/dist/core/tools/file-mutation-queue.d.ts +5 -0
- package/dist/core/tools/file-mutation-queue.js +1 -0
- package/dist/core/tools/find.d.ts +34 -0
- package/dist/core/tools/find.js +13 -0
- package/dist/core/tools/grep.d.ts +36 -0
- package/dist/core/tools/grep.js +13 -0
- package/dist/core/tools/index.d.ts +39 -0
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/ls.d.ts +36 -0
- package/dist/core/tools/ls.js +9 -0
- package/dist/core/tools/output-accumulator.d.ts +51 -0
- package/dist/core/tools/output-accumulator.js +4 -0
- package/dist/core/tools/path-utils.d.ts +9 -0
- package/dist/core/tools/path-utils.js +1 -0
- package/dist/core/tools/read.d.ts +34 -0
- package/dist/core/tools/read.js +22 -0
- package/dist/core/tools/render-utils.d.ts +23 -0
- package/dist/core/tools/render-utils.js +4 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +13 -0
- package/dist/core/tools/tool-definition-wrapper.js +1 -0
- package/dist/core/tools/truncate.d.ts +69 -0
- package/dist/core/tools/truncate.js +5 -0
- package/dist/core/tools/write.d.ts +25 -0
- package/dist/core/tools/write.js +13 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +1 -0
- package/dist/main.d.ts +11 -0
- package/dist/main.js +1 -0
- package/dist/migrations.d.ts +32 -0
- package/dist/migrations.js +8 -0
- package/dist/modes/index.d.ts +8 -0
- package/dist/modes/index.js +1 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +33 -0
- package/dist/modes/interactive/components/armin.js +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +19 -0
- package/dist/modes/interactive/components/assistant-message.js +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +33 -0
- package/dist/modes/interactive/components/bash-execution.js +13 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +15 -0
- package/dist/modes/interactive/components/bordered-loader.js +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +15 -0
- package/dist/modes/interactive/components/branch-summary-message.js +3 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +15 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +3 -0
- package/dist/modes/interactive/components/config-selector.d.ts +70 -0
- package/dist/modes/interactive/components/config-selector.js +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +13 -0
- package/dist/modes/interactive/components/countdown-timer.js +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +20 -0
- package/dist/modes/interactive/components/custom-editor.js +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +19 -0
- package/dist/modes/interactive/components/custom-message.js +2 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +22 -0
- package/dist/modes/interactive/components/daxnuts.js +1 -0
- package/dist/modes/interactive/components/diff.d.ts +11 -0
- package/dist/modes/interactive/components/diff.js +3 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +14 -0
- package/dist/modes/interactive/components/dynamic-border.js +1 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts +4 -0
- package/dist/modes/interactive/components/earendil-announcement.js +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +19 -0
- package/dist/modes/interactive/components/extension-editor.js +3 -0
- package/dist/modes/interactive/components/extension-input.d.ts +22 -0
- package/dist/modes/interactive/components/extension-input.js +2 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +25 -0
- package/dist/modes/interactive/components/extension-selector.js +2 -0
- package/dist/modes/interactive/components/footer.d.ts +27 -0
- package/dist/modes/interactive/components/footer.js +1 -0
- package/dist/modes/interactive/components/index.d.ts +31 -0
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +12 -0
- package/dist/modes/interactive/components/keybinding-hints.js +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +51 -0
- package/dist/modes/interactive/components/login-dialog.js +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +46 -0
- package/dist/modes/interactive/components/model-selector.js +2 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +30 -0
- package/dist/modes/interactive/components/oauth-selector.js +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +41 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +22 -0
- package/dist/modes/interactive/components/session-selector-search.js +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.js +2 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +68 -0
- package/dist/modes/interactive/components/settings-selector.js +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +9 -0
- package/dist/modes/interactive/components/show-images-selector.js +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +16 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +3 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +10 -0
- package/dist/modes/interactive/components/theme-selector.js +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +10 -0
- package/dist/modes/interactive/components/thinking-selector.js +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +62 -0
- package/dist/modes/interactive/components/tool-execution.js +4 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +88 -0
- package/dist/modes/interactive/components/tree-selector.js +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +29 -0
- package/dist/modes/interactive/components/user-message-selector.js +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +9 -0
- package/dist/modes/interactive/components/user-message.js +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +23 -0
- package/dist/modes/interactive/components/visual-truncate.js +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +417 -0
- package/dist/modes/interactive/interactive-mode.js +116 -0
- package/dist/modes/interactive/theme/dark.json +86 -0
- package/dist/modes/interactive/theme/light.json +85 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +101 -0
- package/dist/modes/interactive/theme/theme.js +18 -0
- package/dist/modes/print-mode.d.ts +27 -0
- package/dist/modes/print-mode.js +4 -0
- package/dist/modes/rpc/jsonl.d.ts +16 -0
- package/dist/modes/rpc/jsonl.js +3 -0
- package/dist/modes/rpc/rpc-client.d.ts +226 -0
- package/dist/modes/rpc/rpc-client.js +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +19 -0
- package/dist/modes/rpc/rpc-mode.js +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +419 -0
- package/dist/modes/rpc/rpc-types.js +0 -0
- package/dist/package-manager-cli.d.ts +3 -0
- package/dist/package-manager-cli.js +49 -0
- package/dist/utils/ansi.d.ts +1 -0
- package/dist/utils/ansi.js +1 -0
- package/dist/utils/auto-update.d.ts +13 -0
- package/dist/utils/auto-update.js +1 -0
- package/dist/utils/changelog.d.ts +20 -0
- package/dist/utils/changelog.js +4 -0
- package/dist/utils/child-process.d.ts +14 -0
- package/dist/utils/child-process.js +1 -0
- package/dist/utils/clipboard-image.d.ts +10 -0
- package/dist/utils/clipboard-image.js +1 -0
- package/dist/utils/clipboard-native.d.ts +9 -0
- package/dist/utils/clipboard-native.js +1 -0
- package/dist/utils/clipboard.d.ts +1 -0
- package/dist/utils/clipboard.js +1 -0
- package/dist/utils/deprecation.d.ts +3 -0
- package/dist/utils/deprecation.js +1 -0
- package/dist/utils/exif-orientation.d.ts +4 -0
- package/dist/utils/exif-orientation.js +1 -0
- package/dist/utils/frontmatter.d.ts +7 -0
- package/dist/utils/frontmatter.js +4 -0
- package/dist/utils/fs-watch.d.ts +4 -0
- package/dist/utils/fs-watch.js +1 -0
- package/dist/utils/git.d.ts +25 -0
- package/dist/utils/git.js +1 -0
- package/dist/utils/html.d.ts +6 -0
- package/dist/utils/html.js +1 -0
- package/dist/utils/image-convert.d.ts +8 -0
- package/dist/utils/image-convert.js +1 -0
- package/dist/utils/image-resize-core.d.ts +29 -0
- package/dist/utils/image-resize-core.js +1 -0
- package/dist/utils/image-resize-worker.d.ts +1 -0
- package/dist/utils/image-resize-worker.js +1 -0
- package/dist/utils/image-resize.d.ts +15 -0
- package/dist/utils/image-resize.js +1 -0
- package/dist/utils/json.d.ts +2 -0
- package/dist/utils/json.js +1 -0
- package/dist/utils/koda-user-agent.d.ts +1 -0
- package/dist/utils/koda-user-agent.js +1 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/mime.js +1 -0
- package/dist/utils/paths.d.ts +30 -0
- package/dist/utils/paths.js +1 -0
- package/dist/utils/photon.d.ts +20 -0
- package/dist/utils/photon.js +1 -0
- package/dist/utils/shell.d.ts +29 -0
- package/dist/utils/shell.js +8 -0
- package/dist/utils/sleep.d.ts +4 -0
- package/dist/utils/sleep.js +1 -0
- package/dist/utils/syntax-highlight.d.ts +11 -0
- package/dist/utils/syntax-highlight.js +2 -0
- package/dist/utils/tools-manager.d.ts +2 -0
- package/dist/utils/tools-manager.js +1 -0
- package/dist/utils/version-check.d.ts +14 -0
- package/dist/utils/version-check.js +1 -0
- package/dist/utils/windows-self-update.d.ts +2 -0
- package/dist/utils/windows-self-update.js +1 -0
- package/docs/compaction.md +394 -0
- package/docs/custom-provider.md +736 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +148 -0
- package/docs/extensions.md +2626 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +80 -0
- package/docs/json.md +82 -0
- package/docs/keybindings.md +197 -0
- package/docs/models.md +493 -0
- package/docs/packages.md +226 -0
- package/docs/prompt-templates.md +88 -0
- package/docs/providers.md +253 -0
- package/docs/quickstart.md +165 -0
- package/docs/rpc.md +1408 -0
- package/docs/sdk.md +1137 -0
- package/docs/session-format.md +412 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +281 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +114 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tmux.md +61 -0
- package/docs/tui.md +927 -0
- package/docs/usage.md +288 -0
- package/docs/windows.md +17 -0
- package/npm-shrinkwrap.json +1792 -0
- package/openadapter/extensions/koda-ask.js +12 -0
- package/openadapter/extensions/koda-bg.js +14 -0
- package/openadapter/extensions/koda-commands.mjs +15 -0
- package/openadapter/extensions/koda-help.js +8 -0
- package/openadapter/extensions/koda-memory.js +16 -0
- package/openadapter/extensions/koda-status.js +1 -0
- package/openadapter/extensions/koda-todo.js +4 -0
- package/openadapter/extensions/koda-vision.js +4 -0
- package/openadapter/extensions/koda-web.js +7 -0
- package/openadapter/setup.mjs +173 -0
- package/openadapter/skills/code-review/SKILL.md +22 -0
- package/openadapter/skills/debugging/SKILL.md +28 -0
- package/openadapter/skills/frontend/SKILL.md +38 -0
- package/package.json +108 -0
package/docs/usage.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# Using Pi
|
|
2
|
+
|
|
3
|
+
This page collects day-to-day usage details that do not fit on the quickstart page.
|
|
4
|
+
|
|
5
|
+
## Interactive Mode
|
|
6
|
+
|
|
7
|
+
<p align="center"><img src="images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
|
|
8
|
+
|
|
9
|
+
The interface has four main areas:
|
|
10
|
+
|
|
11
|
+
- **Startup header** - shortcuts, loaded context files, prompt templates, skills, and extensions
|
|
12
|
+
- **Messages** - user messages, assistant responses, tool calls, tool results, notifications, errors, and extension UI
|
|
13
|
+
- **Editor** - where you type; border color indicates the current thinking level
|
|
14
|
+
- **Footer** - working directory, session name, token/cache usage, cost, context usage, and current model
|
|
15
|
+
|
|
16
|
+
The editor can be replaced temporarily by built-in UI such as `/settings` or by custom extension UI.
|
|
17
|
+
|
|
18
|
+
### Editor Features
|
|
19
|
+
|
|
20
|
+
| Feature | How |
|
|
21
|
+
|---------|-----|
|
|
22
|
+
| File reference | Type `@` to fuzzy-search project files |
|
|
23
|
+
| Path completion | Press Tab to complete paths |
|
|
24
|
+
| Multi-line input | Shift+Enter, or Ctrl+Enter on Windows Terminal |
|
|
25
|
+
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
|
|
26
|
+
| Shell command | `!command` runs and sends output to the model |
|
|
27
|
+
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
28
|
+
| External editor | Ctrl+G opens `$VISUAL` or `$EDITOR` |
|
|
29
|
+
|
|
30
|
+
See [Keybindings](keybindings.md) for all shortcuts and customization.
|
|
31
|
+
|
|
32
|
+
## Slash Commands
|
|
33
|
+
|
|
34
|
+
Type `/` in the editor to open command completion. Extensions can register custom commands, skills are available as `/skill:name`, and prompt templates expand via `/templatename`.
|
|
35
|
+
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `/login`, `/logout` | Manage OAuth or API-key credentials |
|
|
39
|
+
| `/model` | Switch models |
|
|
40
|
+
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
41
|
+
| `/settings` | Thinking level, theme, message delivery, transport |
|
|
42
|
+
| `/resume` | Pick from previous sessions |
|
|
43
|
+
| `/new` | Start a new session |
|
|
44
|
+
| `/name <name>` | Set session display name |
|
|
45
|
+
| `/session` | Show session file, ID, messages, tokens, and cost |
|
|
46
|
+
| `/tree` | Jump to any point in the session and continue from there |
|
|
47
|
+
| `/fork` | Create a new session from a previous user message |
|
|
48
|
+
| `/clone` | Duplicate the current active branch into a new session |
|
|
49
|
+
| `/compact [prompt]` | Manually compact context, optionally with custom instructions |
|
|
50
|
+
| `/copy` | Copy last assistant message to clipboard |
|
|
51
|
+
| `/export [file]` | Export session to HTML |
|
|
52
|
+
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
53
|
+
| `/reload` | Reload keybindings, extensions, skills, prompts, and context files |
|
|
54
|
+
| `/hotkeys` | Show all keyboard shortcuts |
|
|
55
|
+
| `/changelog` | Display version history |
|
|
56
|
+
| `/quit` | Quit pi |
|
|
57
|
+
|
|
58
|
+
## Message Queue
|
|
59
|
+
|
|
60
|
+
You can submit messages while the agent is still working:
|
|
61
|
+
|
|
62
|
+
- **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
|
|
63
|
+
- **Alt+Enter** queues a follow-up message, delivered after the agent finishes all work.
|
|
64
|
+
- **Escape** aborts and restores queued messages to the editor.
|
|
65
|
+
- **Alt+Up** retrieves queued messages back to the editor.
|
|
66
|
+
|
|
67
|
+
On Windows Terminal, Alt+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup.md) if you want pi to receive the shortcut.
|
|
68
|
+
|
|
69
|
+
Configure delivery in [Settings](settings.md) with `steeringMode` and `followUpMode`.
|
|
70
|
+
|
|
71
|
+
## Sessions
|
|
72
|
+
|
|
73
|
+
Sessions are saved automatically to `~/.pi/agent/sessions/`, organized by working directory.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pi -c # Continue most recent session
|
|
77
|
+
pi -r # Browse and select a session
|
|
78
|
+
pi --no-session # Ephemeral mode; do not save
|
|
79
|
+
pi --name "my task" # Set session display name at startup
|
|
80
|
+
pi --session <path|id> # Use a specific session file or session ID
|
|
81
|
+
pi --fork <path|id> # Fork a session into a new session file
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Useful session commands:
|
|
85
|
+
|
|
86
|
+
- `/session` shows the current session file and ID.
|
|
87
|
+
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
88
|
+
- `/fork` creates a new session from an earlier user message.
|
|
89
|
+
- `/clone` duplicates the current active branch into a new session file.
|
|
90
|
+
- `/compact` summarizes older messages to free context.
|
|
91
|
+
|
|
92
|
+
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
93
|
+
|
|
94
|
+
## Context Files
|
|
95
|
+
|
|
96
|
+
Pi loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
97
|
+
|
|
98
|
+
- `~/.pi/agent/AGENTS.md` for global instructions
|
|
99
|
+
- parent directories, walking up from the current working directory
|
|
100
|
+
- the current directory
|
|
101
|
+
|
|
102
|
+
Use context files for project conventions, commands, safety rules, and preferences. Disable loading with `--no-context-files` or `-nc`.
|
|
103
|
+
|
|
104
|
+
### System Prompt Files
|
|
105
|
+
|
|
106
|
+
Replace the default system prompt with:
|
|
107
|
+
|
|
108
|
+
- `.pi/SYSTEM.md` for a project
|
|
109
|
+
- `~/.pi/agent/SYSTEM.md` globally
|
|
110
|
+
|
|
111
|
+
Append to the default prompt without replacing it with `APPEND_SYSTEM.md` in either location.
|
|
112
|
+
|
|
113
|
+
## Exporting and Sharing Sessions
|
|
114
|
+
|
|
115
|
+
Use `/export [file]` to write a session to HTML.
|
|
116
|
+
|
|
117
|
+
Use `/share` to upload a private GitHub gist with a shareable HTML link.
|
|
118
|
+
|
|
119
|
+
If you use pi for open source work and want to publish sessions for model, prompt, tool, and evaluation research, see [`badlogic/pi-share-hf`](https://github.com/badlogic/pi-share-hf). It publishes sessions to Hugging Face datasets.
|
|
120
|
+
|
|
121
|
+
## CLI Reference
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pi [options] [@files...] [messages...]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Package Commands
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
pi install <source> [-l] # Install package, -l for project-local
|
|
131
|
+
pi remove <source> [-l] # Remove package
|
|
132
|
+
pi uninstall <source> [-l] # Alias for remove
|
|
133
|
+
pi update [source|self|pi] # Update pi and packages; reconcile pinned git refs
|
|
134
|
+
pi update --extensions # Update packages only; reconcile pinned git refs
|
|
135
|
+
pi update --self # Update pi only
|
|
136
|
+
pi update --extension <src> # Update one package
|
|
137
|
+
pi list # List installed packages
|
|
138
|
+
pi config # Enable/disable package resources
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
These commands manage pi packages, not the pi CLI installation. To uninstall pi itself, see [Quickstart](quickstart.md#uninstall).
|
|
142
|
+
|
|
143
|
+
See [Pi Packages](packages.md) for package sources and security notes.
|
|
144
|
+
|
|
145
|
+
### Modes
|
|
146
|
+
|
|
147
|
+
| Flag | Description |
|
|
148
|
+
|------|-------------|
|
|
149
|
+
| default | Interactive mode |
|
|
150
|
+
| `-p`, `--print` | Print response and exit |
|
|
151
|
+
| `--mode json` | Output all events as JSON lines; see [JSON mode](json.md) |
|
|
152
|
+
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
|
|
153
|
+
| `--export <in> [out]` | Export a session to HTML |
|
|
154
|
+
|
|
155
|
+
In print mode, pi also reads piped stdin and merges it into the initial prompt:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
cat README.md | pi -p "Summarize this text"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Model Options
|
|
162
|
+
|
|
163
|
+
| Option | Description |
|
|
164
|
+
|--------|-------------|
|
|
165
|
+
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
166
|
+
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
167
|
+
| `--api-key <key>` | API key, overriding environment variables |
|
|
168
|
+
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
|
|
169
|
+
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
170
|
+
| `--list-models [search]` | List available models |
|
|
171
|
+
|
|
172
|
+
### Session Options
|
|
173
|
+
|
|
174
|
+
| Option | Description |
|
|
175
|
+
|--------|-------------|
|
|
176
|
+
| `-c`, `--continue` | Continue the most recent session |
|
|
177
|
+
| `-r`, `--resume` | Browse and select a session |
|
|
178
|
+
| `--session <path\|id>` | Use a specific session file or partial UUID |
|
|
179
|
+
| `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
|
|
180
|
+
| `--session-dir <dir>` | Custom session storage directory |
|
|
181
|
+
| `--no-session` | Ephemeral mode; do not save |
|
|
182
|
+
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
183
|
+
|
|
184
|
+
### Tool Options
|
|
185
|
+
|
|
186
|
+
| Option | Description |
|
|
187
|
+
|--------|-------------|
|
|
188
|
+
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
189
|
+
| `--exclude-tools <list>`, `-xt <list>` | Disable specific built-in, extension, and custom tools |
|
|
190
|
+
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
191
|
+
| `--no-tools`, `-nt` | Disable all tools |
|
|
192
|
+
|
|
193
|
+
Built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`.
|
|
194
|
+
|
|
195
|
+
### Resource Options
|
|
196
|
+
|
|
197
|
+
| Option | Description |
|
|
198
|
+
|--------|-------------|
|
|
199
|
+
| `-e`, `--extension <source>` | Load an extension from path, npm, or git; repeatable |
|
|
200
|
+
| `--no-extensions` | Disable extension discovery |
|
|
201
|
+
| `--skill <path>` | Load a skill; repeatable |
|
|
202
|
+
| `--no-skills` | Disable skill discovery |
|
|
203
|
+
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
204
|
+
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
205
|
+
| `--theme <path>` | Load a theme; repeatable |
|
|
206
|
+
| `--no-themes` | Disable theme discovery |
|
|
207
|
+
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `CLAUDE.md` discovery |
|
|
208
|
+
|
|
209
|
+
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
pi --no-extensions -e ./my-extension.ts
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Other Options
|
|
216
|
+
|
|
217
|
+
| Option | Description |
|
|
218
|
+
|--------|-------------|
|
|
219
|
+
| `--system-prompt <text>` | Replace default prompt; context files and skills are still appended |
|
|
220
|
+
| `--append-system-prompt <text>` | Append to system prompt |
|
|
221
|
+
| `--verbose` | Force verbose startup |
|
|
222
|
+
| `-h`, `--help` | Show help |
|
|
223
|
+
| `-v`, `--version` | Show version |
|
|
224
|
+
|
|
225
|
+
### File Arguments
|
|
226
|
+
|
|
227
|
+
Prefix files with `@` to include them in the message:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
pi @prompt.md "Answer this"
|
|
231
|
+
pi -p @screenshot.png "What's in this image?"
|
|
232
|
+
pi @code.ts @test.ts "Review these files"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Examples
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Interactive with initial prompt
|
|
239
|
+
pi "List all .ts files in src/"
|
|
240
|
+
|
|
241
|
+
# Non-interactive
|
|
242
|
+
pi -p "Summarize this codebase"
|
|
243
|
+
|
|
244
|
+
# Non-interactive with piped stdin
|
|
245
|
+
cat README.md | pi -p "Summarize this text"
|
|
246
|
+
|
|
247
|
+
# Named one-shot session
|
|
248
|
+
pi --name "release audit" -p "Audit this repository"
|
|
249
|
+
|
|
250
|
+
# Different model
|
|
251
|
+
pi --provider openai --model gpt-4o "Help me refactor"
|
|
252
|
+
|
|
253
|
+
# Model with provider prefix
|
|
254
|
+
pi --model openai/gpt-4o "Help me refactor"
|
|
255
|
+
|
|
256
|
+
# Model with thinking level shorthand
|
|
257
|
+
pi --model sonnet:high "Solve this complex problem"
|
|
258
|
+
|
|
259
|
+
# Limit model cycling
|
|
260
|
+
pi --models "claude-*,gpt-4o"
|
|
261
|
+
|
|
262
|
+
# Read-only mode
|
|
263
|
+
pi --tools read,grep,find,ls -p "Review the code"
|
|
264
|
+
|
|
265
|
+
# Disable one extension or built-in tool while keeping the rest available
|
|
266
|
+
pi --exclude-tools ask_question
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Environment Variables
|
|
270
|
+
|
|
271
|
+
| Variable | Description |
|
|
272
|
+
|----------|-------------|
|
|
273
|
+
| `PI_CODING_AGENT_DIR` | Override config directory; default is `~/.pi/agent` |
|
|
274
|
+
| `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory; overridden by `--session-dir` |
|
|
275
|
+
| `PI_PACKAGE_DIR` | Override package directory, useful for Nix/Guix store paths |
|
|
276
|
+
| `PI_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
|
|
277
|
+
| `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
|
|
278
|
+
| `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers: `1`/`true`/`yes` or `0`/`false`/`no`. This does not disable update checks |
|
|
279
|
+
| `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache where supported |
|
|
280
|
+
| `VISUAL`, `EDITOR` | External editor for Ctrl+G |
|
|
281
|
+
|
|
282
|
+
## Design Principles
|
|
283
|
+
|
|
284
|
+
Pi keeps the core small and pushes workflow-specific behavior into extensions, skills, prompt templates, and packages.
|
|
285
|
+
|
|
286
|
+
It intentionally does not include built-in MCP, sub-agents, permission popups, plan mode, to-dos, or background bash. You can build or install those workflows as extensions or packages, or use external tools such as containers and tmux.
|
|
287
|
+
|
|
288
|
+
For the full rationale, read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/).
|
package/docs/windows.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Windows Setup
|
|
2
|
+
|
|
3
|
+
Pi requires a bash shell on Windows. Checked locations (in order):
|
|
4
|
+
|
|
5
|
+
1. Custom path from `~/.pi/agent/settings.json`
|
|
6
|
+
2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
|
|
7
|
+
3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
|
|
8
|
+
|
|
9
|
+
For most users, [Git for Windows](https://git-scm.com/download/win) is sufficient.
|
|
10
|
+
|
|
11
|
+
## Custom Shell Path
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"shellPath": "C:\\cygwin64\\bin\\bash.exe"
|
|
16
|
+
}
|
|
17
|
+
```
|