mu-agent 0.1.0

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 (280) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +21 -0
  3. package/README.md +62 -0
  4. package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +6 -0
  5. package/dist/bundle/chunks/anthropic.js +75 -0
  6. package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +2 -0
  7. package/dist/bundle/chunks/bedrock-converse-stream.js +83 -0
  8. package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
  9. package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
  10. package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
  11. package/dist/bundle/chunks/chunk-7ZC4UXSL.js +2 -0
  12. package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
  13. package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
  14. package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
  15. package/dist/bundle/chunks/chunk-FUXEF6JQ.js +44 -0
  16. package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
  17. package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
  18. package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
  19. package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
  20. package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
  21. package/dist/bundle/chunks/chunk-QB4HYZZE.js +1561 -0
  22. package/dist/bundle/chunks/chunk-RCZIEVGO.js +11 -0
  23. package/dist/bundle/chunks/chunk-S7SZN6Z3.js +2 -0
  24. package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
  25. package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
  26. package/dist/bundle/chunks/chunk-USJZMAIR.js +2 -0
  27. package/dist/bundle/chunks/chunk-WIUZI2CJ.js +11 -0
  28. package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
  29. package/dist/bundle/chunks/chunk-XNGRGP62.js +2 -0
  30. package/dist/bundle/chunks/chunk-Z2DUOAN4.js +2 -0
  31. package/dist/bundle/chunks/github-copilot.js +2 -0
  32. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +2 -0
  33. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +2 -0
  34. package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
  35. package/dist/bundle/chunks/image-resize-worker.js +2 -0
  36. package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
  37. package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
  38. package/dist/bundle/chunks/kimi-coding.js +2 -0
  39. package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
  40. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +5 -0
  41. package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
  42. package/dist/bundle/chunks/node-O3RIBJRH.js +16 -0
  43. package/dist/bundle/chunks/node-TWVVAGPO.js +2 -0
  44. package/dist/bundle/chunks/openai-codex-responses-QDSOTBBO.js +10 -0
  45. package/dist/bundle/chunks/openai-codex.js +75 -0
  46. package/dist/bundle/chunks/openai-completions-KQPOPEVM.js +7 -0
  47. package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +2 -0
  48. package/dist/bundle/chunks/openrouter-images-N4XVVFSD.js +2 -0
  49. package/dist/bundle/chunks/openrouter.js +75 -0
  50. package/dist/bundle/chunks/pi-messages-GFKBWJHZ.js +8 -0
  51. package/dist/bundle/chunks/radius.js +75 -0
  52. package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
  53. package/dist/bundle/chunks/virtual-modules-ROULVYS3.js +2 -0
  54. package/dist/bundle/chunks/xai.js +2 -0
  55. package/dist/bundle/cli.js +3 -0
  56. package/dist/bundle/index.js +2 -0
  57. package/dist/bundle/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
  58. package/dist/bundle/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
  59. package/dist/bundle/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  60. package/dist/bundle/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  61. package/dist/bundle/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  62. package/dist/bundle/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  63. package/dist/bundle/rpc-entry.js +3 -0
  64. package/dist/core/export-html/template.css +1066 -0
  65. package/dist/core/export-html/template.html +55 -0
  66. package/dist/core/export-html/template.js +1864 -0
  67. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  68. package/dist/core/export-html/vendor/marked.min.js +78 -0
  69. package/dist/modes/interactive/assets/clankolas.png +0 -0
  70. package/dist/modes/interactive/theme/dark.json +91 -0
  71. package/dist/modes/interactive/theme/light.json +90 -0
  72. package/dist/modes/interactive/theme/theme-controller.d.ts +41 -0
  73. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -0
  74. package/dist/modes/interactive/theme/theme-controller.js +130 -0
  75. package/dist/modes/interactive/theme/theme-controller.js.map +1 -0
  76. package/dist/modes/interactive/theme/theme-json.d.ts +84 -0
  77. package/dist/modes/interactive/theme/theme-json.d.ts.map +1 -0
  78. package/dist/modes/interactive/theme/theme-json.js +130 -0
  79. package/dist/modes/interactive/theme/theme-json.js.map +1 -0
  80. package/dist/modes/interactive/theme/theme-schema.json +356 -0
  81. package/dist/modes/interactive/theme/theme.d.ts +131 -0
  82. package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  83. package/dist/modes/interactive/theme/theme.js +991 -0
  84. package/dist/modes/interactive/theme/theme.js.map +1 -0
  85. package/dist/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
  86. package/dist/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
  87. package/dist/native/linux/prebuilds/linux-arm64/linux-platform-x11.node +0 -0
  88. package/dist/native/linux/prebuilds/linux-x64/linux-platform-x11.node +0 -0
  89. package/dist/native/win32/prebuilds/win32-arm64/win32-platform.node +0 -0
  90. package/dist/native/win32/prebuilds/win32-x64/win32-platform.node +0 -0
  91. package/docs/compaction.md +444 -0
  92. package/docs/containerization.md +156 -0
  93. package/docs/custom-provider.md +786 -0
  94. package/docs/development.md +90 -0
  95. package/docs/docs.json +160 -0
  96. package/docs/environment-variables.md +100 -0
  97. package/docs/extensions.md +3037 -0
  98. package/docs/images/doom-extension.png +0 -0
  99. package/docs/images/exy.png +0 -0
  100. package/docs/images/interactive-mode.png +0 -0
  101. package/docs/images/tree-view.png +0 -0
  102. package/docs/index.md +84 -0
  103. package/docs/json.md +98 -0
  104. package/docs/keybindings.md +239 -0
  105. package/docs/llama-cpp.md +101 -0
  106. package/docs/models.md +605 -0
  107. package/docs/packages.md +228 -0
  108. package/docs/prompt-templates.md +96 -0
  109. package/docs/providers.md +317 -0
  110. package/docs/quickstart.md +167 -0
  111. package/docs/rpc.md +1618 -0
  112. package/docs/sdk.md +1226 -0
  113. package/docs/security.md +59 -0
  114. package/docs/session-format.md +480 -0
  115. package/docs/sessions.md +172 -0
  116. package/docs/settings.md +428 -0
  117. package/docs/shell-aliases.md +13 -0
  118. package/docs/skills.md +232 -0
  119. package/docs/terminal-setup.md +192 -0
  120. package/docs/termux.md +126 -0
  121. package/docs/themes.md +322 -0
  122. package/docs/tmux.md +63 -0
  123. package/docs/tui.md +961 -0
  124. package/docs/usage.md +312 -0
  125. package/docs/windows.md +39 -0
  126. package/examples/README.md +28 -0
  127. package/examples/extensions/README.md +212 -0
  128. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  129. package/examples/extensions/bash-spawn-hook.ts +30 -0
  130. package/examples/extensions/bookmark.ts +50 -0
  131. package/examples/extensions/border-status-editor.ts +150 -0
  132. package/examples/extensions/built-in-tool-renderer.ts +249 -0
  133. package/examples/extensions/claude-rules.ts +86 -0
  134. package/examples/extensions/commands.ts +72 -0
  135. package/examples/extensions/confirm-destructive.ts +59 -0
  136. package/examples/extensions/custom-compaction.ts +117 -0
  137. package/examples/extensions/custom-footer.ts +64 -0
  138. package/examples/extensions/custom-header.ts +73 -0
  139. package/examples/extensions/custom-provider-anthropic/index.ts +617 -0
  140. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  141. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  142. package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
  143. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  144. package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
  145. package/examples/extensions/dirty-repo-guard.ts +56 -0
  146. package/examples/extensions/doom-overlay/README.md +46 -0
  147. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  148. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  149. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  150. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  151. package/examples/extensions/doom-overlay/doom-component.ts +132 -0
  152. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  153. package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
  154. package/examples/extensions/doom-overlay/index.ts +74 -0
  155. package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
  156. package/examples/extensions/dynamic-resources/SKILL.md +8 -0
  157. package/examples/extensions/dynamic-resources/dynamic.json +81 -0
  158. package/examples/extensions/dynamic-resources/dynamic.md +5 -0
  159. package/examples/extensions/dynamic-resources/index.ts +15 -0
  160. package/examples/extensions/dynamic-tools.ts +74 -0
  161. package/examples/extensions/entry-renderer.ts +41 -0
  162. package/examples/extensions/event-bus.ts +43 -0
  163. package/examples/extensions/file-trigger.ts +41 -0
  164. package/examples/extensions/git-checkpoint.ts +53 -0
  165. package/examples/extensions/git-merge-and-resolve.ts +115 -0
  166. package/examples/extensions/github-issue-autocomplete.ts +185 -0
  167. package/examples/extensions/gondolin/index.ts +531 -0
  168. package/examples/extensions/gondolin/package-lock.json +185 -0
  169. package/examples/extensions/gondolin/package.json +19 -0
  170. package/examples/extensions/handoff.ts +190 -0
  171. package/examples/extensions/hello.ts +26 -0
  172. package/examples/extensions/hidden-thinking-label.ts +53 -0
  173. package/examples/extensions/inline-bash.ts +94 -0
  174. package/examples/extensions/input-transform-streaming.ts +39 -0
  175. package/examples/extensions/input-transform.ts +43 -0
  176. package/examples/extensions/interactive-shell.ts +196 -0
  177. package/examples/extensions/mac-system-theme.ts +47 -0
  178. package/examples/extensions/message-renderer.ts +59 -0
  179. package/examples/extensions/minimal-mode.ts +426 -0
  180. package/examples/extensions/modal-editor.ts +85 -0
  181. package/examples/extensions/model-status.ts +31 -0
  182. package/examples/extensions/notify.ts +57 -0
  183. package/examples/extensions/overlay-qa-tests.ts +1450 -0
  184. package/examples/extensions/overlay-test.ts +153 -0
  185. package/examples/extensions/permission-gate.ts +34 -0
  186. package/examples/extensions/pirate.ts +47 -0
  187. package/examples/extensions/plan-mode/README.md +66 -0
  188. package/examples/extensions/plan-mode/index.ts +390 -0
  189. package/examples/extensions/plan-mode/utils.ts +168 -0
  190. package/examples/extensions/preset.ts +436 -0
  191. package/examples/extensions/project-trust.ts +64 -0
  192. package/examples/extensions/prompt-customizer.ts +49 -0
  193. package/examples/extensions/protected-paths.ts +30 -0
  194. package/examples/extensions/provider-payload.ts +18 -0
  195. package/examples/extensions/qna.ts +118 -0
  196. package/examples/extensions/question.ts +286 -0
  197. package/examples/extensions/questionnaire.ts +448 -0
  198. package/examples/extensions/rainbow-editor.ts +88 -0
  199. package/examples/extensions/reload-runtime.ts +37 -0
  200. package/examples/extensions/rpc-demo.ts +118 -0
  201. package/examples/extensions/sandbox/index.ts +321 -0
  202. package/examples/extensions/sandbox/package-lock.json +92 -0
  203. package/examples/extensions/sandbox/package.json +19 -0
  204. package/examples/extensions/send-user-message.ts +97 -0
  205. package/examples/extensions/session-name.ts +27 -0
  206. package/examples/extensions/shutdown-command.ts +63 -0
  207. package/examples/extensions/snake.ts +343 -0
  208. package/examples/extensions/space-invaders.ts +560 -0
  209. package/examples/extensions/ssh.ts +220 -0
  210. package/examples/extensions/status-line.ts +32 -0
  211. package/examples/extensions/structured-output.ts +65 -0
  212. package/examples/extensions/subagent/README.md +177 -0
  213. package/examples/extensions/subagent/agents/planner.md +37 -0
  214. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  215. package/examples/extensions/subagent/agents/scout.md +50 -0
  216. package/examples/extensions/subagent/agents/worker.md +24 -0
  217. package/examples/extensions/subagent/agents.ts +157 -0
  218. package/examples/extensions/subagent/index.ts +1038 -0
  219. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  220. package/examples/extensions/subagent/prompts/implement.md +10 -0
  221. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  222. package/examples/extensions/summarize.ts +199 -0
  223. package/examples/extensions/system-prompt-header.ts +17 -0
  224. package/examples/extensions/tic-tac-toe.ts +1008 -0
  225. package/examples/extensions/timed-confirm.ts +70 -0
  226. package/examples/extensions/titlebar-spinner.ts +58 -0
  227. package/examples/extensions/todo.ts +297 -0
  228. package/examples/extensions/tool-override.ts +144 -0
  229. package/examples/extensions/tools.ts +146 -0
  230. package/examples/extensions/trigger-compact.ts +50 -0
  231. package/examples/extensions/truncated-tool.ts +195 -0
  232. package/examples/extensions/widget-placement.ts +9 -0
  233. package/examples/extensions/with-deps/index.ts +32 -0
  234. package/examples/extensions/with-deps/package-lock.json +31 -0
  235. package/examples/extensions/with-deps/package.json +22 -0
  236. package/examples/extensions/working-indicator.ts +123 -0
  237. package/examples/extensions/working-message-test.ts +25 -0
  238. package/examples/plugins/pi-example-plugin/README.md +38 -0
  239. package/examples/plugins/pi-example-plugin/package.json +10 -0
  240. package/examples/plugins/pi-example-plugin/src/contract.ts +13 -0
  241. package/examples/plugins/pi-example-plugin/src/session.ts +23 -0
  242. package/examples/plugins/pi-example-plugin/src/tui.ts +31 -0
  243. package/examples/rpc-extension-ui.ts +641 -0
  244. package/examples/sdk/01-minimal.ts +26 -0
  245. package/examples/sdk/02-custom-model.ts +49 -0
  246. package/examples/sdk/03-custom-prompt.ts +75 -0
  247. package/examples/sdk/04-skills.ts +55 -0
  248. package/examples/sdk/05-tools.ts +48 -0
  249. package/examples/sdk/06-extensions.ts +99 -0
  250. package/examples/sdk/07-context-files.ts +47 -0
  251. package/examples/sdk/08-prompt-templates.ts +51 -0
  252. package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
  253. package/examples/sdk/10-settings.ts +53 -0
  254. package/examples/sdk/11-sessions.ts +52 -0
  255. package/examples/sdk/12-full-control.ts +74 -0
  256. package/examples/sdk/13-session-runtime.ts +67 -0
  257. package/examples/sdk/README.md +140 -0
  258. package/judge/THIRD_PARTY_NOTICES.md +35 -0
  259. package/judge/agents/browser.md +17 -0
  260. package/judge/agents/investigator.md +16 -0
  261. package/judge/agents/planner.md +15 -0
  262. package/judge/agents/reviewer.md +17 -0
  263. package/judge/agents/scout.md +19 -0
  264. package/judge/agents/worker.md +15 -0
  265. package/judge/dist/chrome.js +326 -0
  266. package/judge/dist/kyrn-judge.js +52542 -0
  267. package/judge/package.json +6 -0
  268. package/judge/prompts/implement-and-review.md +14 -0
  269. package/judge/prompts/implement.md +15 -0
  270. package/judge/prompts/init.md +18 -0
  271. package/judge/prompts/scout-and-plan.md +12 -0
  272. package/judge/skills/mu-browser/SKILL.md +30 -0
  273. package/judge/skills/mu-github/SKILL.md +90 -0
  274. package/kyrn/bin/kyrn-doctor +202 -0
  275. package/kyrn/bin/kyrn-judge-local +131 -0
  276. package/kyrn/bin/kyrn-ledger +90 -0
  277. package/kyrn/bin/mu.mjs +1120 -0
  278. package/kyrn/local-judge/requirements.lock.txt +26 -0
  279. package/kyrn/local-judge/server.py +332 -0
  280. package/package.json +45 -0
@@ -0,0 +1,172 @@
1
+ # Sessions
2
+
3
+ Pi saves conversations as sessions so you can continue work, branch from earlier turns, and revisit previous paths.
4
+
5
+ ## Session Storage
6
+
7
+ Sessions auto-save to `~/.pi/agent/sessions/`, organized by working directory. Each session is a JSONL file with a tree structure.
8
+
9
+ ```bash
10
+ pi -c # Continue most recent session
11
+ pi -r # Browse and select from past sessions
12
+ pi --no-session # Ephemeral mode; do not save
13
+ pi --name "my task" # Set session display name at startup
14
+ pi --session <path|id> # Use a specific session file or partial session ID
15
+ pi --fork <path|id> # Fork a session file or partial session ID into a new session
16
+ ```
17
+
18
+ Use `/session` in interactive mode to see the current session file, session ID, message count, tokens, and cost.
19
+
20
+ For the JSONL file format and SessionManager API, see [Session Format](session-format.md).
21
+
22
+ ## Session Commands
23
+
24
+ | Command | Description |
25
+ |---------|-------------|
26
+ | `/resume` | Browse and select previous sessions |
27
+ | `/new` | Start a new session |
28
+ | `/name <name>` | Set the current session display name |
29
+ | `/session` | Show session info |
30
+ | `/tree` | Navigate the current session tree |
31
+ | `/fork` | Create a new session from a previous user message |
32
+ | `/clone` | Duplicate the current active branch into a new session |
33
+ | `/compact [prompt]` | Summarize older context; see [Compaction](compaction.md) |
34
+ | `/export [file]` | Export session to HTML |
35
+ | `/share` | Upload as private GitHub gist with shareable HTML link |
36
+ | `/bug [description]` | Report a bug to the Pi developers; see [Reporting Bugs](#reporting-bugs) |
37
+
38
+ ## Resuming and Deleting Sessions
39
+
40
+ `/resume` opens an interactive session picker for the current project. `pi -r` opens the same picker at startup.
41
+
42
+ In the picker you can:
43
+
44
+ - search by typing
45
+ - toggle path display with Ctrl+P
46
+ - toggle sort mode with Ctrl+S
47
+ - filter to named sessions with Ctrl+N
48
+ - rename with Ctrl+R
49
+ - delete with Ctrl+D, then confirm
50
+
51
+ When available, pi uses the `trash` CLI for deletion instead of permanently removing files.
52
+
53
+ ## Naming Sessions
54
+
55
+ Use `/name <name>` to set a human-readable session name:
56
+
57
+ ```text
58
+ /name Refactor auth module
59
+ ```
60
+
61
+ Set the name at startup with `--name` or `-n`:
62
+
63
+ ```bash
64
+ pi --name "Refactor auth module"
65
+ pi --name "CI audit" -p "Review this build failure"
66
+ ```
67
+
68
+ Named sessions are easier to find in `/resume` and `pi -r`.
69
+
70
+ ## Branching with `/tree`
71
+
72
+ Sessions are stored as trees. Every entry has an `id` and `parentId`, and the current position is the active leaf. `/tree` lets you jump to any previous point and continue from there without creating a new file.
73
+
74
+ <p align="center"><img src="images/tree-view.png" alt="Tree View" width="600"></p>
75
+
76
+ Example shape:
77
+
78
+ ```text
79
+ ├─ user: "Hello, can you help..."
80
+ │ └─ assistant: "Of course! I can..."
81
+ │ ├─ user: "Let's try approach A..."
82
+ │ │ └─ assistant: "For approach A..."
83
+ │ │ └─ user: "That worked..." ← active
84
+ │ └─ user: "Actually, approach B..."
85
+ │ └─ assistant: "For approach B..."
86
+ ```
87
+
88
+ ### Tree Controls
89
+
90
+ | Key | Action |
91
+ |-----|--------|
92
+ | ↑/↓ | Navigate visible entries |
93
+ | ←/→ | Page up/down |
94
+ | Ctrl+←/Ctrl+→ or Alt+←/Alt+→ | Fold/unfold or jump between branch segments |
95
+ | Shift+L | Set or clear a label on the selected entry |
96
+ | Shift+T | Toggle label timestamps |
97
+ | Enter | Select entry |
98
+ | Escape/Ctrl+C | Cancel |
99
+ | Ctrl+O | Cycle filter mode |
100
+
101
+ Filter modes are: default, no-tools, user-only, labeled-only, and all. Configure the default with `treeFilterMode` in [Settings](settings.md).
102
+
103
+ ### Selection Behavior
104
+
105
+ Selecting a user or custom message:
106
+
107
+ 1. Moves the leaf to the selected message's parent.
108
+ 2. Places the selected message text in the editor.
109
+ 3. Lets you edit and resubmit, creating a new branch.
110
+
111
+ Selecting an assistant, tool, compaction, or other non-user entry:
112
+
113
+ 1. Moves the leaf to that entry.
114
+ 2. Leaves the editor empty.
115
+ 3. Lets you continue from that point.
116
+
117
+ Selecting the root user message resets the leaf to an empty conversation and places the original prompt in the editor.
118
+
119
+ ## `/tree`, `/fork`, and `/clone`
120
+
121
+ | Feature | `/tree` | `/fork` | `/clone` |
122
+ |---------|---------|---------|----------|
123
+ | Output | Same session file | New session file | New session file |
124
+ | View | Full tree | User-message selector | Current active branch |
125
+ | Typical use | Explore alternatives in place | Start a new session from an earlier prompt | Duplicate current work before continuing |
126
+ | Summary | Optional branch summary | None | None |
127
+
128
+ Use `/tree` when you want to keep alternatives together. Use `/fork` or `/clone` when you want a separate session file.
129
+
130
+ ## Branch Summaries
131
+
132
+ When `/tree` switches away from one branch to another, pi can summarize the abandoned branch and attach that summary at the new position. This preserves important context from the path you left without replaying the whole branch.
133
+
134
+ When prompted, choose one of:
135
+
136
+ 1. no summary
137
+ 2. summarize with the default prompt
138
+ 3. summarize with custom focus instructions
139
+
140
+ See [Compaction](compaction.md) for branch summarization internals and extension hooks.
141
+
142
+ ## Reporting Bugs
143
+
144
+ `/bug [description]` collects a bug report for the Pi developers. The report is not shared publicly. The dialog asks for an optional description and whether to include the session transcript. If you decline the transcript, pi offers to have the current model write a summary of what went wrong instead; the transcript is sent to your provider with your credentials, and only the summary is attached.
145
+
146
+ The last step chooses where the report goes:
147
+
148
+ - **Upload Report** sends it to the Pi developers through `radius.pi.dev`. No login is required; if you are logged into Radius, the report is attributed to your account so the developers can follow up. If the upload fails, pi offers to export the zip instead.
149
+ - **Export as Zip** writes a zip archive to the current directory. Attach it to an issue or send it to the developers yourself.
150
+
151
+ Both contain the same files:
152
+
153
+ | File | Content |
154
+ |------|---------|
155
+ | `report.json` | pi version, runtime, OS, terminal, current model and provider configuration, loaded extensions, and settings. API keys, header values, URL credentials, and the analytics tracking id are never included. |
156
+ | `diagnostics.json` | Provider and runtime error diagnostics attached to assistant messages across the whole session (failed or aborted turns, retries, error messages), plus any recorded crashes. Always included; message content is not. |
157
+ | `session.jsonl` | The current branch of the session, only when you chose to include it. It contains file contents and command output read during the session. |
158
+ | `summary.md` | The model-written summary, only when you chose to generate one. |
159
+
160
+ Each report has a UUID. pi shows it after upload or export and records it in the session as a `pi.bug-report` entry so you can refer to it later.
161
+
162
+ Set `PI_RADIUS_GATEWAY` to upload to a different Radius deployment.
163
+
164
+ ### Crashes
165
+
166
+ When pi exits because of an uncaught exception or a fatal runtime error, it stores the error message and stack trace in `~/.pi/agent/crashes.json` (the newest five). The next interactive start shows a warning once; running `/bug` attaches the stored crashes to `diagnostics.json` and removes the file after the report is uploaded or exported. Resume the crashed session with `pi -r` first if you want the transcript in the report.
167
+
168
+ ## Session Format
169
+
170
+ Session files are JSONL and contain message entries, model changes, thinking-level changes, labels, compactions, branch summaries, and extension entries.
171
+
172
+ For parsers, extensions, SDK usage, and the full SessionManager API, see [Session Format](session-format.md).
@@ -0,0 +1,428 @@
1
+ # Settings
2
+
3
+ Pi uses JSON settings files with project settings overriding global settings.
4
+
5
+ | Location | Scope |
6
+ |----------|-------|
7
+ | `~/.pi/agent/settings.json` | Global (all projects) |
8
+ | `.pi/settings.json` | Project (current directory) |
9
+
10
+ Edit directly or use `/settings` for common options. To save startup model defaults interactively, use `/model` and press Ctrl+S on the desired model. To save the startup thinking level, use `/thinking` and press Ctrl+S.
11
+
12
+ ## Project Trust
13
+
14
+ On interactive startup, pi asks before trusting a project folder that contains project-local settings, resources, or project `.agents/skills` and has no saved decision for the folder or a parent folder in `~/.pi/agent/trust.json`. Trusting a project allows pi to load `.pi/settings.json` and `.pi` resources, install missing project packages, and execute project extensions.
15
+
16
+ Non-interactive modes (`-p`, `--mode json`, and `--mode rpc`) do not show a trust prompt. Without an applicable saved trust decision, they use `defaultProjectTrust` from global settings: `ask` (default) and `never` ignore those project resources, while `always` trusts them. Pass `--approve`/`-a` or `--no-approve`/`-na` to override project trust for one run.
17
+
18
+ If no extension or saved decision applies, `defaultProjectTrust` controls the fallback behavior. Set it to `"ask"`, `"always"`, or `"never"` in `~/.pi/agent/settings.json`, or change it with `/settings`.
19
+
20
+ `pi config` and package commands use the same project trust flow, except `pi update` never prompts. Pass `--approve` to trust project-local settings for one command or `--no-approve` to ignore them.
21
+
22
+ Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.pi/agent/trust.json` only; the current session is not reloaded, so restart pi for changes to take effect.
23
+
24
+ ## All Settings
25
+
26
+ ### Model & Thinking
27
+
28
+ | Setting | Type | Default | Description |
29
+ |---------|------|---------|-------------|
30
+ | `defaultProvider` | string | - | Startup provider (e.g., `"anthropic"`, `"openai"`; saved with Ctrl+S in `/model`, or edited manually) |
31
+ | `defaultModel` | string | - | Startup model ID (saved with Ctrl+S in `/model`, or edited manually) |
32
+ | `defaultThinkingLevel` | string | - | Startup thinking level (saved with Ctrl+S in `/thinking`, or edited manually): `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"` |
33
+ | `modelThinkingLevels` | object | - | Per-model startup thinking levels keyed by `"provider/modelId"`; configure from `/settings` → Default thinking level per model or edit manually |
34
+ | `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
35
+ | `showCacheMissNotices` | boolean | `false` | Show transcript notices for significant prompt-cache misses, successful cache-warming usage, compaction or branch-summary usage, and provider recovery diagnostics such as dropped Anthropic thinking blocks |
36
+ | `thinkingBudgets` | object | - | Custom token budgets per thinking level. Anthropic, Google, and Bedrock use these natively. OpenAI-compatible models use them when `compat.thinkingTokenBudgetField` (or `supportsThinkingTokenBudget`) is set. |
37
+ | `cacheWarming` | string | `"streaming"` | Prompt cache-warming mode: `"off"`, `"streaming"`, or `"idle"`. Global setting only. |
38
+
39
+ #### Cache Warming
40
+
41
+ Providers drop a prompt cache entry after a period of inactivity, so the first request after a pause pays full input price again. Cache warming re-sends the last request with a one-token output budget shortly before expiry:
42
+
43
+ - `"off"` disables warming.
44
+ - `"streaming"` protects expensive prefixes during long tool executions and stops as soon as the agent settles.
45
+ - `"idle"` also considers refreshes while waiting for your next prompt, using a fixed 15% continuation probability measured from real usage.
46
+
47
+ ```json
48
+ {
49
+ "cacheWarming": "idle"
50
+ }
51
+ ```
52
+
53
+ A refresh is sent only when the expected avoided cache-miss cost, minus the cost of the refresh, leaves at least $0.05 of expected savings. Active agent runs use 100% continuation probability. `/session` shows the next decision, continuation probability, expected savings, threshold, and estimated costs. When cache miss notices are enabled, each successful refresh appears in the transcript with its cost; notices identify extension overrides.
54
+
55
+ Warming stops when the context changes (model switch, compaction, branch navigation). Idle warming stops no later than 30 minutes after the last real provider request; warming during an active agent run stops after 60 minutes. Extensions can override each decision through the [`cache_warming_decision`](extensions.md#cache_warming_decision) event.
56
+
57
+ Each refresh is billed as a cache read of the full context plus one output token. Usage and cost show up in session totals but never enter model context. Pi schedules candidates at 90% of the cache lifetime while leaving at least ten seconds before expiry.
58
+
59
+ Warming needs a known cache lifetime for the model and the retention tier the request used (`short`, or `long` with `PI_CACHE_RETENTION=long`). The built-in catalog carries lifetimes for direct Anthropic; custom models and other providers can declare theirs with `promptCache` in `models.json` (see [Prompt Cache Lifetimes](models.md#prompt-cache-lifetimes)). Claude models that use budget-based rather than adaptive thinking are skipped while thinking is on, because Anthropic derives the thinking budget from `max_tokens` and keys the message cache on it, so a one-token request cannot reproduce the entry.
60
+
61
+ #### thinkingBudgets
62
+
63
+ ```json
64
+ {
65
+ "thinkingBudgets": {
66
+ "minimal": 1024,
67
+ "low": 4096,
68
+ "medium": 10240,
69
+ "high": 32768
70
+ }
71
+ }
72
+ ```
73
+
74
+ ### UI & Display
75
+
76
+ | Setting | Type | Default | Description |
77
+ |---------|------|---------|-------------|
78
+ | `theme` | string | `"dark"` | Theme name (`"dark"`, `"light"`, or custom) |
79
+ | `externalEditor` | string | `$VISUAL`, then `$EDITOR`, then Notepad on Windows or `nano` elsewhere | Command for Ctrl+G external editor; takes precedence over environment variables |
80
+ | `quietStartup` | boolean | `false` | Hide startup header |
81
+ | `defaultProjectTrust` | string | `"ask"` | Fallback project trust behavior: `"ask"`, `"always"`, or `"never"`. Global setting only |
82
+ | `collapseChangelog` | boolean | `false` | Show condensed changelog after updates |
83
+ | `enableInstallTelemetry` | boolean | `true` | Send the anonymous install/update ping and selected provider attribution headers. This does not control update checks |
84
+ | `enableAnalytics` | boolean | `false` | Opt-in analytics data sharing. Currently only asked for during the experimental first-time setup (`PI_EXPERIMENTAL=1`) |
85
+ | `trackingId` | string | - | Analytics tracking identifier, generated when `enableAnalytics` is turned on |
86
+ | `doubleEscapeAction` | string | `"tree"` | Action for double-escape: `"tree"`, `"fork"`, or `"none"` |
87
+ | `treeFilterMode` | string | `"default"` | Default filter for `/tree`: `"default"`, `"no-tools"`, `"user-only"`, `"labeled-only"`, `"all"` |
88
+ | `editorPaddingX` | number | `0` | Horizontal padding for input editor (0-3) |
89
+ | `outputPad` | number | `1` | Horizontal padding for user messages, assistant messages, and thinking (0 or 1) |
90
+ | `autocompleteMaxVisible` | number | `5` | Max visible items in autocomplete dropdown (3-20) |
91
+ | `showHardwareCursor` | boolean | `false` | Show the terminal cursor while TUI positions it for IME support |
92
+ | `tuiMode` | string | `"regular"` | Interactive TUI mode: `"regular"` or experimental `"fullscreen"`. Changes from `/settings` apply immediately; `--tui-mode` overrides this setting at startup |
93
+ | `fullscreenExitOutput` | string | `"transcript"` | Fullscreen exit output: `"transcript"` prints the final transcript and resume hint, while `"resume-hint"` restores the previous screen and prints only the resume hint. Has no effect in regular TUI mode |
94
+ | `fullscreenScrollbar` | string | `"auto"` | Fullscreen transcript scrollbar: `"auto"` shows it temporarily while scrolling or while the pointer is over its rightmost-column track, `"always"` reserves that column and keeps it visible, and `"hidden"` hides it. Has no effect in regular TUI mode |
95
+ | `fullscreenCopyOnSelect` | boolean | `true` | Automatically copy selected text in fullscreen mode. When disabled, selections stay highlighted and `Ctrl+X` copies the active selection |
96
+
97
+ For VS Code, include `--wait` so pi resumes after the editor exits:
98
+
99
+ ```json
100
+ {
101
+ "externalEditor": "code --wait"
102
+ }
103
+ ```
104
+
105
+ ### Telemetry and update checks
106
+
107
+ `enableInstallTelemetry` controls the anonymous install/update ping to `https://pi.dev/api/report-install` and Pi attribution headers for OpenRouter, NVIDIA NIM, and Cloudflare provider requests. Opting out disables both. It does not disable update checks; Pi can still fetch `https://pi.dev/api/latest-version` to look for the latest version.
108
+
109
+ Set `PI_SKIP_VERSION_CHECK=1` to disable the Pi version update check. Use `--offline` or `PI_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks, and install/update telemetry.
110
+
111
+ ### Network
112
+
113
+ | Setting | Type | Default | Description |
114
+ |---------|------|---------|-------------|
115
+ | `httpProxy` | string | - | HTTP proxy URL applied as `HTTP_PROXY` and `HTTPS_PROXY`. Global setting only. |
116
+
117
+ ```json
118
+ {
119
+ "httpProxy": "http://127.0.0.1:7890"
120
+ }
121
+ ```
122
+
123
+ ### Warnings
124
+
125
+ | Setting | Type | Default | Description |
126
+ |---------|------|---------|-------------|
127
+ | `warnings.anthropicExtraUsage` | boolean | `true` | Show a warning when Anthropic subscription auth may use paid extra usage |
128
+
129
+ ```json
130
+ {
131
+ "warnings": {
132
+ "anthropicExtraUsage": false
133
+ }
134
+ }
135
+ ```
136
+
137
+ ### Compaction
138
+
139
+ | Setting | Type | Default | Description |
140
+ |---------|------|---------|-------------|
141
+ | `compaction.enabled` | boolean | `true` | Enable auto-compaction |
142
+ | `compaction.reserveTokens` | number | `16384` | Tokens reserved for LLM response |
143
+ | `compaction.keepRecentTokens` | number | `20000` | Recent tokens to keep (not summarized) |
144
+ | `compaction.modelOverrides` | object | - | Per-model `reserveTokens` and `keepRecentTokens` overrides keyed by exact `"provider/modelId"` |
145
+
146
+ ```json
147
+ {
148
+ "compaction": {
149
+ "enabled": true,
150
+ "reserveTokens": 16384,
151
+ "keepRecentTokens": 20000
152
+ }
153
+ }
154
+ ```
155
+
156
+ #### Per-model compaction overrides
157
+
158
+ ```json
159
+ {
160
+ "compaction": {
161
+ "enabled": true,
162
+ "reserveTokens": 16384,
163
+ "keepRecentTokens": 20000,
164
+ "modelOverrides": {
165
+ "some-provider/big-model": {
166
+ "reserveTokens": 400000
167
+ },
168
+ "local/small-model": {
169
+ "reserveTokens": 2048,
170
+ "keepRecentTokens": 4096
171
+ }
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ Keys match exact, case-sensitive `provider/modelId` values, not names or glob patterns. Model IDs may contain slashes (for example, `openrouter/anthropic/claude-sonnet-4`).
178
+
179
+ Each token setting resolves independently: matching model override → ordinary `compaction` setting → built-in default. In the example, `some-provider/big-model` keeps the ordinary 20000 recent tokens. Token values must be non-negative safe integers. Invalid values in the matching model override produce an error when read; only omitted fields fall back to the ordinary setting. Model override entries must be objects. Invalid ordinary token settings produce an error when read, even if the active model has a valid override. Only omitted ordinary values use built-in defaults. Zero is accepted, but `reserveTokens: 0` leaves no response margin and also sets the summarization output budget to zero.
180
+
181
+ Global and project settings merge recursively **before** model lookup. A project can override one field for a model without replacing its other fields or other models. A global model-specific value takes precedence over a project-wide fallback; override the same model entry in the project to change it.
182
+
183
+ `enabled` is not model-specific. The active model's token settings apply to manual compaction, automatic threshold checks (including between assistant turns), and overflow recovery. Switching models takes effect on the next check or compaction. Configure overrides in JSON; `/settings` retains the ordinary auto-compaction toggle.
184
+
185
+ See [compaction.md](compaction.md) for trigger and summarization behavior.
186
+
187
+ ### Branch Summary
188
+
189
+ | Setting | Type | Default | Description |
190
+ |---------|------|---------|-------------|
191
+ | `branchSummary.reserveTokens` | number | `16384` | Tokens reserved when selecting branch history; output is capped at 4096 tokens |
192
+ | `branchSummary.skipPrompt` | boolean | `false` | Skip "Summarize branch?" prompt on `/tree` navigation (defaults to no summary) |
193
+
194
+ ### Retry
195
+
196
+ | Setting | Type | Default | Description |
197
+ |---------|------|---------|-------------|
198
+ | `retry.enabled` | boolean | `true` | Enable automatic agent-level retry on transient errors |
199
+ | `retry.maxRetries` | number | `3` | Maximum agent-level retry attempts |
200
+ | `retry.baseDelayMs` | number | `2000` | Base delay for agent-level exponential backoff (2s, 4s, 8s) |
201
+ | `retry.maxAgentDelayMs` | number | `60000` | Max agent-level retry delay (60s) |
202
+ | `retry.provider.timeoutMs` | number | SDK default | Provider/SDK request timeout in milliseconds |
203
+ | `retry.provider.maxRetries` | number | `0` | Provider/SDK retry attempts |
204
+ | `retry.provider.maxRetryDelayMs` | number | `60000` | Max server-requested delay before failing (60s) |
205
+
206
+ Agent-level retries use exponential backoff capped by `retry.maxAgentDelayMs`, so long retry runs stay responsive after prolonged outages.
207
+
208
+ When a provider requests a retry delay longer than `retry.provider.maxRetryDelayMs`, the request fails immediately with an informative error instead of waiting silently. Set it to `0` to disable the limit.
209
+
210
+ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explicitly needed. Setting it above `0` can make SDK/provider retries handle out-of-usage-limit errors before Pi sees them, which may block the agent until the provider quota resets in some circumstances.
211
+
212
+ ```json
213
+ {
214
+ "retry": {
215
+ "enabled": true,
216
+ "maxRetries": 3,
217
+ "baseDelayMs": 2000,
218
+ "maxAgentDelayMs": 60000,
219
+ "provider": {
220
+ "timeoutMs": 3600000,
221
+ "maxRetries": 0,
222
+ "maxRetryDelayMs": 60000
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ ### Message Delivery
229
+
230
+ | Setting | Type | Default | Description |
231
+ |---------|------|---------|-------------|
232
+ | `steeringMode` | string | `"one-at-a-time"` | How steering messages are sent: `"all"` or `"one-at-a-time"` |
233
+ | `followUpMode` | string | `"one-at-a-time"` | How follow-up messages are sent: `"all"` or `"one-at-a-time"` |
234
+ | `transport` | string | `"auto"` | Preferred transport for providers that support multiple transports: `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` |
235
+ | `httpIdleTimeoutMs` | number | `300000` | HTTP header/body idle timeout in milliseconds, also used by providers with explicit stream idle timeouts. Set to `0` to disable. |
236
+ | `websocketConnectTimeoutMs` | number | `15000` | WebSocket connect/open handshake timeout in milliseconds for providers that support WebSocket transports. Set to `0` to disable. |
237
+
238
+ ### Terminal & Images
239
+
240
+ | Setting | Type | Default | Description |
241
+ |---------|------|---------|-------------|
242
+ | `terminal.showImages` | boolean | `true` | Show images in terminal (if supported) |
243
+ | `terminal.imageWidthCells` | number | `60` | Preferred inline image width in terminal cells |
244
+ | `terminal.clearOnShrink` | boolean | `false` | Clear empty rows when content shrinks (can cause flicker) |
245
+ | `terminal.hyperlinks` | boolean or `"auto"` | `"auto"` | Override OSC 8 hyperlink support (advanced, JSON-only) |
246
+ | `terminal.images` | string or boolean | `"auto"` | Override image protocol support with `"kitty"`, `"iterm2"`, `false`, or `"auto"` (advanced, JSON-only) |
247
+ | `terminal.trueColor` | boolean or `"auto"` | `"auto"` | Override truecolor support (advanced, JSON-only) |
248
+ | `images.autoResize` | boolean | `true` | Resize images to 2000x2000 max. Applies to `@file` attachments, `read`, and images returned by tools |
249
+ | `images.blockImages` | boolean | `false` | Block all images from being sent to LLM |
250
+
251
+ ### Shell
252
+
253
+ | Setting | Type | Default | Description |
254
+ |---------|------|---------|-------------|
255
+ | `shellPath` | string | - | Custom shell path (e.g., for Cygwin on Windows); supports a leading `~` for the home directory |
256
+ | `shellCommandPrefix` | string | - | Prefix for every bash command (e.g., `"shopt -s expand_aliases"`) |
257
+ | `npmCommand` | string[] | - | Command argv used for npm package lookup/install operations (e.g., `["mise", "exec", "node@20", "--", "npm"]`) |
258
+
259
+ Windows paths in JSON must use forward slashes or escaped backslashes:
260
+
261
+ ```json
262
+ {
263
+ "shellPath": "C:/Program Files/Git/bin/bash.exe"
264
+ }
265
+ ```
266
+
267
+ ```json
268
+ {
269
+ "shellPath": "C:\\Program Files\\Git\\bin\\bash.exe"
270
+ }
271
+ ```
272
+
273
+ ```json
274
+ {
275
+ "npmCommand": ["mise", "exec", "node@20", "--", "npm"]
276
+ }
277
+ ```
278
+
279
+ `npmCommand` is used for all npm package-manager operations, including installs, uninstalls, and dependency installs inside git packages. User-scoped npm packages install under `~/.pi/agent/npm/`; project-scoped npm packages install under `.pi/npm/`. Use argv-style entries exactly as the process should be launched. When `npmCommand` is configured, git package dependency installs use plain `install` to avoid npm-specific flags in wrappers or alternate package managers.
280
+
281
+ ### Tools
282
+
283
+ | Setting | Type | Default | Description |
284
+ |---------|------|---------|-------------|
285
+ | `defaultTools` | string[] | - | Built-in tools enabled initially. When omitted, Pi uses its standard defaults |
286
+
287
+ `defaultTools` selects the built-in tools enabled at startup. Extension and SDK custom tools remain enabled. Available built-ins are `read`, `bash`, `powershell`, `edit`, `write`, `grep`, `find`, and `ls`:
288
+
289
+ ```json
290
+ {
291
+ "defaultTools": ["bash", "edit", "write"]
292
+ }
293
+ ```
294
+
295
+ On Windows, select `powershell` instead of `bash`, or include both:
296
+
297
+ ```json
298
+ {
299
+ "defaultTools": ["read", "powershell", "edit", "write"]
300
+ }
301
+ ```
302
+
303
+ An empty array starts with no built-in tools while preserving extension and SDK custom tools. `--tools` replaces this behavior with a strict allowlist for all tools, `--no-tools` disables all tools, and `--no-builtin-tools` disables the built-in defaults. `--exclude-tools` filters the resulting list. A project `defaultTools` array replaces the global array.
304
+
305
+ ### Sessions
306
+
307
+ | Setting | Type | Default | Description |
308
+ |---------|------|---------|-------------|
309
+ | `sessionDir` | string | - | Directory where session files are stored. Accepts absolute or relative paths, plus `~`. |
310
+
311
+ ```json
312
+ { "sessionDir": ".pi/sessions" }
313
+ ```
314
+
315
+ When multiple sources specify a session directory, precedence is `--session-dir`, `PI_CODING_AGENT_SESSION_DIR`, then `sessionDir` in settings.json.
316
+
317
+ ### Model Cycling
318
+
319
+ | Setting | Type | Default | Description |
320
+ |---------|------|---------|-------------|
321
+ | `enabledModels` | string[] | - | Model patterns for Ctrl+P cycling (same format as `--models` CLI flag) |
322
+
323
+ ```json
324
+ {
325
+ "enabledModels": ["claude-*", "gpt-4o", "gemini-2*"]
326
+ }
327
+ ```
328
+
329
+ ### Markdown
330
+
331
+ | Setting | Type | Default | Description |
332
+ |---------|------|---------|-------------|
333
+ | `markdown.codeBlockIndent` | string | `" "` | Indentation for code blocks |
334
+ | `markdown.mermaid` | string | `"streaming"` | Mermaid rendering mode: `"off"`, `"final"`, or `"streaming"` |
335
+
336
+ ### Resources
337
+
338
+ These settings define where to load extensions, skills, prompts, and themes from.
339
+
340
+ Paths in `~/.pi/agent/settings.json` resolve relative to `~/.pi/agent`. Paths in `.pi/settings.json` resolve relative to `.pi`. Absolute paths and `~` are supported.
341
+
342
+ | Setting | Type | Default | Description |
343
+ |---------|------|---------|-------------|
344
+ | `packages` | array | `[]` | npm/git packages to load resources from |
345
+ | `extensions` | string[] | `[]` | Local extension file paths or directories |
346
+ | `skills` | string[] | `[]` | Local skill file paths or directories |
347
+ | `prompts` | string[] | `[]` | Local prompt template paths or directories |
348
+ | `themes` | string[] | `[]` | Local theme file paths or directories |
349
+ | `enableSkillCommands` | boolean | `true` | Register skills as `/skill:name` commands |
350
+
351
+ Arrays support glob patterns and exclusions. Use `!pattern` to exclude. Use `+path` to force-include an exact path and `-path` to force-exclude an exact path.
352
+
353
+ #### packages
354
+
355
+ String form loads all resources from a package:
356
+
357
+ ```json
358
+ {
359
+ "packages": ["pi-skills", "@org/my-extension"]
360
+ }
361
+ ```
362
+
363
+ Object form filters which resources to load:
364
+
365
+ ```json
366
+ {
367
+ "packages": [
368
+ {
369
+ "source": "pi-skills",
370
+ "skills": ["brave-search", "transcribe"],
371
+ "extensions": []
372
+ }
373
+ ]
374
+ }
375
+ ```
376
+
377
+ See [packages.md](packages.md) for package management details.
378
+
379
+ ## Example
380
+
381
+ ```json
382
+ {
383
+ "defaultProvider": "anthropic",
384
+ "defaultModel": "claude-sonnet-4-20250514",
385
+ "defaultThinkingLevel": "medium",
386
+ "modelThinkingLevels": {
387
+ "anthropic/claude-sonnet-4-20250514": "high"
388
+ },
389
+ "theme": "dark",
390
+ "compaction": {
391
+ "enabled": true,
392
+ "reserveTokens": 16384,
393
+ "keepRecentTokens": 20000
394
+ },
395
+ "retry": {
396
+ "enabled": true,
397
+ "maxRetries": 3
398
+ },
399
+ "enabledModels": ["claude-*", "gpt-4o"],
400
+ "warnings": {
401
+ "anthropicExtraUsage": true
402
+ },
403
+ "packages": ["pi-skills"]
404
+ }
405
+ ```
406
+
407
+ ## Project Overrides
408
+
409
+ Project settings (`.pi/settings.json`) override global settings. Nested objects are merged:
410
+
411
+ ```json
412
+ // ~/.pi/agent/settings.json (global)
413
+ {
414
+ "theme": "dark",
415
+ "compaction": { "enabled": true, "reserveTokens": 16384 }
416
+ }
417
+
418
+ // .pi/settings.json (project)
419
+ {
420
+ "compaction": { "reserveTokens": 8192 }
421
+ }
422
+
423
+ // Result
424
+ {
425
+ "theme": "dark",
426
+ "compaction": { "enabled": true, "reserveTokens": 8192 }
427
+ }
428
+ ```
@@ -0,0 +1,13 @@
1
+ # Shell Aliases
2
+
3
+ Pi runs bash in non-interactive mode (`bash -c`), which doesn't expand aliases by default.
4
+
5
+ To enable your shell aliases, add to `~/.pi/agent/settings.json`:
6
+
7
+ ```json
8
+ {
9
+ "shellCommandPrefix": "shopt -s expand_aliases\neval \"$(grep '^alias ' ~/.zshrc)\""
10
+ }
11
+ ```
12
+
13
+ Adjust the path (`~/.zshrc`, `~/.bashrc`, etc.) to match your shell config.