@earendil-works/pi-coding-agent 0.86.1 → 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 +62 -0
- package/README.md +25 -675
- package/dist/bundle/chunks/{anthropic-messages-MYU5ZMRF.js → anthropic-messages-J5WXPPPC.js} +1 -1
- package/dist/bundle/chunks/chunk-65HAU2C5.js +2 -0
- package/dist/bundle/chunks/{chunk-CMRUVXTE.js → chunk-OJP47DM6.js} +48 -42
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{openai-completions-CYGM3XXP.js → openai-completions-OBX42CLD.js} +2 -2
- package/dist/bundle/chunks/{virtual-modules-MGTKWDID.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/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +1 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +27 -3
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +389 -119
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +1 -0
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +15 -1
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +3 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +155 -57
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/crash-log.d.ts +5 -0
- package/dist/core/crash-log.d.ts.map +1 -1
- package/dist/core/crash-log.js +68 -0
- package/dist/core/crash-log.js.map +1 -1
- package/dist/core/export-html/template.js +6 -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/runner.d.ts +16 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +110 -5
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +77 -6
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/model-config.d.ts +52 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +16 -0
- package/dist/core/model-config.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/dist/core/prompt-templates.d.ts +6 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +61 -35
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts +1 -0
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +19 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +6 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +3 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +36 -9
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +97 -7
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/tools/read.d.ts +4 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +5 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -3
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/bug-report.d.ts.map +1 -1
- package/dist/modes/interactive/bug-report.js +4 -0
- package/dist/modes/interactive/bug-report.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +7 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +64 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/mime.d.ts.map +1 -1
- package/dist/utils/mime.js +1 -1
- package/dist/utils/mime.js.map +1 -1
- package/dist/utils/tool-result-images.d.ts +3 -1
- package/dist/utils/tool-result-images.d.ts.map +1 -1
- package/dist/utils/tool-result-images.js +4 -1
- package/dist/utils/tool-result-images.js.map +1 -1
- package/docs/cli-integration.md +106 -0
- package/docs/cli.md +268 -0
- package/docs/compaction.md +45 -26
- 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 -2956
- 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 +64 -546
- 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 -1160
- package/docs/security.md +70 -32
- package/docs/session-format.md +25 -216
- 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/plugins/pi-example-plugin/src/session.ts +3 -2
- 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/dist/bundle/chunks/chunk-HTEQD2HM.js +0 -2
- package/docs/development.md +0 -90
package/docs/terminal-setup.md
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Configure your terminal
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Most modern terminals work with Pi without additional setup. Use this page when modified keys, scrolling, links, images, colors, or input-method editor (IME) positioning do not behave as expected.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Pi uses extended-key protocols so terminals can distinguish combinations such as `Shift+Enter` and `Alt+Enter` from plain `Enter`. Terminal proxies, multiplexers, and built-in IDE terminals can change or discard that information.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Troubleshooting
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
9
|
+
| Symptom | Start here |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `Shift+Enter` submits instead of inserting a line | Your terminal's section below; for tmux, see [Run Pi in tmux](tmux.md) |
|
|
12
|
+
| `Alt+Enter` does not queue a follow-up | [WezTerm](#wezterm), [Alacritty](#alacritty), or [Windows Terminal](#windows-terminal) |
|
|
13
|
+
| Fullscreen scrolling is unusually slow | [iTerm2](#iterm2) |
|
|
14
|
+
| Links work but show no hover preview | [Ghostty](#ghostty) |
|
|
15
|
+
| Inline images or colors are not detected | [Override detected capabilities](#override-detected-capabilities) |
|
|
16
|
+
| An IME candidate window appears in the wrong place | [WezTerm](#wezterm) or [IntelliJ IDEA](#intellij-idea-integrated-terminal) |
|
|
17
|
+
| Modified keys fail only inside tmux | [Run Pi in tmux](tmux.md) |
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
Use `/hotkeys` to inspect Pi's active shortcuts. See [Keybindings](keybindings.md) to change them.
|
|
16
20
|
|
|
17
21
|
## Kitty
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
Kitty supports the required keyboard protocol without additional configuration.
|
|
20
24
|
|
|
21
25
|
## iTerm2
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Works out of the box.
|
|
27
|
+
Regular terminal mode works without additional configuration.
|
|
26
28
|
|
|
27
|
-
###
|
|
29
|
+
### Fix slow fullscreen scrolling
|
|
28
30
|
|
|
29
|
-
Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling
|
|
31
|
+
In fullscreen mode, Pi owns the viewport, so iTerm2 sends mouse-wheel reports instead of scrolling native terminal history. Fast trackpad gestures can then move only about one line at a time.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
To change this behavior:
|
|
32
34
|
|
|
33
|
-
1. Open **iTerm2
|
|
34
|
-
2. Search for **Trackpad scrolls fast
|
|
35
|
+
1. Open **iTerm2 > Settings > Advanced**.
|
|
36
|
+
2. Search for **Trackpad scrolls fast?**.
|
|
37
|
+
3. Set it to **No**.
|
|
35
38
|
|
|
36
|
-
This is an iTerm2-wide
|
|
39
|
+
This is an iTerm2-wide setting and can also change native trackpad scrolling. The underlying behavior is tracked in [iTerm2 issue 9619](https://gitlab.com/gnachman/iterm2/-/work_items/9619).
|
|
37
40
|
|
|
38
41
|
## Apple Terminal
|
|
39
42
|
|
|
40
|
-
Pi enables enhanced key reporting when available. If Terminal.app still sends plain Return for `Shift+Enter`,
|
|
43
|
+
Pi enables enhanced key reporting when available. If Terminal.app still sends plain Return for `Shift+Enter`, Pi uses a local macOS modifier fallback and treats it as `Shift+Enter`.
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
The fallback works only when Pi runs on the same Mac as Terminal.app. It cannot inspect the local modifier state when Pi runs on another machine over SSH.
|
|
43
46
|
|
|
44
47
|
## Ghostty
|
|
45
48
|
|
|
46
|
-
Add to
|
|
49
|
+
Add this mapping to Ghostty's configuration if `Alt+Backspace` does not work:
|
|
47
50
|
|
|
48
|
-
```
|
|
51
|
+
```text
|
|
49
52
|
keybind = alt+backspace=text:\x1b\x7f
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
The configuration file is `~/Library/Application Support/com.mitchellh.ghostty/config` on macOS and `~/.config/ghostty/config` on Linux.
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
Older Claude Code configurations may contain:
|
|
58
|
+
|
|
59
|
+
```text
|
|
55
60
|
keybind = shift+enter=text:\n
|
|
56
61
|
```
|
|
57
62
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
If Claude Code 2.x or newer is the only reason you added that mapping, you can remove it, unless you want to use Claude Code in tmux, where it still requires that Ghostty mapping.
|
|
61
|
-
|
|
62
|
-
Pi binds `Ctrl+J` as a default newline alias, so `Shift+Enter` keeps working in tmux via that remap without extra pi configuration.
|
|
63
|
+
This sends a raw linefeed, which Pi cannot distinguish from `Ctrl+J`. Remove the mapping if an older Claude Code installation is the only reason you added it. Pi already binds `Ctrl+J` as a newline alternative, so the mapping may appear to work while still preventing Pi and tmux from receiving a real `Shift+Enter` event.
|
|
63
64
|
|
|
64
|
-
###
|
|
65
|
+
### Open links in fullscreen mode
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
Links remain clickable in fullscreen mode, but Ghostty does not show its normal hover underline or URL preview while Pi captures mouse input. Hold `Shift+Command` on macOS or `Shift+Ctrl` on Linux to use Ghostty's native link handling.
|
|
67
68
|
|
|
68
69
|
## WezTerm
|
|
69
70
|
|
|
70
|
-
WezTerm
|
|
71
|
+
WezTerm normally reports `Shift+Enter` through xterm extended keys. To enable the Kitty keyboard protocol explicitly, create `~/.wezterm.lua`:
|
|
71
72
|
|
|
72
73
|
```lua
|
|
73
74
|
local wezterm = require 'wezterm'
|
|
@@ -76,7 +77,19 @@ config.enable_kitty_keyboard = true
|
|
|
76
77
|
return config
|
|
77
78
|
```
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
### Forward Alt+Enter on macOS
|
|
81
|
+
|
|
82
|
+
WezTerm binds `Option+Enter` to fullscreen by default on macOS. To use it for Pi's follow-up queue, add this entry to your `config.keys` table:
|
|
83
|
+
|
|
84
|
+
```lua
|
|
85
|
+
{
|
|
86
|
+
key = 'Enter',
|
|
87
|
+
mods = 'ALT',
|
|
88
|
+
action = wezterm.action.SendString('\x1b[13;3u'),
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
A complete minimal configuration is:
|
|
80
93
|
|
|
81
94
|
```lua
|
|
82
95
|
local wezterm = require 'wezterm'
|
|
@@ -91,13 +104,20 @@ config.keys = {
|
|
|
91
104
|
return config
|
|
92
105
|
```
|
|
93
106
|
|
|
94
|
-
|
|
107
|
+
### Position an IME candidate window in WSL
|
|
95
108
|
|
|
96
|
-
|
|
109
|
+
If CJK IME candidates do not follow Pi's text cursor in WSL, show the hardware cursor:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
export PI_HARDWARE_CURSOR=1
|
|
113
|
+
pi
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
You can instead set `showHardwareCursor` to `true` in Pi settings.
|
|
97
117
|
|
|
98
118
|
## Alacritty
|
|
99
119
|
|
|
100
|
-
Alacritty
|
|
120
|
+
Alacritty normally reports `Shift+Enter`. On macOS, `Option+Enter` can arrive as plain `Enter`. Add this to `~/.config/alacritty/alacritty.toml` to forward it to Pi:
|
|
101
121
|
|
|
102
122
|
```toml
|
|
103
123
|
[[keyboard.bindings]]
|
|
@@ -106,20 +126,13 @@ mods = "Alt"
|
|
|
106
126
|
chars = "\u001b[13;3u"
|
|
107
127
|
```
|
|
108
128
|
|
|
109
|
-
Restart Alacritty after changing the
|
|
110
|
-
|
|
111
|
-
## VS Code (Integrated Terminal)
|
|
129
|
+
Restart Alacritty after changing the file.
|
|
112
130
|
|
|
113
|
-
VS Code
|
|
131
|
+
## VS Code integrated terminal
|
|
114
132
|
|
|
115
|
-
VS Code
|
|
133
|
+
VS Code 1.109.5 and newer enable the Kitty keyboard protocol in the integrated terminal by default.
|
|
116
134
|
|
|
117
|
-
`keybindings.json
|
|
118
|
-
- macOS: `~/Library/Application Support/Code/User/keybindings.json`
|
|
119
|
-
- Linux: `~/.config/Code/User/keybindings.json`
|
|
120
|
-
- Windows: `%APPDATA%\\Code\\User\\keybindings.json`
|
|
121
|
-
|
|
122
|
-
Add to `keybindings.json`:
|
|
135
|
+
For an older version, add a `Shift+Enter` terminal binding to `keybindings.json`:
|
|
123
136
|
|
|
124
137
|
```json
|
|
125
138
|
{
|
|
@@ -130,9 +143,15 @@ Add to `keybindings.json`:
|
|
|
130
143
|
}
|
|
131
144
|
```
|
|
132
145
|
|
|
133
|
-
|
|
146
|
+
The user `keybindings.json` file is normally located at:
|
|
147
|
+
|
|
148
|
+
- macOS: `~/Library/Application Support/Code/User/keybindings.json`
|
|
149
|
+
- Linux: `~/.config/Code/User/keybindings.json`
|
|
150
|
+
- Windows: `%APPDATA%\\Code\\User\\keybindings.json`
|
|
134
151
|
|
|
135
|
-
|
|
152
|
+
## Zed integrated terminal
|
|
153
|
+
|
|
154
|
+
Add these bindings to Zed's `keymap.json`:
|
|
136
155
|
|
|
137
156
|
```json
|
|
138
157
|
{
|
|
@@ -147,46 +166,54 @@ Add these key bindings to your Zed `keymap.json`:
|
|
|
147
166
|
|
|
148
167
|
## Windows Terminal
|
|
149
168
|
|
|
150
|
-
|
|
169
|
+
Windows Terminal uses Pi's Windows and WSL shortcut defaults. See [Keybindings](keybindings.md) for the complete list.
|
|
151
170
|
|
|
152
|
-
|
|
153
|
-
- `Ctrl+F` searches the transcript in fullscreen mode, and `Ctrl+Up`/`Ctrl+Down` jump between marked messages.
|
|
154
|
-
- `Alt+P` cycles to the previous model.
|
|
155
|
-
- `Ctrl+Z` undoes editing on native Windows; WSL uses `Alt+Z` so `Ctrl+Z` can suspend pi.
|
|
156
|
-
- `Ctrl+Q` queues a follow-up message and `Alt+Q` restores queued messages.
|
|
171
|
+
### Forward Shift+Enter
|
|
157
172
|
|
|
158
|
-
|
|
173
|
+
Open Windows Terminal's `settings.json` with `Ctrl+Shift+,` or **Settings > Open JSON file**. Add this object to its `actions` array:
|
|
159
174
|
|
|
160
175
|
```json
|
|
161
176
|
{
|
|
162
|
-
"
|
|
163
|
-
|
|
164
|
-
"command": { "action": "sendInput", "input": "\u001b[13;2u" },
|
|
165
|
-
"keys": "shift+enter"
|
|
166
|
-
}
|
|
167
|
-
]
|
|
177
|
+
"command": { "action": "sendInput", "input": "\u001b[13;2u" },
|
|
178
|
+
"keys": "shift+enter"
|
|
168
179
|
}
|
|
169
180
|
```
|
|
170
181
|
|
|
171
|
-
|
|
182
|
+
Fully close and reopen Windows Terminal, then verify that `Shift+Enter` inserts a new line in Pi.
|
|
183
|
+
|
|
184
|
+
### Use Alt+Enter for follow-ups
|
|
172
185
|
|
|
173
|
-
|
|
186
|
+
Windows Terminal binds `Alt+Enter` to fullscreen by default. Pi therefore uses `Ctrl+Q` for follow-ups on Windows and WSL.
|
|
174
187
|
|
|
175
|
-
|
|
188
|
+
To use `Alt+Enter` instead, configure Windows Terminal to forward the key and bind `app.message.followUp` to `alt+enter` in Pi's `keybindings.json`. See [Keybindings](keybindings.md#assign-keybindings).
|
|
176
189
|
|
|
177
|
-
|
|
190
|
+
## xfce4-terminal and Terminator
|
|
178
191
|
|
|
179
|
-
|
|
180
|
-
- [Kitty](https://sw.kovidgoyal.net/kitty/)
|
|
181
|
-
- [Ghostty](https://ghostty.org/)
|
|
182
|
-
- [WezTerm](https://wezfurlong.org/wezterm/)
|
|
183
|
-
- [iTerm2](https://iterm2.com/)
|
|
184
|
-
- [Alacritty](https://github.com/alacritty/alacritty) (requires compilation with Kitty protocol support)
|
|
192
|
+
These terminals cannot reliably distinguish modified Enter keys from plain `Enter`. Custom bindings such as `Ctrl+Enter` or `Shift+Enter` therefore may not work.
|
|
185
193
|
|
|
186
|
-
|
|
194
|
+
Use a terminal with modern extended-key support when you need those shortcuts, such as Kitty, Ghostty, WezTerm, iTerm2, Windows Terminal, or a compatible Alacritty build.
|
|
187
195
|
|
|
188
|
-
|
|
196
|
+
## IntelliJ IDEA integrated terminal
|
|
197
|
+
|
|
198
|
+
IntelliJ IDEA's built-in terminal cannot reliably distinguish `Shift+Enter` from plain `Enter`. Use `Ctrl+J` for a newline or run Pi in a terminal with modern extended-key support.
|
|
199
|
+
|
|
200
|
+
If an IME candidate window does not follow the text cursor, show the hardware cursor:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
export PI_HARDWARE_CURSOR=1
|
|
204
|
+
pi
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Override detected capabilities
|
|
208
|
+
|
|
209
|
+
Pi automatically detects OSC 8 hyperlinks, inline image protocols, and truecolor support. A terminal proxy or multiplexer can make that detection inaccurate.
|
|
210
|
+
|
|
211
|
+
| Capability | Environment variable | Setting |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| Hyperlinks | `PI_HYPERLINKS=1\|0\|auto` | `terminal.hyperlinks: true\|false\|"auto"` |
|
|
214
|
+
| Inline images | `PI_IMAGE_PROTOCOL=kitty\|iterm2\|none\|auto` | `terminal.images: "kitty"\|"iterm2"\|false\|"auto"` |
|
|
215
|
+
| Truecolor | `PI_TRUE_COLOR=1\|0\|auto` | `terminal.trueColor: true\|false\|"auto"` |
|
|
189
216
|
|
|
190
|
-
|
|
217
|
+
Settings take precedence over environment variables. An unset value or `auto` preserves automatic detection.
|
|
191
218
|
|
|
192
|
-
|
|
219
|
+
Only force a capability supported by the complete terminal path. Unsupported escape sequences can corrupt rendering. See [Environment Variables](environment-variables.md#pi-process-configuration) and [Settings](settings.md) for the canonical value definitions.
|
package/docs/termux.md
CHANGED
|
@@ -1,126 +1,117 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Run Pi on Android with Termux
|
|
2
2
|
|
|
3
|
-
Pi runs on Android
|
|
3
|
+
Pi runs on Android through [Termux](https://termux.dev/), a terminal emulator and Linux environment. Text input, file tools, and shell commands are supported. Pi can copy and paste text through the Android clipboard with Termux:API. Clipboard image paste is not supported.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Before you begin
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
2. Install [Termux:API](https://github.com/termux/termux-api#installation) from GitHub or F-Droid for clipboard and other device integrations
|
|
7
|
+
Install Termux from [GitHub or F-Droid](https://github.com/termux/termux-app#installation). Do not use the deprecated Google Play build.
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
[Termux:API](https://github.com/termux/termux-api#installation) is optional. Install it only when you want Pi to copy or paste Android clipboard text, or when shell commands need Android device APIs.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
# Update packages
|
|
14
|
-
pkg update && pkg upgrade
|
|
11
|
+
## Install Pi
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
pkg install nodejs termux-api git
|
|
13
|
+
1. Update Termux packages:
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
```bash
|
|
16
|
+
pkg update && pkg upgrade
|
|
17
|
+
```
|
|
21
18
|
|
|
22
|
-
|
|
23
|
-
mkdir -p ~/.pi/agent
|
|
19
|
+
2. Install Node.js and Git:
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
21
|
+
```bash
|
|
22
|
+
pkg install nodejs git
|
|
23
|
+
```
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
3. Install Pi:
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g --ignore-scripts @earendil-works/pi-coding-agent
|
|
29
|
+
```
|
|
32
30
|
|
|
33
|
-
|
|
31
|
+
4. Verify the installation:
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
```bash
|
|
34
|
+
pi --version
|
|
35
|
+
```
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
5. Open the folder you want to work in and start Pi:
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
```bash
|
|
40
|
+
cd /path/to/working-folder
|
|
41
|
+
pi
|
|
42
|
+
```
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
- **OS**: Android (Termux terminal emulator)
|
|
44
|
-
- **Home**: `/data/data/com.termux/files/home`
|
|
45
|
-
- **Prefix**: `/data/data/com.termux/files/usr`
|
|
46
|
-
- **Shared storage**: `/storage/emulated/0` (Downloads, Documents, etc.)
|
|
44
|
+
Continue with the main [Quickstart](quickstart.md#3-choose-a-model) to connect a model and run your first task.
|
|
47
45
|
|
|
48
|
-
##
|
|
49
|
-
```bash
|
|
50
|
-
termux-open-url "https://example.com"
|
|
51
|
-
```
|
|
46
|
+
## Access Android shared storage
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
termux-open file.pdf # Opens with default app
|
|
56
|
-
termux-open --chooser image.jpg # Choose app
|
|
57
|
-
```
|
|
48
|
+
Termux cannot access shared Android storage until you grant permission. Run this once:
|
|
58
49
|
|
|
59
|
-
## Clipboard
|
|
60
50
|
```bash
|
|
61
|
-
termux-
|
|
62
|
-
termux-clipboard-get # Paste
|
|
51
|
+
termux-setup-storage
|
|
63
52
|
```
|
|
64
53
|
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
termux-notification -t "Title" -c "Content"
|
|
68
|
-
```
|
|
54
|
+
After approval, Android shared storage is available under `/storage/emulated/0` and through the links Termux creates under `~/storage/`.
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
termux-
|
|
75
|
-
```
|
|
56
|
+
Only grant this permission when Pi should be able to access those files. Commands and tools running in Termux use the same storage permissions as the Termux process.
|
|
57
|
+
|
|
58
|
+
## Use clipboard commands
|
|
59
|
+
|
|
60
|
+
Pi uses `termux-clipboard-set` to copy text and `termux-clipboard-get` for its clipboard-paste shortcut. Shell commands can use both commands directly. Install the Termux:API app and its command-line package:
|
|
76
61
|
|
|
77
|
-
## Sharing
|
|
78
62
|
```bash
|
|
79
|
-
termux-
|
|
63
|
+
pkg install termux-api
|
|
80
64
|
```
|
|
81
65
|
|
|
82
|
-
|
|
66
|
+
Verify the integration:
|
|
67
|
+
|
|
83
68
|
```bash
|
|
84
|
-
|
|
85
|
-
termux-
|
|
86
|
-
termux-tts-speak "hello" # Text to speech
|
|
87
|
-
termux-camera-photo out.jpg # Take photo
|
|
69
|
+
printf 'Pi clipboard test' | termux-clipboard-set
|
|
70
|
+
termux-clipboard-get
|
|
88
71
|
```
|
|
89
72
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
73
|
+
The second command should print `Pi clipboard test`.
|
|
74
|
+
|
|
75
|
+
The Termux clipboard API supports text only. Pi's clipboard-paste shortcut inserts that text into the editor but cannot attach clipboard images.
|
|
76
|
+
|
|
77
|
+
## Add Termux-specific instructions
|
|
78
|
+
|
|
79
|
+
Pi detects that it is running in Termux, but it cannot infer how you want it to interact with Android. Add only the environment details relevant to your work to `~/.pi/agent/AGENTS.md`:
|
|
95
80
|
|
|
96
|
-
|
|
81
|
+
````markdown
|
|
82
|
+
# Termux environment
|
|
83
|
+
|
|
84
|
+
- Pi runs in Termux on Android.
|
|
85
|
+
- Shared Android storage is under `/storage/emulated/0`.
|
|
86
|
+
- Open URLs with `termux-open-url "https://example.com"`.
|
|
87
|
+
- Open files with `termux-open <path>`.
|
|
88
|
+
- Do not access shared storage unless the task requires it.
|
|
89
|
+
````
|
|
97
90
|
|
|
98
|
-
|
|
99
|
-
- **Storage access**: To access files in `/storage/emulated/0` (Downloads, etc.), run `termux-setup-storage` once to grant permissions
|
|
91
|
+
Run `/reload` after changing the file during an active session.
|
|
100
92
|
|
|
101
93
|
## Troubleshooting
|
|
102
94
|
|
|
103
|
-
### Clipboard
|
|
95
|
+
### Clipboard integration fails
|
|
104
96
|
|
|
105
|
-
|
|
106
|
-
1. Termux (from GitHub or F-Droid)
|
|
107
|
-
2. Termux:API (from GitHub or F-Droid)
|
|
97
|
+
Confirm that you installed both components:
|
|
108
98
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
pkg install termux-api
|
|
112
|
-
```
|
|
99
|
+
1. The Termux:API Android app from the same source as Termux
|
|
100
|
+
2. The `termux-api` command-line package
|
|
113
101
|
|
|
114
|
-
|
|
102
|
+
Then run the clipboard verification commands above outside Pi. If they fail there, fix the Termux:API installation before retrying Pi's copy command.
|
|
115
103
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
termux-setup-storage
|
|
119
|
-
```
|
|
104
|
+
### Shared storage reports permission denied
|
|
105
|
+
|
|
106
|
+
Run `termux-setup-storage`, approve the Android permission request, and retry the path under `~/storage/` or `/storage/emulated/0`.
|
|
120
107
|
|
|
121
|
-
###
|
|
108
|
+
### Pi is not found after installation
|
|
109
|
+
|
|
110
|
+
Open a new Termux shell and run:
|
|
122
111
|
|
|
123
|
-
If npm fails, try clearing the cache:
|
|
124
112
|
```bash
|
|
125
|
-
npm
|
|
113
|
+
npm prefix -g
|
|
114
|
+
command -v pi
|
|
126
115
|
```
|
|
116
|
+
|
|
117
|
+
Confirm that the global npm binary directory is on `PATH`, then reinstall Pi if the package is missing.
|