@earendil-works/pi-coding-agent 0.87.0 → 0.87.1
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 +24 -0
- package/README.md +25 -711
- package/dist/bundle/chunks/{anthropic-messages-MYU5ZMRF.js → anthropic-messages-J5WXPPPC.js} +1 -1
- package/dist/bundle/chunks/{chunk-GV2E3GBU.js → chunk-65HAU2C5.js} +1 -1
- package/dist/bundle/chunks/{chunk-4DKZACXI.js → chunk-OJP47DM6.js} +13 -13
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{openai-completions-XHML6MTL.js → openai-completions-OBX42CLD.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-BNWPZYDH.js → virtual-modules-VHMJYYWQ.js} +1 -1
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +14 -4
- package/dist/cli/args.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +9 -9
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +268 -0
- package/docs/compaction.md +22 -22
- package/docs/configuration.md +45 -0
- package/docs/containerization.md +109 -82
- package/docs/custom-provider.md +132 -784
- package/docs/docs.json +139 -99
- package/docs/environment-variables.md +3 -5
- package/docs/extensions.md +134 -3020
- package/docs/how-pi-works.md +49 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/index.md +24 -69
- package/docs/json.md +193 -65
- package/docs/keybindings.md +57 -102
- package/docs/llama-cpp.md +3 -3
- package/docs/message-types.md +261 -0
- package/docs/models.md +55 -565
- package/docs/packages.md +66 -167
- package/docs/prompt-templates.md +31 -68
- package/docs/providers.md +102 -240
- package/docs/quickstart.md +61 -106
- package/docs/rpc-commands.md +854 -0
- package/docs/rpc-extension-ui.md +200 -0
- package/docs/rpc.md +129 -1556
- package/docs/sdk.md +76 -1171
- package/docs/security.md +70 -32
- package/docs/session-format.md +10 -214
- package/docs/sessions.md +35 -141
- package/docs/settings.md +109 -387
- package/docs/shell-aliases.md +85 -5
- package/docs/skills.md +51 -190
- package/docs/slash-commands.md +60 -0
- package/docs/terminal-setup.md +105 -78
- package/docs/termux.md +74 -83
- package/docs/themes.md +68 -280
- package/docs/tmux.md +31 -39
- package/docs/tui.md +69 -923
- package/docs/usage.md +54 -272
- package/docs/windows.md +43 -17
- package/examples/README.md +13 -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/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-client.ts +35 -0
- package/examples/rpc-extension-ui.ts +25 -5
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +20 -20
- package/package.json +8 -8
- package/docs/development.md +0 -90
package/docs/usage.md
CHANGED
|
@@ -1,312 +1,94 @@
|
|
|
1
|
-
#
|
|
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. Totals include assistant responses, usage reported by tools, and summary generation.
|
|
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
|
-
| Copy response | Ctrl+X copies the selected message in `/tree`; otherwise it copies the last assistant message, or the active fullscreen text selection when `fullscreenCopyOnSelect` is disabled |
|
|
26
|
-
| Images | Paste with Ctrl+V, Alt+V on Windows, or drag into the terminal |
|
|
27
|
-
| Shell command | `!command` runs and sends output to the model |
|
|
28
|
-
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
29
|
-
| External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
|
|
30
|
-
|
|
31
|
-
See [Keybindings](keybindings.md) for all shortcuts and customization.
|
|
32
|
-
|
|
33
|
-
## Slash Commands
|
|
34
|
-
|
|
35
|
-
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`.
|
|
36
|
-
|
|
37
|
-
| Command | Description |
|
|
38
|
-
|---------|-------------|
|
|
39
|
-
| `/login`, `/logout` | Manage OAuth or API-key credentials |
|
|
40
|
-
| [`/llama`](llama-cpp.md) | Download, load, and unload llama.cpp router models |
|
|
41
|
-
| `/model` | Switch models; Ctrl+S in the picker saves the startup default |
|
|
42
|
-
| `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
|
|
43
|
-
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
|
|
44
|
-
| `/settings` | Theme, message delivery, transport, and other preferences |
|
|
45
|
-
| `/resume` | Pick from previous sessions |
|
|
46
|
-
| `/new` | Start a new session |
|
|
47
|
-
| `/name <name>` | Set session display name |
|
|
48
|
-
| `/session` | Show session file, ID, messages, tokens, and cost |
|
|
49
|
-
| `/tree` | Jump to any point in the session and continue from there |
|
|
50
|
-
| `/trust` | Save project trust decision for future sessions |
|
|
51
|
-
| `/fork` | Create a new session from a previous user message |
|
|
52
|
-
| `/clone` | Duplicate the current active branch into a new session |
|
|
53
|
-
| `/compact [prompt]` | Manually compact context, optionally with custom instructions |
|
|
54
|
-
| `/copy` | Copy last assistant message to clipboard |
|
|
55
|
-
| `/export [file]` | Export session to HTML or JSONL |
|
|
56
|
-
| `/import <file>` | Import and resume a session from a JSONL file |
|
|
57
|
-
| `/share` | Upload as private GitHub gist with shareable HTML link |
|
|
58
|
-
| `/bug [description]` | Report a bug to the Pi developers; see [Sessions](sessions.md#reporting-bugs) |
|
|
59
|
-
| `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
|
|
60
|
-
| `/hotkeys` | Show all keyboard shortcuts |
|
|
61
|
-
| `/changelog` | Display version history |
|
|
62
|
-
| `/quit` | Quit pi |
|
|
63
|
-
|
|
64
|
-
## Message Queue
|
|
65
|
-
|
|
66
|
-
You can submit messages while the agent is still working:
|
|
67
|
-
|
|
68
|
-
- **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
|
|
69
|
-
- **Alt+Enter** queues a follow-up message, delivered after the agent finishes all work.
|
|
70
|
-
- **Escape** aborts and restores queued messages to the editor.
|
|
71
|
-
- **Alt+Up** retrieves queued messages back to the editor.
|
|
72
|
-
|
|
73
|
-
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.
|
|
74
|
-
|
|
75
|
-
Configure delivery in [Settings](settings.md) with `steeringMode` and `followUpMode`.
|
|
76
|
-
|
|
77
|
-
## Sessions
|
|
78
|
-
|
|
79
|
-
Sessions are saved automatically to `~/.pi/agent/sessions/`, organized by working directory.
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
pi -c # Continue most recent session
|
|
83
|
-
pi -r # Browse and select a session
|
|
84
|
-
pi --no-session # Ephemeral mode; do not save
|
|
85
|
-
pi --name "my task" # Set session display name at startup
|
|
86
|
-
pi --session <path|id> # Use a specific session file or session ID
|
|
87
|
-
pi --fork <path|id> # Fork a session into a new session file
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Useful session commands:
|
|
91
|
-
|
|
92
|
-
- `/session` shows the current session file and ID.
|
|
93
|
-
- `/tree` navigates the in-file session tree and can summarize abandoned branches.
|
|
94
|
-
- `/fork` creates a new session from an earlier user message.
|
|
95
|
-
- `/clone` duplicates the current active branch into a new session file.
|
|
96
|
-
- `/compact` summarizes older messages to free context.
|
|
97
|
-
|
|
98
|
-
See [Sessions](sessions.md) and [Compaction](compaction.md) for details.
|
|
99
|
-
|
|
100
|
-
## Context Files
|
|
101
|
-
|
|
102
|
-
Pi loads `AGENTS.md` or `CLAUDE.md` at startup from:
|
|
103
|
-
|
|
104
|
-
- `~/.pi/agent/AGENTS.md` for global instructions
|
|
105
|
-
- parent directories, walking up from the current working directory
|
|
106
|
-
- the current directory
|
|
107
|
-
|
|
108
|
-
If a directory contains `AGENTS.override.md`, Pi loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory. Context files from other directories still layer normally.
|
|
109
|
-
|
|
110
|
-
Use context files for project conventions, commands, safety rules, and preferences. Disable loading with `--no-context-files` or `-nc`.
|
|
111
|
-
|
|
112
|
-
### System Prompt Files
|
|
113
|
-
|
|
114
|
-
Replace the default system prompt with:
|
|
115
|
-
|
|
116
|
-
- `.pi/SYSTEM.md` for a project
|
|
117
|
-
- `~/.pi/agent/SYSTEM.md` globally
|
|
1
|
+
# Use Pi in the terminal
|
|
118
2
|
|
|
119
|
-
|
|
3
|
+
Run `pi` from the folder you want to work in. Pi uses that folder to discover files, instructions, and configuration, and to group saved sessions. If you have not installed Pi or chosen a model yet, follow the [Quickstart](quickstart.md).
|
|
120
4
|
|
|
121
|
-
|
|
5
|
+
Pi may ask whether you trust the working folder before loading its project resources. See [Project trust](security.md#understand-project-trust).
|
|
122
6
|
|
|
123
|
-
|
|
7
|
+
<p align="center"><img src="images/interactive-mode.png" alt="Pi interactive mode showing a conversation, editor, and status information" width="750"></p>
|
|
124
8
|
|
|
125
|
-
|
|
9
|
+
The transcript shows your prompts, Pi's responses, tool calls, results, and errors. You write prompts and commands in the editor. The footer shows the current folder, session, model, context usage, and accumulated usage and cost.
|
|
126
10
|
|
|
127
|
-
|
|
11
|
+
## Enter a prompt
|
|
128
12
|
|
|
129
|
-
|
|
13
|
+
Type a request and press `Enter` to send it. Use `Shift+Enter` to add a line, or press `Ctrl+G` to work on a longer prompt in your configured external editor.
|
|
130
14
|
|
|
131
|
-
|
|
15
|
+
To include files or images:
|
|
132
16
|
|
|
133
|
-
|
|
17
|
+
- Type `@` to search for a file and add it to your prompt.
|
|
18
|
+
- Press `Tab` to complete a path.
|
|
19
|
+
- Paste an image or drag it into a compatible terminal.
|
|
134
20
|
|
|
21
|
+
## Follow Pi's work
|
|
135
22
|
|
|
136
|
-
|
|
23
|
+
Pi shows each tool call and result while it works. Press `Ctrl+O` to expand or collapse tool output. Press `Ctrl+T` to show or hide thinking blocks.
|
|
137
24
|
|
|
138
|
-
|
|
25
|
+
The startup header lists the instructions and resources Pi loaded. The editor border indicates the current thinking level. The footer updates as the model uses context and reports usage.
|
|
139
26
|
|
|
140
|
-
|
|
27
|
+
Pi does not ask before every tool call. Review commands and changed files, and use a sandbox for untrusted or unattended work. See [Security](security.md).
|
|
141
28
|
|
|
142
|
-
|
|
29
|
+
## Change direction
|
|
143
30
|
|
|
144
|
-
|
|
31
|
+
You can send more input while Pi is working:
|
|
145
32
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
pi install <source> [-l] # Install package, -l for project-local
|
|
154
|
-
pi remove <source> [-l] # Remove package
|
|
155
|
-
pi uninstall <source> [-l] # Alias for remove
|
|
156
|
-
pi update [source|self|pi] # Update pi only, or one package source
|
|
157
|
-
pi update --all # Update pi and packages; reconcile pinned git refs
|
|
158
|
-
pi update --extensions # Update packages only; reconcile pinned git refs
|
|
159
|
-
pi update --models # Refresh model catalogs only
|
|
160
|
-
pi update --self # Update pi only
|
|
161
|
-
pi update --extension <src> # Update one package
|
|
162
|
-
pi list # List installed packages
|
|
163
|
-
pi config # Enable/disable package resources
|
|
164
|
-
```
|
|
33
|
+
| What you want | Action |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Adjust the current task | Type a message and press `Enter` |
|
|
36
|
+
| Add work after the current task | Type a message and press `Alt+Enter` |
|
|
37
|
+
| Return queued messages to the editor | Press `Alt+Up` |
|
|
38
|
+
| Stop the current task | Press `Escape` |
|
|
165
39
|
|
|
166
|
-
|
|
40
|
+
A message sent with `Enter` waits until the current response and its tool calls finish, then guides the next response. A follow-up sent with `Alt+Enter` waits until Pi finishes the current task. Aborting returns queued messages to the editor.
|
|
167
41
|
|
|
168
|
-
See [
|
|
42
|
+
Windows Terminal reserves some Alt shortcuts. See [Terminal Setup](terminal-setup.md) for the Windows alternatives.
|
|
169
43
|
|
|
170
|
-
|
|
44
|
+
## Change the model or settings
|
|
171
45
|
|
|
172
|
-
|
|
173
|
-
|------|-------------|
|
|
174
|
-
| default | Interactive mode |
|
|
175
|
-
| `-p`, `--print` | Print response and exit |
|
|
176
|
-
| `--mode json` | Output all events as JSON lines; see [JSON mode](json.md) |
|
|
177
|
-
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc.md) |
|
|
178
|
-
| `--export <in> [out]` | Export a session to HTML |
|
|
46
|
+
Type `/` to search the available commands. The commands you will use most often are:
|
|
179
47
|
|
|
180
|
-
|
|
48
|
+
- `/model` selects a model. Press `Ctrl+L` to open the same selector.
|
|
49
|
+
- `/thinking` selects how much reasoning the current model uses. Press `Shift+Tab` to cycle through supported levels.
|
|
50
|
+
- `/login` and `/logout` manage provider access.
|
|
51
|
+
- `/settings` changes common preferences.
|
|
181
52
|
|
|
182
|
-
|
|
183
|
-
cat README.md | pi -p "Summarize this text"
|
|
184
|
-
```
|
|
53
|
+
Prompt templates, skills, and extensions can add more commands to the same menu. See [Choose a Model](models.md), [Configuration](configuration.md), or the complete [Slash Commands reference](slash-commands.md).
|
|
185
54
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
| Option | Description |
|
|
189
|
-
|--------|-------------|
|
|
190
|
-
| `--provider <name>` | Provider, such as `anthropic`, `openai`, or `google` |
|
|
191
|
-
| `--model <pattern>` | Model pattern or ID; supports `provider/id` and optional `:<thinking>` |
|
|
192
|
-
| `--api-key <key>` | API key, overriding environment variables |
|
|
193
|
-
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
|
|
194
|
-
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
|
|
195
|
-
| `--list-models [search]` | List available models |
|
|
196
|
-
|
|
197
|
-
### Session Options
|
|
198
|
-
|
|
199
|
-
| Option | Description |
|
|
200
|
-
|--------|-------------|
|
|
201
|
-
| `-c`, `--continue` | Continue the most recent session |
|
|
202
|
-
| `-r`, `--resume` | Browse and select a session |
|
|
203
|
-
| `--session <path\|id>` | Use a specific session file or partial UUID |
|
|
204
|
-
| `--fork <path\|id>` | Fork a session file or partial UUID into a new session |
|
|
205
|
-
| `--session-dir <dir>` | Custom session storage directory |
|
|
206
|
-
| `--no-session` | Ephemeral mode; do not save |
|
|
207
|
-
| `--name <name>`, `-n <name>` | Set session display name at startup |
|
|
208
|
-
|
|
209
|
-
### Tool Options
|
|
210
|
-
|
|
211
|
-
| Option | Description |
|
|
212
|
-
|--------|-------------|
|
|
213
|
-
| `--tools <list>`, `-t <list>` | Allowlist specific built-in, extension, and custom tools |
|
|
214
|
-
| `--exclude-tools <list>`, `-xt <list>` | Disable specific built-in, extension, and custom tools |
|
|
215
|
-
| `--no-builtin-tools`, `-nbt` | Disable built-in tools but keep extension/custom tools enabled |
|
|
216
|
-
| `--no-tools`, `-nt` | Disable all tools |
|
|
217
|
-
|
|
218
|
-
Built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`.
|
|
219
|
-
|
|
220
|
-
### Resource Options
|
|
221
|
-
|
|
222
|
-
| Option | Description |
|
|
223
|
-
|--------|-------------|
|
|
224
|
-
| `-e`, `--extension <source>` | Load an extension from path, npm, or git; repeatable |
|
|
225
|
-
| `--no-extensions` | Disable extension discovery |
|
|
226
|
-
| `--skill <path>` | Load a skill; repeatable |
|
|
227
|
-
| `--no-skills` | Disable skill discovery |
|
|
228
|
-
| `--prompt-template <path>` | Load a prompt template; repeatable |
|
|
229
|
-
| `--no-prompt-templates` | Disable prompt template discovery |
|
|
230
|
-
| `--theme <path>` | Load a theme; repeatable |
|
|
231
|
-
| `--no-themes` | Disable theme discovery |
|
|
232
|
-
| `--no-context-files`, `-nc` | Disable `AGENTS.md` and `CLAUDE.md` discovery |
|
|
233
|
-
|
|
234
|
-
Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings. Example:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
pi --no-extensions -e ./my-extension.ts
|
|
238
|
-
```
|
|
55
|
+
## Continue or start over
|
|
239
56
|
|
|
240
|
-
|
|
57
|
+
Pi saves sessions automatically unless session persistence is disabled.
|
|
241
58
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
| `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
|
|
247
|
-
| `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
|
|
248
|
-
| `--verbose` | Force verbose startup |
|
|
249
|
-
| `-a`, `--approve` | Trust project-local files for this run |
|
|
250
|
-
| `-na`, `--no-approve` | Ignore project-local files for this run |
|
|
251
|
-
| `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
|
|
252
|
-
| `-h`, `--help` | Show help |
|
|
253
|
-
| `-v`, `--version` | Show version |
|
|
59
|
+
- `/new` starts a new session.
|
|
60
|
+
- `/resume` opens another saved session.
|
|
61
|
+
- `/name` gives the current session a recognizable name.
|
|
62
|
+
- `/session` shows its file, ID, message count, token usage, and cost.
|
|
254
63
|
|
|
255
|
-
|
|
64
|
+
Use `/tree`, `/fork`, or `/clone` when you want to explore another approach without losing existing work. Use `/compact` to reduce the conversation history sent to the model. See [Sessions and Context](sessions.md) for these workflows.
|
|
256
65
|
|
|
257
|
-
|
|
66
|
+
After leaving Pi, run `pi --continue` from the same folder to resume its most recent session.
|
|
258
67
|
|
|
259
|
-
|
|
68
|
+
## Run a terminal command
|
|
260
69
|
|
|
261
|
-
Prefix
|
|
70
|
+
Prefix a command with `!` to run it and include its output in the conversation:
|
|
262
71
|
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
pi -p @screenshot.png "What's in this image?"
|
|
266
|
-
pi @code.ts @test.ts "Review these files"
|
|
72
|
+
```text
|
|
73
|
+
!git status
|
|
267
74
|
```
|
|
268
75
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
# Interactive with initial prompt
|
|
273
|
-
pi "List all .ts files in src/"
|
|
76
|
+
Use `!!` when you want to run a command without sending its output to the model.
|
|
274
77
|
|
|
275
|
-
|
|
276
|
-
pi -p "Summarize this codebase"
|
|
78
|
+
## Copy, export, or share results
|
|
277
79
|
|
|
278
|
-
|
|
279
|
-
pi -p -- "- Summarize these points"
|
|
80
|
+
Press `Ctrl+X` or run `/copy` to copy the last assistant response. Use `/export` to save the session as HTML or JSONL.
|
|
280
81
|
|
|
281
|
-
|
|
282
|
-
cat README.md | pi -p "Summarize this text"
|
|
82
|
+
Use `/share` to upload the session and get a viewer link. With Radius authentication, the artifact is visible to your Radius organization. Otherwise, Pi creates a private GitHub gist through the GitHub CLI. Review the session first because it can contain prompts, tool output, file contents, and credentials exposed during the conversation.
|
|
283
83
|
|
|
284
|
-
|
|
285
|
-
pi --name "release audit" -p "Audit this repository"
|
|
84
|
+
## Adjust the terminal
|
|
286
85
|
|
|
287
|
-
|
|
288
|
-
pi --provider openai --model gpt-4o "Help me refactor"
|
|
289
|
-
|
|
290
|
-
# Model with provider prefix
|
|
291
|
-
pi --model openai/gpt-4o "Help me refactor"
|
|
292
|
-
|
|
293
|
-
# Model with thinking level shorthand
|
|
294
|
-
pi --model sonnet:high "Solve this complex problem"
|
|
295
|
-
|
|
296
|
-
# Limit model cycling
|
|
297
|
-
pi --models "claude-*,gpt-4o"
|
|
298
|
-
|
|
299
|
-
# Read-only mode
|
|
300
|
-
pi --tools read,grep,find,ls -p "Review the code"
|
|
301
|
-
|
|
302
|
-
# Disable one extension or built-in tool while keeping the rest available
|
|
303
|
-
pi --exclude-tools ask_question
|
|
304
|
-
```
|
|
86
|
+
Regular mode uses the terminal's normal scrollback. Fullscreen mode keeps the editor and status area fixed while the transcript scrolls within the terminal window. Choose a mode through `/settings` or `--tui-mode`.
|
|
305
87
|
|
|
306
|
-
|
|
88
|
+
Terminal support for mouse input, keyboard shortcuts, and inline images varies. See [Terminal Setup](terminal-setup.md) for platform-specific configuration and [Keybindings](keybindings.md) for every configurable shortcut. Run `/hotkeys` to inspect the shortcuts active in your current session.
|
|
307
89
|
|
|
308
|
-
|
|
90
|
+
## Collect diagnostic information
|
|
309
91
|
|
|
310
|
-
|
|
92
|
+
When troubleshooting terminal rendering or conversation state, run `/debug`. Pi writes the rendered terminal lines and current session messages to `pi-debug.log` in your [agent directory](configuration.md#agent-directory).
|
|
311
93
|
|
|
312
|
-
|
|
94
|
+
Review this file before sharing it. It can contain prompts, model responses, tool output, file contents, and terminal data.
|
package/docs/windows.md
CHANGED
|
@@ -1,39 +1,65 @@
|
|
|
1
|
-
# Windows
|
|
1
|
+
# Run Pi on Windows
|
|
2
2
|
|
|
3
|
-
Pi uses Git Bash by default
|
|
3
|
+
Run Pi either as a native Windows process or inside Windows Subsystem for Linux (WSL). Native Windows uses Git Bash by default for Bash commands and can optionally expose PowerShell to the model. Pi inside WSL uses the Linux environment and its Bash installation.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
2. Git Bash (`C:\Program Files\Git\bin\bash.exe`)
|
|
7
|
-
3. `bash.exe` on PATH (Cygwin, MSYS2, WSL)
|
|
5
|
+
Follow the main [Quickstart](quickstart.md) to install and authenticate Pi. Use this page to choose and configure its command environment.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
## Choose native Windows or WSL
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
| Environment | Command environment | Use it when |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Native Windows with Git Bash | Git Bash for the built-in `bash` tool and `!` commands | Your files and development tools primarily live on Windows |
|
|
12
|
+
| Native Windows with the `powershell` tool | PowerShell for model tool calls; Bash remains available for `!` commands | The task depends on PowerShell modules or Windows-native commands |
|
|
13
|
+
| WSL | Linux Bash and tools inside the selected WSL distribution | Your files and toolchain already live in Linux or WSL |
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## Use Git Bash on native Windows
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
For most native Windows users, installing [Git for Windows](https://git-scm.com/download/win) is sufficient.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Pi resolves Bash in this order:
|
|
20
|
+
|
|
21
|
+
1. `shellPath` from `~/.pi/agent/settings.json`
|
|
22
|
+
2. Git Bash under `Program Files` or `Program Files (x86)`
|
|
23
|
+
3. `bash.exe` on `PATH`, including Cygwin, MSYS2, or legacy WSL Bash
|
|
24
|
+
|
|
25
|
+
Start Pi and enter this command to verify the shell:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
!printf 'Bash is working\n'
|
|
21
29
|
```
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
If Pi cannot find Bash, it reports the locations it checked. Install Git for Windows, put another Bash executable on `PATH`, or configure `shellPath`.
|
|
32
|
+
|
|
33
|
+
## Let the model use PowerShell
|
|
34
|
+
|
|
35
|
+
The optional `powershell` tool runs commands through `pwsh.exe` when available, then falls back to Windows PowerShell. It starts PowerShell with `-NoProfile -NonInteractive -ExecutionPolicy Bypass`. Administrator-enforced execution policies can still take precedence.
|
|
36
|
+
|
|
37
|
+
To replace the model-facing `bash` tool with `powershell`, add this to `~/.pi/agent/settings.json`:
|
|
24
38
|
|
|
25
39
|
```json
|
|
26
40
|
{
|
|
27
|
-
"defaultTools": ["read", "
|
|
41
|
+
"defaultTools": ["read", "powershell", "edit", "write"]
|
|
28
42
|
}
|
|
29
43
|
```
|
|
30
44
|
|
|
31
|
-
The `!` and `!!` editor commands
|
|
45
|
+
Restart Pi, then ask it to run a harmless PowerShell command. The `!` and `!!` editor commands continue to use Bash. The `powershell` tool is available only when Pi runs as a native Windows process.
|
|
46
|
+
|
|
47
|
+
See [Settings](settings.md#tools) for other tool combinations.
|
|
48
|
+
|
|
49
|
+
## Use a custom Bash executable
|
|
32
50
|
|
|
33
|
-
|
|
51
|
+
Set `shellPath` when Bash is installed somewhere Pi does not discover automatically:
|
|
34
52
|
|
|
35
53
|
```json
|
|
36
54
|
{
|
|
37
55
|
"shellPath": "C:\\cygwin64\\bin\\bash.exe"
|
|
38
56
|
}
|
|
39
57
|
```
|
|
58
|
+
|
|
59
|
+
JSON uses backslashes for escape sequences. When you write a Windows path with backslashes, write each backslash twice, as shown above.
|
|
60
|
+
|
|
61
|
+
See [Configure shell commands](shell-aliases.md) for command prefixes, aliases, and the complete shell-resolution behavior.
|
|
62
|
+
|
|
63
|
+
## Configure Windows Terminal
|
|
64
|
+
|
|
65
|
+
Windows Terminal reserves or rewrites some modified keys. See [Windows Terminal](terminal-setup.md#windows-terminal) to configure `Shift+Enter` and `Alt+Enter`, and [Keybindings](keybindings.md) for Pi's Windows and WSL shortcut defaults.
|
package/examples/README.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Examples
|
|
2
2
|
|
|
3
|
-
Example code for pi-coding-agent SDK and extensions.
|
|
3
|
+
Example code for the pi-coding-agent SDK, process integration, and extensions.
|
|
4
|
+
|
|
5
|
+
## CLI integration
|
|
6
|
+
|
|
7
|
+
[`rpc-client.ts`](rpc-client.ts) uses the typed `RpcClient` to run Pi in a child process, stream events, and wait for the run to settle.
|
|
8
|
+
|
|
9
|
+
Build the coding-agent package before running it from a repository checkout:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx tsx examples/rpc-client.ts "Explain this repository"
|
|
13
|
+
```
|
|
4
14
|
|
|
5
15
|
## Directories
|
|
6
16
|
|
|
@@ -23,6 +33,7 @@ An experimental plugin package that Pi automatically builds into separate Sessio
|
|
|
23
33
|
|
|
24
34
|
## Documentation
|
|
25
35
|
|
|
26
|
-
- [SDK
|
|
36
|
+
- [SDK Examples](sdk/README.md)
|
|
37
|
+
- [CLI Integration](../docs/cli-integration.md)
|
|
27
38
|
- [Extensions Documentation](../docs/extensions.md)
|
|
28
39
|
- [Skills Documentation](../docs/skills.md)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.87.
|
|
9
|
+
"version": "0.87.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-gondolin",
|
|
9
|
-
"version": "0.87.
|
|
9
|
+
"version": "0.87.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "1.17.
|
|
9
|
+
"version": "1.17.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.87.
|
|
9
|
+
"version": "0.87.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run one prompt through a Pi RPC child process.
|
|
3
|
+
*
|
|
4
|
+
* Build the coding-agent package first, then run:
|
|
5
|
+
* npx tsx examples/rpc-client.ts "Explain this repository"
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { RpcClient } from "@earendil-works/pi-coding-agent";
|
|
11
|
+
|
|
12
|
+
const exampleDirectory = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const prompt = process.argv.slice(2).join(" ") || "Explain this repository in one paragraph.";
|
|
14
|
+
|
|
15
|
+
const client = new RpcClient({
|
|
16
|
+
cliPath: join(exampleDirectory, "../dist/cli.js"),
|
|
17
|
+
args: ["--no-session"],
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const unsubscribe = client.onEvent((event) => {
|
|
21
|
+
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
|
|
22
|
+
process.stdout.write(event.assistantMessageEvent.delta);
|
|
23
|
+
} else if (event.type === "tool_execution_start") {
|
|
24
|
+
process.stderr.write(`\n[tool: ${event.toolName}]\n`);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
await client.start();
|
|
30
|
+
await client.promptAndWait(prompt);
|
|
31
|
+
process.stdout.write("\n");
|
|
32
|
+
} finally {
|
|
33
|
+
unsubscribe();
|
|
34
|
+
await client.stop();
|
|
35
|
+
}
|