pi-namespace-patch 0.85.1 → 0.86.0-namespace.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 (317) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +26 -705
  3. package/dist/bundle/chunks/anthropic-messages-MYU5ZMRF.js +6 -0
  4. package/dist/bundle/chunks/azure-openai-responses-HUSQ3GP2.js +2 -0
  5. package/dist/bundle/chunks/bedrock-converse-stream.js +47 -38
  6. package/dist/bundle/chunks/chunk-A3JYRWB6.js +2 -0
  7. package/dist/bundle/chunks/chunk-DTD7JQ7Y.js +42 -0
  8. package/dist/bundle/chunks/chunk-FUXEF6JQ.js +44 -0
  9. package/dist/bundle/chunks/chunk-IS2VY2NY.js +1561 -0
  10. package/dist/bundle/chunks/{chunk-IDDQWTHI.js → chunk-RCZIEVGO.js} +10 -1
  11. package/dist/bundle/chunks/chunk-S7SZN6Z3.js +2 -0
  12. package/dist/bundle/chunks/chunk-SXW7XMQG.js +2 -0
  13. package/dist/bundle/chunks/chunk-WIUZI2CJ.js +11 -0
  14. package/dist/bundle/chunks/github-copilot.js +1 -1
  15. package/dist/bundle/chunks/google-generative-ai-IMS5EK2Y.js +2 -0
  16. package/dist/bundle/chunks/google-vertex-O4YJEQUW.js +2 -0
  17. package/dist/bundle/chunks/jiti-loader-C3NU2SDH.js +21 -0
  18. package/dist/bundle/chunks/jiti-static-loader-E6ANQD5T.js +2 -0
  19. package/dist/bundle/chunks/mistral-conversations-NOSQHBEY.js +5 -0
  20. package/dist/bundle/chunks/{node-KG362ECQ.js → node-O3RIBJRH.js} +1 -1
  21. package/dist/bundle/chunks/openai-codex-responses-QDSOTBBO.js +10 -0
  22. package/dist/bundle/chunks/openai-completions-KQPOPEVM.js +7 -0
  23. package/dist/bundle/chunks/openai-responses-HWEUZ6WZ.js +2 -0
  24. package/dist/bundle/chunks/{pi-messages-PML4SPVJ.js → pi-messages-GFKBWJHZ.js} +1 -1
  25. package/dist/bundle/chunks/virtual-modules-UQVS3IVK.js +2 -0
  26. package/dist/bundle/cli.js +1 -1
  27. package/dist/bundle/index.js +1 -1
  28. package/dist/bundle/rpc-entry.js +1 -1
  29. package/dist/cli/session-picker.d.ts +1 -1
  30. package/dist/cli/session-picker.d.ts.map +1 -1
  31. package/dist/cli/session-picker.js.map +1 -1
  32. package/dist/config.d.ts.map +1 -1
  33. package/dist/config.js +1 -1
  34. package/dist/config.js.map +1 -1
  35. package/dist/core/agent-session.d.ts +56 -6
  36. package/dist/core/agent-session.d.ts.map +1 -1
  37. package/dist/core/agent-session.js +294 -157
  38. package/dist/core/agent-session.js.map +1 -1
  39. package/dist/core/bug-report-upload.d.ts +12 -0
  40. package/dist/core/bug-report-upload.d.ts.map +1 -0
  41. package/dist/core/bug-report-upload.js +22 -0
  42. package/dist/core/bug-report-upload.js.map +1 -0
  43. package/dist/core/bug-report.d.ts +176 -0
  44. package/dist/core/bug-report.d.ts.map +1 -0
  45. package/dist/core/bug-report.js +292 -0
  46. package/dist/core/bug-report.js.map +1 -0
  47. package/dist/core/cache-stats.d.ts.map +1 -1
  48. package/dist/core/cache-stats.js +12 -1
  49. package/dist/core/cache-stats.js.map +1 -1
  50. package/dist/core/cache-warmer.d.ts +102 -0
  51. package/dist/core/cache-warmer.d.ts.map +1 -0
  52. package/dist/core/cache-warmer.js +342 -0
  53. package/dist/core/cache-warmer.js.map +1 -0
  54. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  55. package/dist/core/compaction/branch-summarization.js +2 -2
  56. package/dist/core/compaction/branch-summarization.js.map +1 -1
  57. package/dist/core/compaction/compaction.d.ts +2 -2
  58. package/dist/core/compaction/compaction.d.ts.map +1 -1
  59. package/dist/core/compaction/compaction.js +11 -12
  60. package/dist/core/compaction/compaction.js.map +1 -1
  61. package/dist/core/crash-log.d.ts +22 -0
  62. package/dist/core/crash-log.d.ts.map +1 -0
  63. package/dist/core/crash-log.js +71 -0
  64. package/dist/core/crash-log.js.map +1 -0
  65. package/dist/core/experimental.d.ts +0 -4
  66. package/dist/core/experimental.d.ts.map +1 -1
  67. package/dist/core/experimental.js +0 -4
  68. package/dist/core/experimental.js.map +1 -1
  69. package/dist/core/extensions/index.d.ts +1 -1
  70. package/dist/core/extensions/index.d.ts.map +1 -1
  71. package/dist/core/extensions/index.js.map +1 -1
  72. package/dist/core/extensions/jiti-loader.d.ts +2 -0
  73. package/dist/core/extensions/jiti-loader.d.ts.map +1 -0
  74. package/dist/core/extensions/jiti-loader.js +4 -0
  75. package/dist/core/extensions/jiti-loader.js.map +1 -0
  76. package/dist/core/extensions/jiti-static-loader.d.ts +2 -0
  77. package/dist/core/extensions/jiti-static-loader.d.ts.map +1 -0
  78. package/dist/core/extensions/jiti-static-loader.js +4 -0
  79. package/dist/core/extensions/jiti-static-loader.js.map +1 -0
  80. package/dist/core/extensions/loader.d.ts.map +1 -1
  81. package/dist/core/extensions/loader.js +38 -51
  82. package/dist/core/extensions/loader.js.map +1 -1
  83. package/dist/core/extensions/runner.d.ts +10 -7
  84. package/dist/core/extensions/runner.d.ts.map +1 -1
  85. package/dist/core/extensions/runner.js +85 -67
  86. package/dist/core/extensions/runner.js.map +1 -1
  87. package/dist/core/extensions/types.d.ts +60 -50
  88. package/dist/core/extensions/types.d.ts.map +1 -1
  89. package/dist/core/extensions/types.js.map +1 -1
  90. package/dist/core/extensions/virtual-modules.d.ts +3 -0
  91. package/dist/core/extensions/virtual-modules.d.ts.map +1 -0
  92. package/dist/core/extensions/virtual-modules.js +38 -0
  93. package/dist/core/extensions/virtual-modules.js.map +1 -0
  94. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  95. package/dist/core/extensions/wrapper.js +1 -20
  96. package/dist/core/extensions/wrapper.js.map +1 -1
  97. package/dist/core/index.d.ts +2 -1
  98. package/dist/core/index.d.ts.map +1 -1
  99. package/dist/core/index.js.map +1 -1
  100. package/dist/core/keybindings.d.ts +1 -1
  101. package/dist/core/keybindings.d.ts.map +1 -1
  102. package/dist/core/keybindings.js +1 -1
  103. package/dist/core/keybindings.js.map +1 -1
  104. package/dist/core/messages.d.ts.map +1 -1
  105. package/dist/core/messages.js +1 -0
  106. package/dist/core/messages.js.map +1 -1
  107. package/dist/core/model-config.d.ts +101 -20
  108. package/dist/core/model-config.d.ts.map +1 -1
  109. package/dist/core/model-config.js +25 -18
  110. package/dist/core/model-config.js.map +1 -1
  111. package/dist/core/model-registry.d.ts +5 -1
  112. package/dist/core/model-registry.d.ts.map +1 -1
  113. package/dist/core/model-registry.js +8 -0
  114. package/dist/core/model-registry.js.map +1 -1
  115. package/dist/core/model-resolver.d.ts.map +1 -1
  116. package/dist/core/model-resolver.js +1 -1
  117. package/dist/core/model-resolver.js.map +1 -1
  118. package/dist/core/model-runtime.d.ts.map +1 -1
  119. package/dist/core/model-runtime.js +5 -3
  120. package/dist/core/model-runtime.js.map +1 -1
  121. package/dist/core/provider-composer.d.ts +3 -2
  122. package/dist/core/provider-composer.d.ts.map +1 -1
  123. package/dist/core/provider-composer.js +2 -0
  124. package/dist/core/provider-composer.js.map +1 -1
  125. package/dist/core/radius.d.ts +3 -0
  126. package/dist/core/radius.d.ts.map +1 -1
  127. package/dist/core/radius.js +6 -0
  128. package/dist/core/radius.js.map +1 -1
  129. package/dist/core/sdk.d.ts.map +1 -1
  130. package/dist/core/sdk.js +60 -38
  131. package/dist/core/sdk.js.map +1 -1
  132. package/dist/core/session-export.d.ts +6 -2
  133. package/dist/core/session-export.d.ts.map +1 -1
  134. package/dist/core/session-export.js +14 -13
  135. package/dist/core/session-export.js.map +1 -1
  136. package/dist/core/session-manager.d.ts +29 -6
  137. package/dist/core/session-manager.d.ts.map +1 -1
  138. package/dist/core/session-manager.js +159 -96
  139. package/dist/core/session-manager.js.map +1 -1
  140. package/dist/core/settings-manager.d.ts +20 -4
  141. package/dist/core/settings-manager.d.ts.map +1 -1
  142. package/dist/core/settings-manager.js +43 -7
  143. package/dist/core/settings-manager.js.map +1 -1
  144. package/dist/core/slash-commands.d.ts.map +1 -1
  145. package/dist/core/slash-commands.js +1 -0
  146. package/dist/core/slash-commands.js.map +1 -1
  147. package/dist/core/system-prompt.d.ts +49 -6
  148. package/dist/core/system-prompt.d.ts.map +1 -1
  149. package/dist/core/system-prompt.js +121 -92
  150. package/dist/core/system-prompt.js.map +1 -1
  151. package/dist/core/tools/bash.d.ts +2 -1
  152. package/dist/core/tools/bash.d.ts.map +1 -1
  153. package/dist/core/tools/bash.js +10 -4
  154. package/dist/core/tools/bash.js.map +1 -1
  155. package/dist/core/tools/edit.d.ts.map +1 -1
  156. package/dist/core/tools/edit.js +1 -2
  157. package/dist/core/tools/edit.js.map +1 -1
  158. package/dist/core/tools/read.d.ts.map +1 -1
  159. package/dist/core/tools/read.js +1 -2
  160. package/dist/core/tools/read.js.map +1 -1
  161. package/dist/core/tools/renderers/bash.d.ts.map +1 -1
  162. package/dist/core/tools/renderers/bash.js +9 -1
  163. package/dist/core/tools/renderers/bash.js.map +1 -1
  164. package/dist/core/tools/write.d.ts.map +1 -1
  165. package/dist/core/tools/write.js +1 -2
  166. package/dist/core/tools/write.js.map +1 -1
  167. package/dist/core/usage-totals.d.ts +1 -1
  168. package/dist/core/usage-totals.d.ts.map +1 -1
  169. package/dist/core/usage-totals.js +5 -1
  170. package/dist/core/usage-totals.js.map +1 -1
  171. package/dist/extensions/llama/client.d.ts +2 -0
  172. package/dist/extensions/llama/client.d.ts.map +1 -1
  173. package/dist/extensions/llama/client.js +7 -3
  174. package/dist/extensions/llama/client.js.map +1 -1
  175. package/dist/extensions/llama/provider.d.ts.map +1 -1
  176. package/dist/extensions/llama/provider.js +20 -5
  177. package/dist/extensions/llama/provider.js.map +1 -1
  178. package/dist/index.d.ts +3 -2
  179. package/dist/index.d.ts.map +1 -1
  180. package/dist/index.js.map +1 -1
  181. package/dist/main.d.ts.map +1 -1
  182. package/dist/main.js +13 -9
  183. package/dist/main.js.map +1 -1
  184. package/dist/migrations.d.ts.map +1 -1
  185. package/dist/migrations.js +2 -2
  186. package/dist/migrations.js.map +1 -1
  187. package/dist/modes/interactive/bug-report.d.ts +14 -0
  188. package/dist/modes/interactive/bug-report.d.ts.map +1 -0
  189. package/dist/modes/interactive/bug-report.js +209 -0
  190. package/dist/modes/interactive/bug-report.js.map +1 -0
  191. package/dist/modes/interactive/chat-viewport.d.ts.map +1 -1
  192. package/dist/modes/interactive/chat-viewport.js +1 -1
  193. package/dist/modes/interactive/chat-viewport.js.map +1 -1
  194. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  195. package/dist/modes/interactive/components/branch-summary-message.js +12 -5
  196. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  197. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  198. package/dist/modes/interactive/components/compaction-summary-message.js +12 -5
  199. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  200. package/dist/modes/interactive/components/custom-editor.d.ts +3 -3
  201. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  202. package/dist/modes/interactive/components/custom-editor.js.map +1 -1
  203. package/dist/modes/interactive/components/extension-input.d.ts +2 -0
  204. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  205. package/dist/modes/interactive/components/extension-input.js +6 -0
  206. package/dist/modes/interactive/components/extension-input.js.map +1 -1
  207. package/dist/modes/interactive/components/extension-selector.d.ts +1 -0
  208. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  209. package/dist/modes/interactive/components/extension-selector.js +4 -0
  210. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  211. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  212. package/dist/modes/interactive/components/footer.js +4 -1
  213. package/dist/modes/interactive/components/footer.js.map +1 -1
  214. package/dist/modes/interactive/components/session-selector.d.ts +5 -5
  215. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  216. package/dist/modes/interactive/components/session-selector.js +74 -48
  217. package/dist/modes/interactive/components/session-selector.js.map +1 -1
  218. package/dist/modes/interactive/components/settings-selector.d.ts +3 -1
  219. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  220. package/dist/modes/interactive/components/settings-selector.js +11 -0
  221. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  222. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  223. package/dist/modes/interactive/components/skill-invocation-message.js +11 -4
  224. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  225. package/dist/modes/interactive/components/status-indicator.d.ts +2 -2
  226. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  227. package/dist/modes/interactive/components/status-indicator.js +7 -7
  228. package/dist/modes/interactive/components/status-indicator.js.map +1 -1
  229. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  230. package/dist/modes/interactive/components/tool-execution.js +18 -9
  231. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  232. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  233. package/dist/modes/interactive/components/tree-selector.js +2 -0
  234. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  235. package/dist/modes/interactive/interactive-mode.d.ts +13 -1
  236. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  237. package/dist/modes/interactive/interactive-mode.js +220 -84
  238. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  239. package/dist/modes/interactive/session-share.d.ts +2 -0
  240. package/dist/modes/interactive/session-share.d.ts.map +1 -1
  241. package/dist/modes/interactive/session-share.js +8 -4
  242. package/dist/modes/interactive/session-share.js.map +1 -1
  243. package/dist/modes/interactive/tui-renderer.d.ts.map +1 -1
  244. package/dist/modes/interactive/tui-renderer.js +2 -2
  245. package/dist/modes/interactive/tui-renderer.js.map +1 -1
  246. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  247. package/dist/modes/rpc/rpc-mode.js +2 -2
  248. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  249. package/dist/utils/clipboard-command.d.ts +7 -0
  250. package/dist/utils/clipboard-command.d.ts.map +1 -0
  251. package/dist/utils/clipboard-command.js +45 -0
  252. package/dist/utils/clipboard-command.js.map +1 -0
  253. package/dist/utils/clipboard-image.d.ts.map +1 -1
  254. package/dist/utils/clipboard-image.js +52 -69
  255. package/dist/utils/clipboard-image.js.map +1 -1
  256. package/dist/utils/clipboard.d.ts.map +1 -1
  257. package/dist/utils/clipboard.js +61 -125
  258. package/dist/utils/clipboard.js.map +1 -1
  259. package/dist/utils/version-check.d.ts.map +1 -1
  260. package/dist/utils/version-check.js +11 -4
  261. package/dist/utils/version-check.js.map +1 -1
  262. package/dist/utils/zip.d.ts +7 -0
  263. package/dist/utils/zip.d.ts.map +1 -0
  264. package/dist/utils/zip.js +60 -0
  265. package/dist/utils/zip.js.map +1 -0
  266. package/docs/compaction.md +39 -13
  267. package/docs/custom-provider.md +22 -13
  268. package/docs/development.md +4 -4
  269. package/docs/docs.json +4 -0
  270. package/docs/environment-variables.md +1 -0
  271. package/docs/extensions.md +57 -43
  272. package/docs/json.md +4 -4
  273. package/docs/models.md +33 -2
  274. package/docs/providers.md +2 -2
  275. package/docs/sdk.md +4 -2
  276. package/docs/security.md +1 -1
  277. package/docs/session-format.md +82 -40
  278. package/docs/sessions.md +27 -0
  279. package/docs/settings.md +60 -1
  280. package/docs/termux.md +0 -1
  281. package/docs/tui.md +2 -2
  282. package/docs/usage.md +1 -0
  283. package/examples/extensions/README.md +0 -1
  284. package/examples/extensions/custom-provider-anthropic/index.ts +18 -12
  285. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  286. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  287. package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  288. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  289. package/examples/extensions/gondolin/package-lock.json +2 -2
  290. package/examples/extensions/gondolin/package.json +1 -1
  291. package/examples/extensions/prompt-customizer.ts +19 -67
  292. package/examples/extensions/sandbox/package-lock.json +2 -2
  293. package/examples/extensions/sandbox/package.json +1 -1
  294. package/examples/extensions/with-deps/package-lock.json +2 -2
  295. package/examples/extensions/with-deps/package.json +1 -1
  296. package/npm-shrinkwrap.json +435 -762
  297. package/package.json +17 -23
  298. package/dist/bundle/chunks/anthropic-messages-VWZZOSJQ.js +0 -6
  299. package/dist/bundle/chunks/azure-openai-responses-BJLAM6CD.js +0 -2
  300. package/dist/bundle/chunks/chunk-AXIIZGTV.js +0 -2
  301. package/dist/bundle/chunks/chunk-CLNPYIDP.js +0 -42
  302. package/dist/bundle/chunks/chunk-GMWCTUPB.js +0 -2
  303. package/dist/bundle/chunks/chunk-JJ2YFCJF.js +0 -1547
  304. package/dist/bundle/chunks/chunk-OUXLLA64.js +0 -11
  305. package/dist/bundle/chunks/chunk-U6ZMQKGD.js +0 -50
  306. package/dist/bundle/chunks/chunk-UAQELI3K.js +0 -2
  307. package/dist/bundle/chunks/google-generative-ai-Q2K7FBDI.js +0 -2
  308. package/dist/bundle/chunks/google-vertex-7UJBF4S7.js +0 -2
  309. package/dist/bundle/chunks/mistral-conversations-4M6BZBX6.js +0 -5
  310. package/dist/bundle/chunks/openai-codex-responses-R6VYZTVY.js +0 -10
  311. package/dist/bundle/chunks/openai-completions-EKZT2IH2.js +0 -7
  312. package/dist/bundle/chunks/openai-responses-TFDINO6W.js +0 -2
  313. package/dist/utils/clipboard-native.d.ts +0 -11
  314. package/dist/utils/clipboard-native.d.ts.map +0 -1
  315. package/dist/utils/clipboard-native.js +0 -20
  316. package/dist/utils/clipboard-native.js.map +0 -1
  317. package/examples/extensions/kimi-deferred-tools.ts +0 -61
package/README.md CHANGED
@@ -1,720 +1,41 @@
1
- <!-- pi-namespace-patch is the maskshell fork build of pi carrying the pi.namespace patch (earendil-works/pi#8834). Upstream project: earendil-works/pi. Fork source + release-tracked patches: https://github.com/maskshell/pi (namespace-patch branch). This README below is upstream's. -->
1
+ # pi-namespace-patch
2
2
 
3
- <p align="center">
4
- <a href="https://pi.dev">
5
- <img alt="pi logo" src="https://pi.dev/logo-auto.svg" width="128">
6
- </a>
7
- </p>
8
- <p align="center">
9
- <a href="https://discord.com/invite/3cU7Bz4UPx"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
10
- <a href="https://www.npmjs.com/package/@earendil-works/pi-coding-agent"><img alt="npm" src="https://img.shields.io/npm/v/@earendil-works/pi-coding-agent?style=flat-square" /></a>
11
- </p>
3
+ The [`pi`](https://github.com/earendil-works/pi) coding agent — **maskshell fork build** carrying the
4
+ [`pi.namespace`](https://github.com/earendil-works/pi/issues/8834) patch: an opt-in package namespace
5
+ for skills and prompt templates. A package declaring `"pi": { "namespace": "myorg" }` exposes
6
+ its skills and prompt templates as `<ns>:<name>` (`/skill:myorg:foo`, `/myorg:foo`); resource
7
+ content stays untouched and bare user/project names coexist.
12
8
 
13
- > New issues and PRs from new contributors are auto-closed by default. Maintainers review auto-closed issues daily. See [CONTRIBUTING.md](../../CONTRIBUTING.md).
9
+ This is not the official package. It tracks upstream releases as a
10
+ [release-managed patch](https://github.com/maskshell/pi/tree/namespace-patch/patch) — everything
11
+ else is upstream pi. Product documentation: the
12
+ [upstream README](https://github.com/earendil-works/pi).
14
13
 
15
- ---
16
-
17
- Pi is a minimal terminal coding harness. Adapt pi to your workflows, not the other way around, without having to fork and modify pi internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Pi Packages](#pi-packages) and share them with others via npm or git.
18
-
19
- Pi ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask pi to build what you want or install a third party pi package that matches your workflow.
20
-
21
- Pi runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps.
22
-
23
- ## Share your OSS coding agent sessions
24
-
25
- If you use pi for open source work, please share your coding agent sessions.
26
-
27
- Public OSS session data helps improve models, prompts, tools, and evaluations using real development workflows.
28
-
29
- For the full explanation, see [this post on X](https://x.com/badlogicgames/status/2037811643774652911).
30
-
31
- To publish sessions, use [`badlogic/pi-share-hf`](https://github.com/badlogic/pi-share-hf). Read its README.md for setup instructions. All you need is a Hugging Face account, the Hugging Face CLI, and `pi-share-hf`.
32
-
33
- You can also watch [this video](https://x.com/badlogicgames/status/2041151967695634619), where I show how I publish my `pi-mono` sessions.
34
-
35
- I regularly publish my own `pi-mono` work sessions here:
36
-
37
- - [badlogicgames/pi-mono on Hugging Face](https://huggingface.co/datasets/badlogicgames/pi-mono)
38
-
39
- ## Table of Contents
40
-
41
- - [Quick Start](#quick-start)
42
- - [Providers & Models](#providers--models)
43
- - [Interactive Mode](#interactive-mode)
44
- - [Editor](#editor)
45
- - [Commands](#commands)
46
- - [Keyboard Shortcuts](#keyboard-shortcuts)
47
- - [Message Queue](#message-queue)
48
- - [Sessions](#sessions)
49
- - [Branching](#branching)
50
- - [Compaction](#compaction)
51
- - [Settings](#settings)
52
- - [Context Files](#context-files)
53
- - [Customization](#customization)
54
- - [Prompt Templates](#prompt-templates)
55
- - [Skills](#skills)
56
- - [Extensions](#extensions)
57
- - [Themes](#themes)
58
- - [Pi Packages](#pi-packages)
59
- - [Programmatic Usage](#programmatic-usage)
60
- - [Philosophy](#philosophy)
61
- - [CLI Reference](#cli-reference)
62
-
63
- ---
64
-
65
- ## Quick Start
66
-
67
- ```bash
68
- npm install -g --ignore-scripts @earendil-works/pi-coding-agent
69
- ```
70
-
71
- `--ignore-scripts` disables dependency lifecycle scripts during install. Pi does not require install scripts for normal npm installs.
72
-
73
- Installer alternative:
74
-
75
- ```bash
76
- curl -fsSL https://pi.dev/install.sh | sh
77
- ```
78
-
79
- Authenticate with an API key:
80
-
81
- ```bash
82
- export ANTHROPIC_API_KEY=sk-ant-...
83
- pi
84
- ```
85
-
86
- Or use your existing subscription:
87
-
88
- ```bash
89
- pi
90
- /login # Then select provider
91
- ```
92
-
93
- Then just talk to pi. By default, pi gives the model four tools: `read`, `write`, `edit`, and `bash`. The model uses these to fulfill your requests. Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [pi packages](#pi-packages).
94
-
95
- **Platform notes:** [Windows](docs/windows.md) | [Termux (Android)](docs/termux.md) | [tmux](docs/tmux.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
96
-
97
- ---
98
-
99
- ## Providers & Models
100
-
101
- For each built-in provider, pi maintains a list of tool-capable models. Configured provider catalogs refresh automatically; run `pi update --models` to force an immediate refresh. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L). Press Ctrl+S in the model picker to save the highlighted model as the startup default.
102
-
103
- **Subscriptions:**
104
- - Anthropic Claude Pro/Max
105
- - OpenAI ChatGPT Plus/Pro (Codex)
106
- - GitHub Copilot
107
-
108
- **API keys:**
109
- - Anthropic
110
- - Ant Ling
111
- - OpenAI
112
- - Azure OpenAI
113
- - DeepSeek
114
- - NVIDIA NIM
115
- - Google Gemini
116
- - Google Vertex
117
- - Amazon Bedrock
118
- - Mistral
119
- - Groq
120
- - Cerebras
121
- - Cloudflare AI Gateway
122
- - Cloudflare Workers AI
123
- - xAI
124
- - OpenRouter
125
- - Vercel AI Gateway
126
- - ZAI Coding Plan (Global)
127
- - ZAI Coding Plan (China)
128
- - OpenCode Zen
129
- - OpenCode Go
130
- - Hugging Face
131
- - Fireworks
132
- - Together AI
133
- - Baseten
134
- - Kimi For Coding
135
- - MiniMax
136
- - Xiaomi MiMo
137
- - Xiaomi MiMo Token Plan (China)
138
- - Xiaomi MiMo Token Plan (Amsterdam)
139
- - Xiaomi MiMo Token Plan (Singapore)
140
-
141
- Pi also supports the llama.cpp router server. Configure it with `/login llama.cpp`, manage downloads and loaded models with `/llama`, then select a loaded model with `/model`. See [docs/llama-cpp.md](docs/llama-cpp.md) for setup and usage.
142
-
143
- See [docs/providers.md](docs/providers.md) for other provider setup instructions.
144
-
145
- **Custom providers & models:** Add providers via `~/.pi/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
146
-
147
- ---
148
-
149
- ## Interactive Mode
150
-
151
- <p align="center"><img src="docs/images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
152
-
153
- The interface from top to bottom:
154
-
155
- - **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
156
- - **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
157
- - **Editor** - Where you type; border color indicates thinking level and the border shows the streaming working indicator
158
- - **Footer** - Working directory, session name, total token/cache usage (`↑` input, `↓` output, `R` cache read, `W` cache write, `CH` latest cache hit rate), cost, context usage, current model. Totals include assistant responses, usage reported by tools, and summary generation.
159
-
160
- The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
161
-
162
- ### Editor
163
-
164
- | Feature | How |
165
- |---------|-----|
166
- | File reference | Type `@` to fuzzy-search project files |
167
- | Path completion | Tab to complete paths |
168
- | Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
169
- | External editor | Ctrl+G opens `externalEditor`, `$VISUAL`, `$EDITOR`, Notepad on Windows, or `nano` elsewhere |
170
- | Clipboard | Ctrl+V to paste an image or text (Alt+V on Windows), or drag images onto terminal |
171
- | Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |
172
-
173
- Standard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).
174
-
175
- ### Commands
176
-
177
- Type `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.
178
-
179
- | Command | Description |
180
- |---------|-------------|
181
- | `/login`, `/logout` | Manage provider credentials |
182
- | [`/llama`](docs/llama-cpp.md) | Download, load, and unload llama.cpp router models |
183
- | `/model` | Switch models; Ctrl+S in the picker saves the startup default |
184
- | `/thinking` | Switch thinking level; Ctrl+S in the picker saves the startup default |
185
- | `/scoped-models` | Enable/disable models for Ctrl+P cycling |
186
- | `/settings` | Theme, message delivery, transport, and other preferences |
187
- | `/resume` | Pick from previous sessions |
188
- | `/new` | Start a new session |
189
- | `/name <name>` | Set session display name |
190
- | `/session` | Show session info (file, ID, messages, tokens, cost) |
191
- | `/tree` | Jump to any point in the session and continue from there |
192
- | `/trust` | Save project trust decision for future sessions (restart required) |
193
- | `/fork` | Create a new session from a previous user message |
194
- | `/clone` | Duplicate the current active branch into a new session |
195
- | `/compact [prompt]` | Manually compact context, optional custom instructions |
196
- | `/copy` | Copy last assistant message to clipboard |
197
- | `/export [file]` | Export session to HTML or JSONL file |
198
- | `/import <file>` | Import and resume a session from a JSONL file |
199
- | `/share` | Upload as private GitHub gist with shareable HTML link |
200
- | `/reload` | Reload keybindings, extensions, skills, prompts, themes, and context files |
201
- | `/hotkeys` | Show all keyboard shortcuts |
202
- | `/changelog` | Display version history |
203
- | `/quit` | Quit pi |
204
-
205
- ### Keyboard Shortcuts
206
-
207
- See `/hotkeys` for the full list. Customize via `~/.pi/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
208
-
209
- **Commonly used:**
210
-
211
- | Key | Action |
212
- |-----|--------|
213
- | Ctrl+C | Clear editor |
214
- | Ctrl+C twice | Quit |
215
- | Escape | Cancel/abort |
216
- | Escape twice | Open `/tree` |
217
- | Ctrl+L | Open model selector |
218
- | Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
219
- | Shift+Tab | Cycle thinking level |
220
- | Ctrl+O | Collapse/expand tool output |
221
- | Ctrl+T | Collapse/expand thinking blocks |
222
- | Ctrl+X | Copy the last assistant message; with fullscreen copy-on-select disabled, copy the active text selection |
223
-
224
- ### Message Queue
225
-
226
- Submit messages while the agent is working:
227
-
228
- - **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls
229
- - **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
230
- - **Escape** aborts and restores queued messages to editor
231
- - **Alt+Up** retrieves queued messages back to editor
232
-
233
- On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so pi can receive the follow-up shortcut.
234
-
235
- Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once). `transport` selects provider transport preference (`"sse"`, `"websocket"`, or `"auto"`) for providers that support multiple transports.
236
-
237
- ---
238
-
239
- ## Sessions
240
-
241
- Sessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session-format.md](docs/session-format.md) for file format.
242
-
243
- ### Management
244
-
245
- Sessions auto-save to `~/.pi/agent/sessions/` organized by working directory.
246
-
247
- ```bash
248
- pi -c # Continue most recent session
249
- pi -r # Browse and select from past sessions
250
- pi --no-session # Ephemeral mode (don't save)
251
- pi --name "my task" # Set session display name at startup
252
- pi --session <path|id> # Use specific session file or ID
253
- pi --fork <path|id> # Fork specific session file or ID into a new session
254
- ```
255
-
256
- Use `/session` in interactive mode to see the current session ID before reusing it with `--session <id>` or `--fork <id>`.
257
-
258
- ### Branching
259
-
260
- **`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file.
261
-
262
- <p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
263
-
264
- - Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
265
- - Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
266
- - Press Ctrl+X to copy the selected message
267
- - Press Shift+L to label entries as bookmarks and Shift+T to toggle label timestamps
268
-
269
- **`/fork`** - Create a new session file from a previous user message on the active branch. Opens a selector, copies the active path up to that point, and places the selected prompt in the editor for modification.
270
-
271
- **`/clone`** - Duplicate the current active branch into a new session file at the current position. The new session keeps the full active-path history and opens with an empty editor.
272
-
273
- **`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.
274
-
275
- ### Compaction
276
-
277
- Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
278
-
279
- **Manual:** `/compact` or `/compact <custom instructions>`
280
-
281
- **Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.
282
-
283
- Compaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
284
-
285
- ---
286
-
287
- ## Settings
288
-
289
- Use `/settings` to modify common options, or edit JSON files directly:
290
-
291
- | Location | Scope |
292
- |----------|-------|
293
- | `~/.pi/agent/settings.json` | Global (all projects) |
294
- | `.pi/settings.json` | Project (overrides global) |
295
-
296
- See [docs/settings.md](docs/settings.md) for all options.
297
-
298
- ### Project Trust
299
-
300
- 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.
301
-
302
- Before the trust decision, pi loads only context files, user/global extensions, and CLI `-e` extensions so they can handle the `project_trust` event. Project-local extensions, project package-managed extensions, and project settings are loaded only after the project is trusted. This split also applies when switching to a session from a different cwd whose trust has not been resolved in the current process.
303
-
304
- 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.
305
-
306
- 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`.
307
-
308
- `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.
309
-
310
- 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.
311
-
312
- ### Telemetry and update checks
313
-
314
- Pi has two separate startup features:
315
-
316
- - **Update check:** fetches `https://pi.dev/api/latest-version` to check whether a newer Pi version exists. Disable it with `PI_SKIP_VERSION_CHECK=1`. Disabling update checks only turns off this check.
317
- - **Install/update telemetry:** after first install or a changelog-detected update, sends an anonymous version ping to `https://pi.dev/api/report-install`. This setting also controls optional provider attribution headers for OpenRouter, Cloudflare, and direct NVIDIA NIM requests. Opt out by setting `enableInstallTelemetry` to `false` in `settings.json`, or by setting `PI_TELEMETRY=0`. This does not disable update checks; Pi may still contact `pi.dev` for the latest version unless update checks are disabled or offline mode is enabled.
318
-
319
- Use `--offline` or `PI_OFFLINE=1` to disable all startup network operations described here, including update checks, package update checks, and install/update telemetry.
320
-
321
- ---
322
-
323
- ## Context Files
324
-
325
- Pi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
326
- - `~/.pi/agent/AGENTS.md` (global)
327
- - Parent directories (walking up from cwd)
328
- - Current directory
329
-
330
- 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 are still concatenated.
331
-
332
- Use for project instructions (`AGENTS.md`/`CLAUDE.md`), conventions, common commands. All matching files are concatenated.
333
-
334
- Disable context file loading with `--no-context-files` (or `-nc`).
335
-
336
- ### System Prompt
337
-
338
- Replace the default system prompt with `.pi/SYSTEM.md` (project) or `~/.pi/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
339
-
340
- ---
341
-
342
- ## Customization
343
-
344
- ### Prompt Templates
345
-
346
- Reusable prompts as Markdown files. Type `/name` to expand.
347
-
348
- ```markdown
349
- <!-- ~/.pi/agent/prompts/review.md -->
350
- Review this code for bugs, security issues, and performance problems.
351
- Focus on: {{focus}}
352
- ```
353
-
354
- Place in `~/.pi/agent/prompts/`, `.pi/prompts/`, or a [pi package](#pi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
355
-
356
- ### Skills
357
-
358
- On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
359
-
360
- ```markdown
361
- <!-- ~/.pi/agent/skills/my-skill/SKILL.md -->
362
- # My Skill
363
- Use this skill when the user asks about X.
364
-
365
- ## Steps
366
- 1. Do this
367
- 2. Then that
368
- ```
369
-
370
- Place in `~/.pi/agent/skills/`, `~/.agents/skills/`, `.pi/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [pi package](#pi-packages) to share with others. See [docs/skills.md](docs/skills.md).
371
-
372
- ### Extensions
373
-
374
- <p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
375
-
376
- TypeScript modules that extend pi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
377
-
378
- ```typescript
379
- export default function (pi: ExtensionAPI) {
380
- pi.registerTool({ name: "deploy", ... });
381
- pi.registerCommand("stats", { ... });
382
- pi.on("tool_call", async (event, ctx) => { ... });
383
- }
384
- ```
385
-
386
- The default export can also be `async`. pi waits for async extension factories before startup continues, which is useful for one-time initialization such as fetching remote model lists before calling `pi.registerProvider()`.
387
-
388
- **What's possible:**
389
- - Custom tools (or replace built-in tools entirely)
390
- - Sub-agents and plan mode
391
- - Custom compaction and summarization
392
- - Permission gates and path protection
393
- - Custom editors and UI components
394
- - Status lines, headers, footers
395
- - Git checkpointing and auto-commit
396
- - SSH and sandbox execution
397
- - MCP server integration
398
- - Make pi look like Claude Code
399
- - Games while waiting (yes, Doom runs)
400
- - ...anything you can dream up
401
-
402
- Place in `~/.pi/agent/extensions/`, `.pi/extensions/`, or a [pi package](#pi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
403
-
404
- ### Themes
405
-
406
- Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and pi immediately applies changes.
407
-
408
- Place in `~/.pi/agent/themes/`, `.pi/themes/`, or a [pi package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).
409
-
410
- ### Pi Packages
411
-
412
- Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Api-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
413
-
414
- > **Security:** Pi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
14
+ ## Install
415
15
 
416
16
  ```bash
417
- pi install npm:@foo/pi-tools
418
- pi install npm:@foo/pi-tools@1.2.3 # pinned version
419
- pi install git:github.com/user/repo
420
- pi install git:github.com/user/repo@v1 # tag or commit
421
- pi install git:git@github.com:user/repo
422
- pi install git:git@github.com:user/repo@v1 # tag or commit
423
- pi install https://github.com/user/repo
424
- pi install https://github.com/user/repo@v1 # tag or commit
425
- pi install ssh://git@github.com/user/repo
426
- pi install ssh://git@github.com/user/repo@v1 # tag or commit
427
- pi remove npm:@foo/pi-tools
428
- pi uninstall npm:@foo/pi-tools # alias for remove
429
- pi list
430
- pi update # update pi only
431
- pi update --all # update pi and packages
432
- pi update --extensions # update packages only
433
- pi update --models # refresh model catalogs only
434
- pi update --self # update pi only
435
- pi update --self --force # reinstall pi even if current
436
- pi update npm:@foo/pi-tools # update one package
437
- pi config # enable/disable extensions, skills, prompts, themes
17
+ npm install -g pi-namespace-patch
18
+ pi --version # 0.86.0-namespace.1 (this alias)
438
19
  ```
439
20
 
440
- Packages install to `~/.pi/agent/git/` (git) or `~/.pi/agent/npm/` (npm). Use `-l` for project-local installs (`.pi/git/`, `.pi/npm/`). Git `@ref` values are pinned tags or commits; pinned packages are skipped by `pi update --extensions` and `pi update --all`, so use `pi install git:host/user/repo@new-ref` to move an existing package to a new ref. Git packages install dependencies with `npm install --omit=dev` by default, so runtime deps must be listed under `dependencies`; when `npmCommand` is configured, git packages use plain `install` for compatibility with wrappers. If you use a Node version manager and want package installs to reuse a stable npm context, set `npmCommand` in `settings.json`, for example `["mise", "exec", "node@20", "--", "npm"]`.
441
-
442
- Create a package by adding a `pi` key to `package.json`:
443
-
444
- ```json
445
- {
446
- "name": "my-pi-package",
447
- "keywords": ["pi-package"],
448
- "pi": {
449
- "extensions": ["./extensions"],
450
- "skills": ["./skills"],
451
- "prompts": ["./prompts"],
452
- "themes": ["./themes"]
453
- }
454
- }
455
- ```
456
-
457
- Without a `pi` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
458
-
459
- See [docs/packages.md](docs/packages.md).
460
-
461
- ---
462
-
463
- ## Programmatic Usage
464
-
465
- ### SDK
466
-
467
- ```typescript
468
- import { createAgentSession, ModelRuntime, SessionManager } from "@earendil-works/pi-coding-agent";
469
-
470
- const modelRuntime = await ModelRuntime.create();
471
- const { session } = await createAgentSession({
472
- sessionManager: SessionManager.inMemory(),
473
- modelRuntime,
474
- });
475
-
476
- await session.prompt("What files are in the current directory?");
477
- ```
478
-
479
- For advanced multi-session runtime replacement, use `createAgentSessionRuntime()` and `AgentSessionRuntime`.
480
-
481
- See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
482
-
483
- ### RPC Mode
484
-
485
- For non-Node.js integrations, use RPC mode over stdin/stdout:
21
+ Pinned to this release / registry-free — same build; the GitHub tarball reports the
22
+ workspace-stamped form `0.86.0+namespace.1`:
486
23
 
487
24
  ```bash
488
- pi --mode rpc
25
+ npm install -g https://github.com/maskshell/pi/releases/download/v0.86.0-namespace.1/earendil-works-pi-coding-agent-0.86.0-namespace.1.tgz
489
26
  ```
490
27
 
491
- RPC mode uses strict LF-delimited JSONL framing. Clients must split records on `\n` only. Do not use generic line readers like Node `readline`, which also split on Unicode separators inside JSON payloads.
492
-
493
- See [docs/rpc.md](docs/rpc.md) for the protocol.
494
-
495
- ---
496
-
497
- ## Philosophy
498
-
499
- Pi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [pi packages](#pi-packages). This keeps the core minimal while letting you shape pi to fit how you work.
500
-
501
- **No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
502
-
503
- **No sub-agents.** There's many ways to do this. Spawn pi instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
504
-
505
- **No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
506
-
507
- **No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.
508
-
509
- **No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
510
-
511
- **No background bash.** Use tmux. Full observability, direct interaction.
512
-
513
- Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) for the full rationale.
514
-
515
- ---
516
-
517
- ## CLI Reference
518
-
519
- ```bash
520
- pi [options] [--] [@files...] [messages...]
521
- ```
522
-
523
- ### Package Commands
524
-
525
- ```bash
526
- pi install <source> [-l] # Install package, -l for project-local
527
- pi remove <source> [-l] # Remove package
528
- pi uninstall <source> [-l] # Alias for remove
529
- pi update [source|self|pi] # Update pi only, or one package source
530
- pi update --all # Update pi and packages
531
- pi update --extensions # Update packages only
532
- pi update --models # Refresh model catalogs only
533
- pi update --self # Update pi only
534
- pi update --self --force # Reinstall pi even if current
535
- pi update --extension <src> # Update one package
536
- pi list # List installed packages
537
- pi config # Enable/disable package resources
538
- ```
539
-
540
- `pi config` and project package commands accept `--approve`/`--no-approve` to trust or ignore project-local settings for one command. `pi update` never prompts for project trust.
541
-
542
- ### Modes
543
-
544
- | Flag | Description |
545
- |------|-------------|
546
- | (default) | Interactive mode |
547
- | `-p`, `--print` | Print response and exit |
548
- | `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
549
- | `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
550
- | `--export <in> [out]` | Export session to HTML |
551
-
552
- In print mode, pi also reads piped stdin and merges it into the initial prompt:
553
-
554
- ```bash
555
- cat README.md | pi -p "Summarize this text"
556
- ```
557
-
558
- ### Model Options
559
-
560
- | Option | Description |
561
- |--------|-------------|
562
- | `--provider <name>` | Provider (anthropic, openai, google, etc.) |
563
- | `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
564
- | `--api-key <key>` | API key (overrides env vars) |
565
- | `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh`, `max` |
566
- | `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
567
- | `--list-models [search]` | List available models |
568
-
569
- ### Session Options
570
-
571
- | Option | Description |
572
- |--------|-------------|
573
- | `-c`, `--continue` | Continue most recent session |
574
- | `-r`, `--resume` | Browse and select session |
575
- | `--session <path\|id>` | Use specific session file or partial UUID |
576
- | `--fork <path\|id>` | Fork specific session file or partial UUID into a new session |
577
- | `--session-dir <dir>` | Custom session storage directory |
578
- | `--no-session` | Ephemeral mode (don't save) |
579
- | `--name <name>`, `-n <name>` | Set session display name at startup |
580
-
581
- ### Tool Options
582
-
583
- | Option | Description |
584
- |--------|-------------|
585
- | `--tools <list>`, `-t <list>` | Allowlist specific tool names across built-in, extension, and custom tools |
586
- | `--exclude-tools <list>`, `-xt <list>` | Disable specific tool names across built-in, extension, and custom tools |
587
- | `--no-builtin-tools`, `-nbt` | Disable built-in tools by default but keep extension/custom tools enabled |
588
- | `--no-tools`, `-nt` | Disable all tools by default |
589
-
590
- Available built-in tools: `read`, `bash`, `powershell` (Windows), `edit`, `write`, `grep`, `find`, `ls`
591
-
592
- ### Resource Options
593
-
594
- | Option | Description |
595
- |--------|-------------|
596
- | `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
597
- | `--no-extensions` | Disable extension discovery |
598
- | `--skill <path>` | Load skill (repeatable) |
599
- | `--no-skills` | Disable skill discovery |
600
- | `--prompt-template <path>` | Load prompt template (repeatable) |
601
- | `--no-prompt-templates` | Disable prompt template discovery |
602
- | `--theme <path>` | Load theme (repeatable) |
603
- | `--no-themes` | Disable theme discovery |
604
- | `--no-context-files`, `-nc` | Disable AGENTS.md and CLAUDE.md context file discovery |
605
-
606
- Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
607
-
608
- ### Other Options
609
-
610
- | Option | Description |
611
- |--------|-------------|
612
- | `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
613
- | `--append-system-prompt <text>` | Append to system prompt |
614
- | `--tui-mode <mode>` | TUI mode: `regular` (default) or experimental `fullscreen` |
615
- | `--use-theme <name[/name]>` | Set the initial interactive theme for this run without changing settings |
616
- | `--verbose` | Force verbose startup |
617
- | `-a`, `--approve` | Trust project-local files for this run |
618
- | `-na`, `--no-approve` | Ignore project-local files for this run |
619
- | `--` | Stop option parsing; remaining arguments are prompts or `@file` inputs |
620
- | `-h`, `--help` | Show help |
621
- | `-v`, `--version` | Show version |
622
-
623
- ### File Arguments
624
-
625
- Prefix files with `@` to include in the message:
626
-
627
- ```bash
628
- pi @prompt.md "Answer this"
629
- pi -p @screenshot.png "What's in this image?"
630
- pi @code.ts @test.ts "Review these files"
631
- ```
632
-
633
- ### Examples
634
-
635
- ```bash
636
- # Interactive with initial prompt
637
- pi "List all .ts files in src/"
638
-
639
- # Non-interactive
640
- pi -p "Summarize this codebase"
641
-
642
- # Prompt beginning with a dash
643
- pi -p -- "- Summarize these points"
644
-
645
- # Non-interactive with piped stdin
646
- cat README.md | pi -p "Summarize this text"
647
-
648
- # Named one-shot session
649
- pi --name "release audit" -p "Audit this repository"
650
-
651
- # Different model
652
- pi --provider openai --model gpt-4o "Help me refactor"
653
-
654
- # Model with provider prefix (no --provider needed)
655
- pi --model openai/gpt-4o "Help me refactor"
656
-
657
- # Model with thinking level shorthand
658
- pi --model sonnet:high "Solve this complex problem"
659
-
660
- # Limit model cycling
661
- pi --models "claude-*,gpt-4o"
662
-
663
- # Read-only mode
664
- pi --tools read,grep,find,ls -p "Review the code"
665
-
666
- # Disable one extension or built-in tool while keeping the rest available
667
- pi --exclude-tools ask_question
668
-
669
- # High thinking level
670
- pi --thinking high "Solve this complex problem"
671
- ```
672
-
673
- ### Environment Variables
674
-
675
- | Variable | Description |
676
- |----------|-------------|
677
- | `AI_AGENT` | Set to `pi` by the CLI and RPC entry points so generic tooling can attribute child processes to Pi |
678
- | `PI_CODING_AGENT` | Set to `true` by the CLI and RPC entry points so child processes can detect that they run inside Pi |
679
- | `PI_CODING_AGENT_DIR` | Override config directory (default: `~/.pi/agent`) |
680
- | `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
681
- | `PI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
682
- | `PI_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
683
- | `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
684
- | `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers. Use `1`/`true`/`yes` to enable or `0`/`false`/`no` to disable. This does not disable update checks |
685
- | `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
686
- | `VISUAL`, `EDITOR` | Fallback external editor for Ctrl+G when `externalEditor` is unset; defaults to Notepad on Windows and `nano` elsewhere |
687
-
688
- Commands run by the LLM-callable `bash` and `powershell` tools also receive current session metadata:
689
-
690
- | Variable | Description |
691
- |----------|-------------|
692
- | `PI_SESSION_ID` | Current session ID |
693
- | `PI_SESSION_FILE` | Absolute session JSONL path; unset for ephemeral sessions |
694
- | `PI_PROVIDER` | Currently selected model provider |
695
- | `PI_MODEL` | Currently selected model ID |
696
- | `PI_REASONING_LEVEL` | Current effective reasoning level |
697
-
698
- These values are resolved when each command starts. See [Environment Variables](docs/environment-variables.md#shell-tool-session-environment) for semantics, examples, and custom-tool opt-out.
699
-
700
- ---
701
-
702
- ## Contributing & Development
703
-
704
- See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.
705
-
706
- ## License
28
+ ## Version scheme
707
29
 
708
- MIT
30
+ Registry versions use the prerelease form `X.Y.Z-namespace.N`, matching the fork's release tags:
31
+ npm collapses semver build metadata, so the workspace's `X.Y.Z+namespace.N` form cannot be reused
32
+ here, and the registry suffix may run ahead of the release suffix when a re-publish occupies a new
33
+ slot. Pin exact versions (`pi-namespace-patch@0.86.0-namespace.1`), not ranges.
709
34
 
710
- ## See Also
35
+ ## Provenance
711
36
 
712
- - [@earendil-works/pi-ai](https://www.npmjs.com/package/@earendil-works/pi-ai): Core LLM toolkit
713
- - [@earendil-works/pi-agent-core](https://www.npmjs.com/package/@earendil-works/pi-agent-core): Agent framework
714
- - [@earendil-works/pi-tui](https://www.npmjs.com/package/@earendil-works/pi-tui): Terminal UI components
37
+ Each alias version is derived from the verified GitHub release asset (never rebuilt) and published
38
+ via trusted publishing (OIDC) with provenance attached. Sources and lifecycle:
39
+ [maskshell/pi](https://github.com/maskshell/pi), branch `namespace-patch`.
715
40
 
716
- <p align="center">
717
- <a href="https://pi.dev">pi.dev</a> domain graciously donated by
718
- <br /><br />
719
- <a href="https://exe.dev"><img src="docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
720
- </p>
41
+ License: MIT (as upstream).