@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +25 -711
  3. package/dist/bundle/chunks/{anthropic-messages-MYU5ZMRF.js → anthropic-messages-J5WXPPPC.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-GV2E3GBU.js → chunk-65HAU2C5.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-4DKZACXI.js → chunk-OJP47DM6.js} +13 -13
  6. package/dist/bundle/chunks/github-copilot.js +1 -1
  7. package/dist/bundle/chunks/{openai-completions-XHML6MTL.js → openai-completions-OBX42CLD.js} +1 -1
  8. package/dist/bundle/chunks/{virtual-modules-BNWPZYDH.js → virtual-modules-VHMJYYWQ.js} +1 -1
  9. package/dist/bundle/cli-runtime.js +1 -1
  10. package/dist/bundle/index.js +1 -1
  11. package/dist/bundle/rpc-entry.js +1 -1
  12. package/dist/cli/args.d.ts.map +1 -1
  13. package/dist/cli/args.js +14 -4
  14. package/dist/cli/args.js.map +1 -1
  15. package/dist/core/compaction/compaction.d.ts.map +1 -1
  16. package/dist/core/compaction/compaction.js +9 -9
  17. package/dist/core/compaction/compaction.js.map +1 -1
  18. package/dist/core/model-resolver.d.ts.map +1 -1
  19. package/dist/core/model-resolver.js +1 -1
  20. package/dist/core/model-resolver.js.map +1 -1
  21. package/docs/cli-integration.md +106 -0
  22. package/docs/cli.md +268 -0
  23. package/docs/compaction.md +22 -22
  24. package/docs/configuration.md +45 -0
  25. package/docs/containerization.md +109 -82
  26. package/docs/custom-provider.md +132 -784
  27. package/docs/docs.json +139 -99
  28. package/docs/environment-variables.md +3 -5
  29. package/docs/extensions.md +134 -3020
  30. package/docs/how-pi-works.md +49 -0
  31. package/docs/images/interactive-mode.png +0 -0
  32. package/docs/index.md +24 -69
  33. package/docs/json.md +193 -65
  34. package/docs/keybindings.md +57 -102
  35. package/docs/llama-cpp.md +3 -3
  36. package/docs/message-types.md +261 -0
  37. package/docs/models.md +55 -565
  38. package/docs/packages.md +66 -167
  39. package/docs/prompt-templates.md +31 -68
  40. package/docs/providers.md +102 -240
  41. package/docs/quickstart.md +61 -106
  42. package/docs/rpc-commands.md +854 -0
  43. package/docs/rpc-extension-ui.md +200 -0
  44. package/docs/rpc.md +129 -1556
  45. package/docs/sdk.md +76 -1171
  46. package/docs/security.md +70 -32
  47. package/docs/session-format.md +10 -214
  48. package/docs/sessions.md +35 -141
  49. package/docs/settings.md +109 -387
  50. package/docs/shell-aliases.md +85 -5
  51. package/docs/skills.md +51 -190
  52. package/docs/slash-commands.md +60 -0
  53. package/docs/terminal-setup.md +105 -78
  54. package/docs/termux.md +74 -83
  55. package/docs/themes.md +68 -280
  56. package/docs/tmux.md +31 -39
  57. package/docs/tui.md +69 -923
  58. package/docs/usage.md +54 -272
  59. package/docs/windows.md +43 -17
  60. package/examples/README.md +13 -2
  61. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  62. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  63. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  64. package/examples/extensions/gondolin/package-lock.json +2 -2
  65. package/examples/extensions/gondolin/package.json +1 -1
  66. package/examples/extensions/sandbox/package-lock.json +2 -2
  67. package/examples/extensions/sandbox/package.json +1 -1
  68. package/examples/extensions/with-deps/package-lock.json +2 -2
  69. package/examples/extensions/with-deps/package.json +1 -1
  70. package/examples/rpc-client.ts +35 -0
  71. package/examples/rpc-extension-ui.ts +25 -5
  72. package/examples/sdk/README.md +1 -1
  73. package/npm-shrinkwrap.json +20 -20
  74. package/package.json +8 -8
  75. package/docs/development.md +0 -90
@@ -1,167 +1,122 @@
1
1
  # Quickstart
2
2
 
3
- This page gets you from install to a useful first pi session.
3
+ Pi runs in your terminal and works with files on your machine. To use it, you need access to a model through a supported provider. This can be a subscription, an API key, or a local model.
4
4
 
5
- ## Install
5
+ For native Windows setup, read [Windows Setup](windows.md). For Android, read [Termux Setup](termux.md).
6
6
 
7
- Pi is distributed as an npm package:
7
+ ## 1. Install Pi
8
+
9
+ On macOS or Linux, you can use the installer:
8
10
 
9
11
  ```bash
10
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent
12
+ curl -fsSL https://pi.dev/install.sh | sh
11
13
  ```
12
14
 
13
- `--ignore-scripts` disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.
14
-
15
- ### Uninstall
16
-
17
- Use the package manager that installed pi. The curl installer uses npm globally, so curl and npm installs are removed with npm:
15
+ Alternatively, install Pi from npm. This requires Node.js 22.19 or newer:
18
16
 
19
17
  ```bash
20
- # curl installer or npm install -g
21
- npm uninstall -g @earendil-works/pi-coding-agent
18
+ npm install -g --ignore-scripts @earendil-works/pi-coding-agent
19
+ ```
22
20
 
23
- # pnpm
24
- pnpm remove -g @earendil-works/pi-coding-agent
21
+ Pi does not require dependency lifecycle scripts for a normal npm installation.
25
22
 
26
- # Yarn
27
- yarn global remove @earendil-works/pi-coding-agent
23
+ Verify the installation:
28
24
 
29
- # Bun
30
- bun uninstall -g @earendil-works/pi-coding-agent
25
+ ```bash
26
+ pi --version
31
27
  ```
32
28
 
33
- Uninstalling pi leaves settings, credentials, sessions, and installed pi packages in `~/.pi/agent/`.
29
+ ## 2. Start Pi
34
30
 
35
- Then start pi in the project directory you want it to work on:
31
+ Change to the folder you want Pi to work with, then start it:
36
32
 
37
33
  ```bash
38
- cd /path/to/project
34
+ cd /path/to/folder
39
35
  pi
40
36
  ```
41
37
 
42
- ## Authenticate
38
+ The working folder helps Pi discover relevant files, instructions, and configuration. Pi also uses it to group saved sessions.
39
+
40
+ <p align="center"><img src="images/interactive-mode.png" alt="Pi running in a terminal with a conversation, input editor, and status footer" width="750"></p>
41
+
42
+ The interface shows your conversation, an editor for prompts and commands, and a footer with the current folder, model, and session status. See [Use Pi in the terminal](usage.md) to learn how to add files, run commands, direct ongoing work, and manage results.
43
43
 
44
- Pi can use subscription providers through `/login`, or API-key providers through environment variables or the auth file.
44
+ ## 3. Choose a model
45
45
 
46
- ### Option 1: subscription login
46
+ A **model** generates Pi's responses. A **provider** is the service or account Pi uses to access that model.
47
47
 
48
- Start pi and run:
48
+ In Pi, run:
49
49
 
50
50
  ```text
51
51
  /login
52
52
  ```
53
53
 
54
- Then select a provider. Built-in subscription logins include Claude Pro/Max, ChatGPT Plus/Pro (Codex), and GitHub Copilot.
54
+ Choose a provider, then follow the prompts to use a subscription or store an API key. Run `/model` afterward if you want to select a different available model.
55
55
 
56
- ### Option 2: API key
56
+ See [Choose a model and provider](models.md) for supported providers, environment-variable authentication, local models, and custom endpoints.
57
57
 
58
- Set an API key before launching pi:
58
+ ## 4. Give Pi a task
59
59
 
60
- ```bash
61
- export ANTHROPIC_API_KEY=sk-ant-...
62
- pi
63
- ```
64
-
65
- You can also run `/login` and select an API-key provider to store the key in `~/.pi/agent/auth.json`.
66
-
67
- See [Providers](providers.md) for all supported providers, environment variables, and cloud-provider setup.
60
+ Pi shows each file read, search, command, and edit it performs. It does not ask before every tool call.
68
61
 
69
- ## First session
70
-
71
- Once pi starts, type a request and press Enter:
62
+ Enter a task that matches your work, for example:
72
63
 
73
64
  ```text
74
- Summarize this repository and tell me how to run its checks.
65
+ Summarize @meeting-notes.md and save the action items to action-items.md.
75
66
  ```
76
67
 
77
- By default, pi gives the model four tools:
78
-
79
- - `read` - read files
80
- - `write` - create or overwrite files
81
- - `edit` - patch files
82
- - `bash` - run shell commands
83
-
84
- 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.
85
-
86
- ## Give pi project instructions
87
-
88
- Pi loads context files at startup. Add an `AGENTS.md` file to tell it how to work in a project:
89
-
90
- ```markdown
91
- # Project Instructions
92
-
93
- - Run `npm run check` after code changes.
94
- - Do not run production migrations locally.
95
- - Keep responses concise.
68
+ ```text
69
+ Explain how this repository is structured and how to run its checks.
96
70
  ```
97
71
 
98
- Pi loads:
99
-
100
- - `~/.pi/agent/AGENTS.md` for global instructions
101
- - `AGENTS.md` or `CLAUDE.md` from parent directories and the current directory
102
-
103
- If a directory contains `AGENTS.override.md`, Pi loads it instead of `AGENTS.md` or `CLAUDE.md` from that directory.
104
-
105
- Restart pi, or run `/reload`, after changing context files.
72
+ ```text
73
+ Compare @previous.csv with @current.csv and summarize the important changes.
74
+ ```
106
75
 
107
- ## Common things to try
76
+ Type `@` in the editor to search for a file instead of entering its full path. When Pi finishes, review its response and any changed files. Use version control or backups for important work. For untrusted or unattended work, use a container or another sandbox. See [Security](security.md).
108
77
 
109
- ### Reference files
78
+ ## Continue later
110
79
 
111
- Type `@` in the editor to fuzzy-search files, or pass files on the command line:
80
+ Pi saves sessions automatically. Exit Pi, then resume the most recent session for the same working folder with:
112
81
 
113
82
  ```bash
114
- pi @README.md "Summarize this"
115
- pi @src/app.ts @src/app.test.ts "Review these together"
83
+ pi --continue
116
84
  ```
117
85
 
118
- Images or text can be pasted with Ctrl+V (Alt+V on Windows); images can also be dragged into supported terminals.
86
+ Use `/resume` to choose another saved session. See [Continue or branch a session](sessions.md) for session naming, branching, compaction, export, and sharing.
119
87
 
120
- ### Run shell commands
88
+ ## Next steps
121
89
 
122
- In interactive mode:
90
+ - [Use Pi interactively](usage.md) to learn input, commands, shortcuts, and queued messages.
91
+ - [Add instructions](configuration.md#context-files) that Pi should follow whenever it works in a folder.
92
+ - [Choose a model and provider](models.md).
123
93
 
124
- ```text
125
- !npm run lint
126
- ```
127
-
128
- The command output is sent to the model. Use `!!command` to run a command without adding its output to the model context.
94
+ ### Choose how to customize Pi
129
95
 
130
- ### Switch models
96
+ Start with the least powerful mechanism that meets your need:
131
97
 
132
- Use `/model` or Ctrl+L to choose a model for the current session. Press Ctrl+S in the model picker to save the highlighted model as the startup default. Use `/thinking` to choose a thinking level for the current session, or Ctrl+S in that picker to save the startup default thinking level. Use Shift+Tab to cycle thinking level. Use Ctrl+P / Shift+Ctrl+P to cycle through scoped models.
98
+ | Need | Start with |
99
+ |---|---|
100
+ | Give Pi persistent instructions for a folder | [`AGENTS.md`](configuration.md#context-files) |
101
+ | Reuse a prompt from the `/` menu | [Prompt template](prompt-templates.md) |
102
+ | Add task-specific instructions and supporting files | [Skill](skills.md) |
103
+ | Add executable tools, commands, or event handlers | [Extension](extensions.md) |
104
+ | Build a custom terminal component | [Terminal UI](tui.md) |
105
+ | Connect an unsupported model service | [Custom provider](custom-provider.md) |
106
+ | Install or distribute several resources | [Pi package](packages.md) |
133
107
 
134
- ### Continue later
108
+ ## Uninstall Pi
135
109
 
136
- Sessions are saved automatically:
110
+ If you installed Pi with npm, run:
137
111
 
138
112
  ```bash
139
- pi -c # Continue most recent session
140
- pi -r # Browse previous sessions
141
- pi --name "my task" # Set session display name at startup
142
- pi --session <path|id> # Open a specific session
113
+ npm uninstall -g @earendil-works/pi-coding-agent
143
114
  ```
144
115
 
145
- Inside pi, use `/resume`, `/new`, `/tree`, `/fork`, and `/clone` to manage sessions.
146
-
147
- ### Non-interactive mode
148
-
149
- For one-shot prompts:
116
+ If you used the installer, run it again and choose **Uninstall Pi**:
150
117
 
151
118
  ```bash
152
- pi -p "Summarize this codebase"
153
- cat README.md | pi -p "Summarize this text"
154
- pi -p @screenshot.png "What's in this image?"
119
+ curl -fsSL https://pi.dev/install.sh | sh
155
120
  ```
156
121
 
157
- Use `--mode json` for JSON event output or `--mode rpc` for process integration.
158
-
159
- ## Next steps
160
-
161
- - [Using Pi](usage.md) - interactive mode, slash commands, sessions, context files, and CLI reference.
162
- - [Providers](providers.md) - authentication and model setup.
163
- - [Settings](settings.md) - global and project configuration.
164
- - [Keybindings](keybindings.md) - shortcuts and customization.
165
- - [Pi Packages](packages.md) - install shared extensions, skills, prompts, and themes.
166
-
167
- Platform notes: [Windows](windows.md), [Termux](termux.md), [tmux](tmux.md), [Terminal setup](terminal-setup.md), [Shell aliases](shell-aliases.md).
122
+ Neither method removes configuration, credentials, sessions, or installed Pi packages from `~/.pi/agent/`.