@eminent337/aery 0.1.115 → 0.1.117

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 (274) hide show
  1. package/CHANGELOG.md +4172 -16
  2. package/README.md +621 -34
  3. package/dist/bun/cli.d.ts.map +1 -1
  4. package/dist/bun/cli.js +2 -1
  5. package/dist/bun/cli.js.map +1 -1
  6. package/dist/cli/args.d.ts.map +1 -1
  7. package/dist/cli/args.js +3 -0
  8. package/dist/cli/args.js.map +1 -1
  9. package/dist/cli/config-selector.d.ts +1 -1
  10. package/dist/cli/config-selector.d.ts.map +1 -1
  11. package/dist/cli/config-selector.js +1 -1
  12. package/dist/cli/config-selector.js.map +1 -1
  13. package/dist/cli.d.ts.map +1 -1
  14. package/dist/cli.js +4 -3
  15. package/dist/cli.js.map +1 -1
  16. package/dist/config.d.ts +11 -7
  17. package/dist/config.d.ts.map +1 -1
  18. package/dist/config.js +66 -46
  19. package/dist/config.js.map +1 -1
  20. package/dist/core/agent-session.d.ts +5 -5
  21. package/dist/core/agent-session.d.ts.map +1 -1
  22. package/dist/core/agent-session.js +37 -36
  23. package/dist/core/agent-session.js.map +1 -1
  24. package/dist/core/bash-executor.d.ts.map +1 -1
  25. package/dist/core/bash-executor.js +2 -2
  26. package/dist/core/bash-executor.js.map +1 -1
  27. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  28. package/dist/core/compaction/branch-summarization.js +1 -1
  29. package/dist/core/compaction/branch-summarization.js.map +1 -1
  30. package/dist/core/compaction/compaction.d.ts.map +1 -1
  31. package/dist/core/compaction/compaction.js +3 -3
  32. package/dist/core/compaction/compaction.js.map +1 -1
  33. package/dist/core/custom-openai-compatible.d.ts +1 -0
  34. package/dist/core/custom-openai-compatible.d.ts.map +1 -1
  35. package/dist/core/custom-openai-compatible.js +30 -4
  36. package/dist/core/custom-openai-compatible.js.map +1 -1
  37. package/dist/core/export-html/template.css +45 -1
  38. package/dist/core/export-html/template.js +68 -4
  39. package/dist/core/extensions/index.d.ts +1 -1
  40. package/dist/core/extensions/index.d.ts.map +1 -1
  41. package/dist/core/extensions/index.js.map +1 -1
  42. package/dist/core/extensions/loader.d.ts +1 -1
  43. package/dist/core/extensions/loader.d.ts.map +1 -1
  44. package/dist/core/extensions/loader.js +2 -2
  45. package/dist/core/extensions/loader.js.map +1 -1
  46. package/dist/core/extensions/runner.d.ts +3 -2
  47. package/dist/core/extensions/runner.d.ts.map +1 -1
  48. package/dist/core/extensions/runner.js +40 -0
  49. package/dist/core/extensions/runner.js.map +1 -1
  50. package/dist/core/extensions/types.d.ts +17 -3
  51. package/dist/core/extensions/types.d.ts.map +1 -1
  52. package/dist/core/extensions/types.js.map +1 -1
  53. package/dist/core/model-registry.d.ts +6 -0
  54. package/dist/core/model-registry.d.ts.map +1 -1
  55. package/dist/core/model-registry.js +59 -2
  56. package/dist/core/model-registry.js.map +1 -1
  57. package/dist/core/model-resolver.d.ts.map +1 -1
  58. package/dist/core/model-resolver.js +9 -1
  59. package/dist/core/model-resolver.js.map +1 -1
  60. package/dist/core/provider-display-names.d.ts +2 -0
  61. package/dist/core/provider-display-names.d.ts.map +1 -0
  62. package/dist/core/provider-display-names.js +35 -0
  63. package/dist/core/provider-display-names.js.map +1 -0
  64. package/dist/core/resource-loader.d.ts.map +1 -1
  65. package/dist/core/resource-loader.js +1 -1
  66. package/dist/core/resource-loader.js.map +1 -1
  67. package/dist/core/sdk.d.ts +3 -3
  68. package/dist/core/sdk.d.ts.map +1 -1
  69. package/dist/core/sdk.js +18 -10
  70. package/dist/core/sdk.js.map +1 -1
  71. package/dist/core/session-manager.d.ts +3 -3
  72. package/dist/core/session-manager.d.ts.map +1 -1
  73. package/dist/core/session-manager.js +1 -1
  74. package/dist/core/session-manager.js.map +1 -1
  75. package/dist/core/settings-manager.d.ts.map +1 -1
  76. package/dist/core/settings-manager.js +2 -2
  77. package/dist/core/settings-manager.js.map +1 -1
  78. package/dist/core/system-prompt.d.ts.map +1 -1
  79. package/dist/core/system-prompt.js +5 -5
  80. package/dist/core/system-prompt.js.map +1 -1
  81. package/dist/core/tools/bash.d.ts +2 -2
  82. package/dist/core/tools/bash.d.ts.map +1 -1
  83. package/dist/core/tools/bash.js +105 -125
  84. package/dist/core/tools/bash.js.map +1 -1
  85. package/dist/core/tools/find.d.ts.map +1 -1
  86. package/dist/core/tools/find.js +1 -1
  87. package/dist/core/tools/find.js.map +1 -1
  88. package/dist/core/tools/grep.d.ts.map +1 -1
  89. package/dist/core/tools/grep.js +1 -1
  90. package/dist/core/tools/grep.js.map +1 -1
  91. package/dist/core/tools/output-accumulator.d.ts +50 -0
  92. package/dist/core/tools/output-accumulator.d.ts.map +1 -0
  93. package/dist/core/tools/output-accumulator.js +178 -0
  94. package/dist/core/tools/output-accumulator.js.map +1 -0
  95. package/dist/core/tools/read.d.ts.map +1 -1
  96. package/dist/core/tools/read.js +70 -13
  97. package/dist/core/tools/read.js.map +1 -1
  98. package/dist/core/tools/render-utils.d.ts.map +1 -1
  99. package/dist/core/tools/render-utils.js +2 -2
  100. package/dist/core/tools/render-utils.js.map +1 -1
  101. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  102. package/dist/modes/interactive/components/bash-execution.js +1 -1
  103. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  104. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  105. package/dist/modes/interactive/components/config-selector.js +23 -1
  106. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  107. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  108. package/dist/modes/interactive/components/earendil-announcement.js +2 -2
  109. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  110. package/dist/modes/interactive/components/extension-selector.d.ts +2 -0
  111. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  112. package/dist/modes/interactive/components/extension-selector.js +6 -1
  113. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  114. package/dist/modes/interactive/components/keybinding-hints.d.ts +5 -0
  115. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  116. package/dist/modes/interactive/components/keybinding-hints.js +19 -5
  117. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  118. package/dist/modes/interactive/components/login-dialog.d.ts +1 -3
  119. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  120. package/dist/modes/interactive/components/login-dialog.js +9 -17
  121. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  122. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  123. package/dist/modes/interactive/components/oauth-selector.js +24 -27
  124. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  125. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  126. package/dist/modes/interactive/components/settings-selector.js +4 -2
  127. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  128. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  129. package/dist/modes/interactive/components/tree-selector.js +2 -1
  130. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  131. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  132. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  133. package/dist/modes/interactive/interactive-mode.js +9 -1
  134. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  135. package/dist/modes/interactive/theme/dark.json +1 -1
  136. package/dist/modes/interactive/theme/light.json +1 -1
  137. package/dist/modes/interactive/theme/theme-schema.json +1 -1
  138. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  139. package/dist/modes/interactive/theme/theme.js +8 -10
  140. package/dist/modes/interactive/theme/theme.js.map +1 -1
  141. package/dist/modes/print-mode.d.ts +2 -2
  142. package/dist/modes/print-mode.d.ts.map +1 -1
  143. package/dist/modes/print-mode.js +2 -2
  144. package/dist/modes/print-mode.js.map +1 -1
  145. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  146. package/dist/modes/rpc/rpc-mode.js +4 -0
  147. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  148. package/dist/utils/ansi.d.ts +2 -0
  149. package/dist/utils/ansi.d.ts.map +1 -0
  150. package/dist/utils/ansi.js +52 -0
  151. package/dist/utils/ansi.js.map +1 -0
  152. package/dist/utils/clipboard-image.d.ts.map +1 -1
  153. package/dist/utils/clipboard-image.js +3 -3
  154. package/dist/utils/clipboard-image.js.map +1 -1
  155. package/dist/utils/clipboard.d.ts.map +1 -1
  156. package/dist/utils/clipboard.js +9 -2
  157. package/dist/utils/clipboard.js.map +1 -1
  158. package/dist/utils/html.d.ts +7 -0
  159. package/dist/utils/html.d.ts.map +1 -0
  160. package/dist/utils/html.js +40 -0
  161. package/dist/utils/html.js.map +1 -0
  162. package/dist/utils/mime.d.ts +1 -0
  163. package/dist/utils/mime.d.ts.map +1 -1
  164. package/dist/utils/mime.js +59 -16
  165. package/dist/utils/mime.js.map +1 -1
  166. package/dist/utils/paths.d.ts +2 -0
  167. package/dist/utils/paths.d.ts.map +1 -1
  168. package/dist/utils/paths.js +16 -0
  169. package/dist/utils/paths.js.map +1 -1
  170. package/dist/utils/pi-user-agent.d.ts +2 -0
  171. package/dist/utils/pi-user-agent.d.ts.map +1 -0
  172. package/dist/utils/pi-user-agent.js +5 -0
  173. package/dist/utils/pi-user-agent.js.map +1 -0
  174. package/dist/utils/syntax-highlight.d.ts +12 -0
  175. package/dist/utils/syntax-highlight.d.ts.map +1 -0
  176. package/dist/utils/syntax-highlight.js +118 -0
  177. package/dist/utils/syntax-highlight.js.map +1 -0
  178. package/dist/utils/tools-manager.d.ts.map +1 -1
  179. package/dist/utils/tools-manager.js +76 -7
  180. package/dist/utils/tools-manager.js.map +1 -1
  181. package/dist/utils/uuid.d.ts +2 -0
  182. package/dist/utils/uuid.d.ts.map +1 -0
  183. package/dist/utils/uuid.js +40 -0
  184. package/dist/utils/uuid.js.map +1 -0
  185. package/dist/utils/version-check.d.ts +7 -0
  186. package/dist/utils/version-check.d.ts.map +1 -1
  187. package/dist/utils/version-check.js +12 -5
  188. package/dist/utils/version-check.js.map +1 -1
  189. package/docs/compaction.md +16 -16
  190. package/docs/custom-provider.md +40 -32
  191. package/docs/development.md +4 -4
  192. package/docs/docs.json +20 -5
  193. package/docs/extensions.md +152 -102
  194. package/docs/index.md +16 -7
  195. package/docs/json.md +7 -7
  196. package/docs/keybindings.md +3 -3
  197. package/docs/models.md +48 -8
  198. package/docs/packages.md +41 -36
  199. package/docs/prompt-templates.md +2 -2
  200. package/docs/providers.md +52 -36
  201. package/docs/quickstart.md +20 -20
  202. package/docs/rpc.md +9 -9
  203. package/docs/sdk.md +31 -53
  204. package/docs/session-format.md +10 -10
  205. package/docs/sessions.md +9 -9
  206. package/docs/settings.md +12 -6
  207. package/docs/skills.md +4 -4
  208. package/docs/terminal-setup.md +6 -6
  209. package/docs/termux.md +6 -6
  210. package/docs/themes.md +7 -7
  211. package/docs/tmux.md +1 -1
  212. package/docs/tui.md +8 -8
  213. package/docs/usage.md +41 -39
  214. package/examples/extensions/README.md +3 -5
  215. package/examples/extensions/antigravity-image-gen.ts +9 -9
  216. package/examples/extensions/auto-commit-on-exit.ts +1 -1
  217. package/examples/extensions/bash-spawn-hook.ts +2 -2
  218. package/examples/extensions/built-in-tool-renderer.ts +1 -1
  219. package/examples/extensions/custom-compaction.ts +1 -1
  220. package/examples/extensions/custom-header.ts +2 -2
  221. package/examples/extensions/custom-provider-anthropic/index.ts +2 -2
  222. package/examples/extensions/custom-provider-anthropic/package-lock.json +4 -4
  223. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  224. package/examples/extensions/custom-provider-gitlab-duo/index.ts +2 -2
  225. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  226. package/examples/extensions/doom-overlay/README.md +2 -2
  227. package/examples/extensions/doom-overlay/doom/build.sh +2 -2
  228. package/examples/extensions/doom-overlay/index.ts +1 -1
  229. package/examples/extensions/dynamic-resources/dynamic.json +1 -1
  230. package/examples/extensions/handoff.ts +42 -5
  231. package/examples/extensions/hidden-thinking-label.ts +1 -1
  232. package/examples/extensions/inline-bash.ts +2 -2
  233. package/examples/extensions/input-transform.ts +3 -3
  234. package/examples/extensions/interactive-shell.ts +1 -1
  235. package/examples/extensions/mac-system-theme.ts +2 -2
  236. package/examples/extensions/minimal-mode.ts +1 -1
  237. package/examples/extensions/modal-editor.ts +1 -1
  238. package/examples/extensions/model-status.ts +1 -1
  239. package/examples/extensions/overlay-qa-tests.ts +6 -6
  240. package/examples/extensions/overlay-test.ts +1 -1
  241. package/examples/extensions/preset.ts +2 -2
  242. package/examples/extensions/provider-payload.ts +1 -1
  243. package/examples/extensions/rainbow-editor.ts +1 -1
  244. package/examples/extensions/rpc-demo.ts +1 -1
  245. package/examples/extensions/sandbox/index.ts +3 -3
  246. package/examples/extensions/sandbox/package-lock.json +7 -7
  247. package/examples/extensions/sandbox/package.json +1 -1
  248. package/examples/extensions/shutdown-command.ts +5 -5
  249. package/examples/extensions/ssh.ts +2 -2
  250. package/examples/extensions/subagent/README.md +2 -2
  251. package/examples/extensions/subagent/agents/aery-pods.md +1 -1
  252. package/examples/extensions/subagent/agents.ts +1 -1
  253. package/examples/extensions/subagent/index.ts +2 -2
  254. package/examples/extensions/titlebar-spinner.ts +1 -1
  255. package/examples/extensions/tool-override.ts +2 -2
  256. package/examples/extensions/truncated-tool.ts +1 -1
  257. package/examples/extensions/with-deps/package-lock.json +4 -4
  258. package/examples/extensions/with-deps/package.json +1 -1
  259. package/examples/extensions/working-indicator.ts +4 -4
  260. package/examples/extensions/working-message-test.ts +1 -1
  261. package/examples/sdk/01-minimal.ts +14 -10
  262. package/examples/sdk/02-custom-model.ts +12 -8
  263. package/examples/sdk/03-custom-prompt.ts +24 -16
  264. package/examples/sdk/04-skills.ts +2 -2
  265. package/examples/sdk/05-tools.ts +8 -4
  266. package/examples/sdk/06-extensions.ts +11 -7
  267. package/examples/sdk/07-context-files.ts +2 -2
  268. package/examples/sdk/08-prompt-templates.ts +2 -2
  269. package/examples/sdk/09-api-keys-and-oauth.ts +8 -4
  270. package/examples/sdk/10-settings.ts +4 -4
  271. package/examples/sdk/11-sessions.ts +4 -0
  272. package/examples/sdk/12-full-control.ts +11 -7
  273. package/examples/sdk/README.md +5 -8
  274. package/package.json +8 -14
package/docs/index.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Pi Documentation
2
2
 
3
- Aery is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and aery packages.
3
+ Pi is a minimal terminal coding harness. It is designed to stay small at the core while being extended through TypeScript extensions, skills, prompt templates, themes, and pi packages.
4
4
 
5
5
  ## Quick start
6
6
 
7
- Install aery with npm:
7
+ On linux or mac you can install Pi with curl:
8
+
9
+ ```bash
10
+ curl -fsSL https://eminent337.github.io/install.sh | sh
11
+ ```
12
+
13
+ Or alternatively with npm:
8
14
 
9
15
  ```bash
10
16
  npm install -g @eminent337/aery
@@ -13,10 +19,10 @@ npm install -g @eminent337/aery
13
19
  Then run it in a project directory:
14
20
 
15
21
  ```bash
16
- aery
22
+ pi
17
23
  ```
18
24
 
19
- Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting aery.
25
+ Authenticate with `/login` for subscription providers, or set an API key such as `ANTHROPIC_API_KEY` before starting pi.
20
26
 
21
27
  For the full first-run flow, see [Quickstart](quickstart.md).
22
28
 
@@ -27,8 +33,7 @@ For the full first-run flow, see [Quickstart](quickstart.md).
27
33
  - [Providers](providers.md) - subscription and API-key setup for built-in providers.
28
34
  - [Settings](settings.md) - global and project settings.
29
35
  - [Keybindings](keybindings.md) - default shortcuts and custom keybindings.
30
- - [Sessions](session.md) - session storage format and session files.
31
- - [Session tree](tree.md) - branching and navigating previous turns.
36
+ - [Sessions](sessions.md) - session management, branching, and tree navigation.
32
37
  - [Compaction](compaction.md) - context compaction and branch summarization.
33
38
 
34
39
  ## Customization
@@ -43,11 +48,15 @@ For the full first-run flow, see [Quickstart](quickstart.md).
43
48
 
44
49
  ## Programmatic usage
45
50
 
46
- - [SDK](sdk.md) - embed aery in Node.js applications.
51
+ - [SDK](sdk.md) - embed pi in Node.js applications.
47
52
  - [RPC mode](rpc.md) - integrate over stdin/stdout JSONL.
48
53
  - [JSON event stream mode](json.md) - print mode with structured events.
49
54
  - [TUI components](tui.md) - build custom terminal UI for extensions.
50
55
 
56
+ ## Reference
57
+
58
+ - [Session format](session-format.md) - JSONL session file format, entry types, and SessionManager API.
59
+
51
60
  ## Platform setup
52
61
 
53
62
  - [Windows](windows.md)
package/docs/json.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # JSON Event Stream Mode
2
2
 
3
3
  ```bash
4
- aery --mode json "Your prompt"
4
+ pi --mode json "Your prompt"
5
5
  ```
6
6
 
7
- Outputs all session events as JSON lines to stdout. Useful for integrating aery into other tools or custom UIs.
7
+ Outputs all session events as JSON lines to stdout. Useful for integrating pi into other tools or custom UIs.
8
8
 
9
9
  ## Event Types
10
10
 
11
- Events are defined in [`AgentSessionEvent`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
11
+ Events are defined in [`AgentSessionEvent`](https://github.com/eminent337/aery/blob/main/packages/coding-agent/src/core/agent-session.ts#L102):
12
12
 
13
13
  ```typescript
14
14
  type AgentSessionEvent =
@@ -22,7 +22,7 @@ type AgentSessionEvent =
22
22
 
23
23
  `queue_update` emits the full pending steering and follow-up queues whenever they change. `compaction_start` and `compaction_end` cover both manual and automatic compaction.
24
24
 
25
- Base events from [`AgentEvent`](https://github.com/badlogic/pi-mono/blob/main/packages/agent/src/types.ts#L179):
25
+ Base events from [`AgentEvent`](https://github.com/eminent337/aery/blob/main/packages/agent/src/types.ts#L179):
26
26
 
27
27
  ```typescript
28
28
  type AgentEvent =
@@ -44,12 +44,12 @@ type AgentEvent =
44
44
 
45
45
  ## Message Types
46
46
 
47
- Base messages from [`packages/ai/src/types.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/types.ts#L134):
47
+ Base messages from [`packages/ai/src/types.ts`](https://github.com/eminent337/aery/blob/main/packages/ai/src/types.ts#L134):
48
48
  - `UserMessage` (line 134)
49
49
  - `AssistantMessage` (line 140)
50
50
  - `ToolResultMessage` (line 152)
51
51
 
52
- Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/src/core/messages.ts#L29):
52
+ Extended messages from [`packages/coding-agent/src/core/messages.ts`](https://github.com/eminent337/aery/blob/main/packages/coding-agent/src/core/messages.ts#L29):
53
53
  - `BashExecutionMessage` (line 29)
54
54
  - `CustomMessage` (line 46)
55
55
  - `BranchSummaryMessage` (line 55)
@@ -78,5 +78,5 @@ Followed by events as they occur:
78
78
  ## Example
79
79
 
80
80
  ```bash
81
- aery --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
81
+ pi --mode json "List files" 2>/dev/null | jq -c 'select(.type == "message_end")'
82
82
  ```
@@ -2,11 +2,11 @@
2
2
 
3
3
  All keyboard shortcuts can be customized via `~/.aery/agent/keybindings.json`. Each action can be bound to one or more keys.
4
4
 
5
- The config file uses the same namespaced keybinding ids that The agent uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
5
+ The config file uses the same namespaced keybinding ids that pi uses internally and that extension authors use in `keyHint()` and injected `keybindings` managers.
6
6
 
7
7
  Older configs using pre-namespaced ids such as `cursorUp` or `expandTools` are migrated automatically to the namespaced ids on startup.
8
8
 
9
- After editing `keybindings.json`, run `/reload` in aery to apply the changes without restarting the session.
9
+ After editing `keybindings.json`, run `/reload` in pi to apply the changes without restarting the session.
10
10
 
11
11
  ## Key Format
12
12
 
@@ -165,7 +165,7 @@ Create `~/.aery/agent/keybindings.json`:
165
165
 
166
166
  Each action can have a single key or an array of keys. User config overrides defaults.
167
167
 
168
- On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, aery shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
168
+ On native Windows, `app.suspend` has no default binding because Windows terminals do not support Unix job control. If you bind it manually, pi shows a status message instead of suspending. In WSL, the normal Linux `ctrl+z`/`fg` behavior still applies.
169
169
 
170
170
  ### Emacs Example
171
171
 
package/docs/models.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.aery/agent/models.json`.
4
4
 
5
- If you only need a standard OpenAI-compatible endpoint with a custom base URL, model ID, and API key, you can use `/login` -> `Use an API key` -> `Custom OpenAI-compatible` and let aery write the files for you.
6
-
7
5
  ## Table of Contents
8
6
 
9
7
  - [Minimal Example](#minimal-example)
@@ -38,7 +36,7 @@ For local models (Ollama, LM Studio, vLLM), only `id` is required per model:
38
36
 
39
37
  The `apiKey` is required but Ollama ignores it, so any value works.
40
38
 
41
- Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so aery sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
39
+ Some OpenAI-compatible servers do not understand the `developer` role used for reasoning-capable models. For those providers, set `compat.supportsDeveloperRole` to `false` so pi sends the system prompt as a `system` message instead. If the server also does not support `reasoning_effort`, set `compat.supportsReasoningEffort` to `false` too.
42
40
 
43
41
  You can set `compat` at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
44
42
 
@@ -161,7 +159,7 @@ The `apiKey` and `headers` fields support three formats:
161
159
  "apiKey": "sk-..."
162
160
  ```
163
161
 
164
- For `models.json`, shell commands are resolved at request time. aery intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and aery cannot infer the right one.
162
+ For `models.json`, shell commands are resolved at request time. pi intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and pi cannot infer the right one.
165
163
 
166
164
  If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.
167
165
 
@@ -194,6 +192,7 @@ If your command is slow, expensive, rate-limited, or should keep using a previou
194
192
  | `name` | No | `id` | Human-readable model label. Used for matching (`--model` patterns) and shown in model details/status text. |
195
193
  | `api` | No | provider's `api` | Override provider's API for this model |
196
194
  | `reasoning` | No | `false` | Supports extended thinking |
195
+ | `thinkingLevelMap` | No | omitted | Maps pi thinking levels to provider values and marks unsupported levels (see below) |
197
196
  | `input` | No | `["text"]` | Input types: `["text"]` or `["text", "image"]` |
198
197
  | `contextWindow` | No | `128000` | Context window size in tokens |
199
198
  | `maxTokens` | No | `16384` | Maximum output tokens |
@@ -204,6 +203,48 @@ Current behavior:
204
203
  - `/model` and `--list-models` list entries by model `id`.
205
204
  - The configured `name` is used for model matching and detail/status text.
206
205
 
206
+ ### Thinking Level Map
207
+
208
+ Use `thinkingLevelMap` on a model to describe model-specific thinking controls. Keys are pi thinking levels: `off`, `minimal`, `low`, `medium`, `high`, `xhigh`.
209
+
210
+ Values are tristate:
211
+
212
+ | Value | Meaning |
213
+ |-------|---------|
214
+ | omitted | Level is supported and uses the provider's default mapping |
215
+ | string | Level is supported and this value is sent to the provider |
216
+ | `null` | Level is unsupported and hidden/skipped/clamped away |
217
+
218
+ Example for a model that only supports off, high, and max reasoning:
219
+
220
+ ```json
221
+ {
222
+ "id": "deepseek-v4-pro",
223
+ "reasoning": true,
224
+ "thinkingLevelMap": {
225
+ "minimal": null,
226
+ "low": null,
227
+ "medium": null,
228
+ "high": "high",
229
+ "xhigh": "max"
230
+ }
231
+ }
232
+ ```
233
+
234
+ Example for a model where thinking cannot be disabled:
235
+
236
+ ```json
237
+ {
238
+ "id": "always-thinking-model",
239
+ "reasoning": true,
240
+ "thinkingLevelMap": {
241
+ "off": null
242
+ }
243
+ }
244
+ ```
245
+
246
+ Migration: older configs that used `compat.reasoningEffortMap` should move that mapping to model-level `thinkingLevelMap`. Use `null` for levels that should not appear in the UI.
247
+
207
248
  ## Overriding Built-in Providers
208
249
 
209
250
  Route a built-in provider through a proxy without redefining models:
@@ -276,7 +317,7 @@ Behavior notes:
276
317
 
277
318
  For providers or proxies using `api: "anthropic-messages"`, use `compat.supportsEagerToolInputStreaming` to control Anthropic fine-grained tool streaming compatibility.
278
319
 
279
- By default aery sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Aery will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
320
+ By default pi sends per-tool `eager_input_streaming: true`. If a proxy or Anthropic-compatible backend rejects that field, set `supportsEagerToolInputStreaming` to `false`. Pi will omit `tools[].eager_input_streaming` and send the legacy `fine-grained-tool-streaming-2025-05-14` beta header for tool-enabled requests instead.
280
321
 
281
322
  ```json
282
323
  {
@@ -334,21 +375,20 @@ For providers with partial OpenAI compatibility, use the `compat` field.
334
375
  | `supportsStore` | Provider supports `store` field |
335
376
  | `supportsDeveloperRole` | Use `developer` vs `system` role |
336
377
  | `supportsReasoningEffort` | Support for `reasoning_effort` parameter |
337
- | `reasoningEffortMap` | Map aery thinking levels to provider-specific `reasoning_effort` values |
338
378
  | `supportsUsageInStreaming` | Supports `stream_options: { include_usage: true }` (default: `true`) |
339
379
  | `maxTokensField` | Use `max_completion_tokens` or `max_tokens` |
340
380
  | `requiresToolResultName` | Include `name` on tool result messages |
341
381
  | `requiresAssistantAfterToolResult` | Insert an assistant message before a user message after tool results |
342
382
  | `requiresThinkingAsText` | Convert thinking blocks to plain text |
343
383
  | `requiresReasoningContentOnAssistantMessages` | Include empty `reasoning_content` on all replayed assistant messages when reasoning is enabled |
344
- | `thinkingFormat` | Use `reasoning_effort`, `deepseek`, `zai`, `qwen`, or `qwen-chat-template` thinking parameters |
384
+ | `thinkingFormat` | Use `reasoning_effort`, `openrouter`, `deepseek`, `together`, `zai`, `qwen`, or `qwen-chat-template` thinking parameters |
345
385
  | `cacheControlFormat` | Use Anthropic-style `cache_control` markers on the system prompt, last tool definition, and last user/assistant text content. Currently only `anthropic` is supported. |
346
386
  | `supportsStrictMode` | Include the `strict` field in tool definitions |
347
387
  | `supportsLongCacheRetention` | Whether the provider accepts long cache retention when cache retention is `long`: `prompt_cache_retention: "24h"` for OpenAI prompt caching, or `cache_control.ttl: "1h"` when `cacheControlFormat` is `anthropic`. Default: `true`. |
348
388
  | `openRouterRouting` | OpenRouter provider routing preferences. This object is sent as-is in the `provider` field of the [OpenRouter API request](https://openrouter.ai/docs/guides/routing/provider-selection). |
349
389
  | `vercelGatewayRouting` | Vercel AI Gateway routing config for provider selection (`only`, `order`) |
350
390
 
351
- `qwen` uses top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that require `chat_template_kwargs.enable_thinking`.
391
+ `openrouter` uses `reasoning: { effort }`. `together` uses `reasoning: { enabled }` and also `reasoning_effort` when `supportsReasoningEffort` is enabled. `qwen` uses top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that require `chat_template_kwargs.enable_thinking`.
352
392
 
353
393
  `cacheControlFormat: "anthropic"` is for OpenAI-compatible providers that expose Anthropic-style prompt caching through `cache_control` markers on text content and tool definitions.
354
394
 
package/docs/packages.md CHANGED
@@ -1,14 +1,14 @@
1
- > aery can help you create aery packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
1
+ > pi can help you create pi packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
2
2
 
3
3
  # Pi Packages
4
4
 
5
- aery packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `aery` key, or use conventional directories.
5
+ Pi packages bundle extensions, skills, prompt templates, and themes so you can share them through npm or git. A package can declare resources in `package.json` under the `pi` key, or use conventional directories.
6
6
 
7
7
  ## Table of Contents
8
8
 
9
9
  - [Install and Manage](#install-and-manage)
10
10
  - [Package Sources](#package-sources)
11
- - [Creating an aery Package](#creating-a-aery-package)
11
+ - [Creating a Pi Package](#creating-a-pi-package)
12
12
  - [Package Structure](#package-structure)
13
13
  - [Dependencies](#dependencies)
14
14
  - [Package Filtering](#package-filtering)
@@ -17,32 +17,37 @@ aery packages bundle extensions, skills, prompt templates, and themes so you can
17
17
 
18
18
  ## Install and Manage
19
19
 
20
- > **Security:** aery 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.
20
+ > **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.
21
21
 
22
22
  ```bash
23
- aery install npm:@foo/bar@1.0.0
24
- aery install git:github.com/user/repo@v1
25
- aery install https://github.com/user/repo # raw URLs work too
26
- aery install /absolute/path/to/package
27
- aery install ./relative/path/to/package
28
-
29
- aery remove npm:@foo/bar
30
- aery list # show installed packages from settings
31
- aery update # update all non-pinned packages
23
+ pi install npm:@foo/bar@1.0.0
24
+ pi install git:github.com/user/repo@v1
25
+ pi install https://github.com/user/repo # raw URLs work too
26
+ pi install /absolute/path/to/package
27
+ pi install ./relative/path/to/package
28
+
29
+ pi remove npm:@foo/bar
30
+ pi list # show installed packages from settings
31
+ pi update # update pi and all non-pinned packages
32
+ pi update --extensions # update all non-pinned packages only
33
+ pi update --self # update pi only
34
+ pi update --self --force # reinstall pi even if current
35
+ pi update npm:@foo/bar # update one package
36
+ pi update --extension npm:@foo/bar
32
37
  ```
33
38
 
34
- By default, `install` and `remove` write to global settings (`~/.aery/agent/settings.json`). Use `-l` to write to project settings (`.aery/settings.json`) instead. Project settings can be shared with your team, and aery installs any missing packages automatically on startup.
39
+ By default, `install` and `remove` write to global settings (`~/.aery/agent/settings.json`). Use `-l` to write to project settings (`.aery/settings.json`) instead. Project settings can be shared with your team, and pi installs any missing packages automatically on startup.
35
40
 
36
41
  To try a package without installing it, use `--extension` or `-e`. This installs to a temporary directory for the current run only:
37
42
 
38
43
  ```bash
39
- aery -e npm:@foo/bar
40
- aery -e git:github.com/user/repo
44
+ pi -e npm:@foo/bar
45
+ pi -e git:github.com/user/repo
41
46
  ```
42
47
 
43
48
  ## Package Sources
44
49
 
45
- Pi accepts three source types in settings and `aery install`.
50
+ Pi accepts three source types in settings and `pi install`.
46
51
 
47
52
  ### npm
48
53
 
@@ -51,7 +56,7 @@ npm:@scope/pkg@1.2.3
51
56
  npm:pkg
52
57
  ```
53
58
 
54
- - Versioned specs are pinned and skipped by `aery update`.
59
+ - Versioned specs are pinned and skipped by package updates (`pi update`, `pi update --extensions`).
55
60
  - Global installs use `npm install -g`.
56
61
  - Project installs go under `.aery/npm/`.
57
62
  - Set `npmCommand` in `settings.json` to pin npm package lookup and install operations to a specific wrapper command such as `mise` or `asdf`.
@@ -78,20 +83,20 @@ ssh://git@github.com/user/repo@v1
78
83
  - HTTPS and SSH URLs are both supported.
79
84
  - SSH URLs use your configured SSH keys automatically (respects `~/.ssh/config`).
80
85
  - For non-interactive runs (for example CI), you can set `GIT_TERMINAL_PROMPT=0` to disable credential prompts and set `GIT_SSH_COMMAND` (for example `ssh -o BatchMode=yes -o ConnectTimeout=5`) to fail fast.
81
- - Refs pin the package and skip `aery update`.
86
+ - Refs pin the package and skip package updates (`pi update`, `pi update --extensions`).
82
87
  - Cloned to `~/.aery/agent/git/<host>/<path>` (global) or `.aery/git/<host>/<path>` (project).
83
88
  - Runs `npm install` after clone or pull if `package.json` exists.
84
89
 
85
90
  **SSH examples:**
86
91
  ```bash
87
92
  # git@host:path shorthand (requires git: prefix)
88
- aery install git:git@github.com:user/repo
93
+ pi install git:git@github.com:user/repo
89
94
 
90
95
  # ssh:// protocol format
91
- aery install ssh://git@github.com/user/repo
96
+ pi install ssh://git@github.com/user/repo
92
97
 
93
98
  # With version ref
94
- aery install git:git@github.com:user/repo@v1.0.0
99
+ pi install git:git@github.com:user/repo@v1.0.0
95
100
  ```
96
101
 
97
102
  ### Local Paths
@@ -101,17 +106,17 @@ aery install git:git@github.com:user/repo@v1.0.0
101
106
  ./relative/path/to/package
102
107
  ```
103
108
 
104
- Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, aery loads resources using package rules.
109
+ Local paths point to files or directories on disk and are added to settings without copying. Relative paths are resolved against the settings file they appear in. If the path is a file, it loads as a single extension. If it is a directory, pi loads resources using package rules.
105
110
 
106
- ## Creating an aery Package
111
+ ## Creating a Pi Package
107
112
 
108
- Add an `aery` manifest to `package.json` or use conventional directories. Include the `aery-package` keyword for discoverability.
113
+ Add a `pi` manifest to `package.json` or use conventional directories. Include the `pi-package` keyword for discoverability.
109
114
 
110
115
  ```json
111
116
  {
112
117
  "name": "my-package",
113
- "keywords": ["aery-package"],
114
- "aery": {
118
+ "keywords": ["pi-package"],
119
+ "pi": {
115
120
  "extensions": ["./extensions"],
116
121
  "skills": ["./skills"],
117
122
  "prompts": ["./prompts"],
@@ -124,13 +129,13 @@ Paths are relative to the package root. Arrays support glob patterns and `!exclu
124
129
 
125
130
  ### Gallery Metadata
126
131
 
127
- The [package gallery](https://aery.dev/packages) displays packages tagged with `aery-package`. Add `video` or `image` fields to show a preview:
132
+ The [package gallery](https://eminent337.github.io/packages) displays packages tagged with `pi-package`. Add `video` or `image` fields to show a preview:
128
133
 
129
134
  ```json
130
135
  {
131
136
  "name": "my-package",
132
- "keywords": ["aery-package"],
133
- "aery": {
137
+ "keywords": ["pi-package"],
138
+ "pi": {
134
139
  "extensions": ["./extensions"],
135
140
  "video": "https://example.com/demo.mp4",
136
141
  "image": "https://example.com/screenshot.png"
@@ -147,7 +152,7 @@ If both are set, video takes precedence.
147
152
 
148
153
  ### Convention Directories
149
154
 
150
- If no `aery` manifest is present, aery auto-discovers resources from these directories:
155
+ If no `pi` manifest is present, pi auto-discovers resources from these directories:
151
156
 
152
157
  - `extensions/` loads `.ts` and `.js` files
153
158
  - `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
@@ -156,11 +161,11 @@ If no `aery` manifest is present, aery auto-discovers resources from these direc
156
161
 
157
162
  ## Dependencies
158
163
 
159
- Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When aery installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
164
+ Third party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, or themes also belong in `dependencies`. When pi installs a package from npm or git, it runs `npm install`, so those dependencies are installed automatically.
160
165
 
161
- Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@eminent337/aery-ai`, `@eminent337/aery-core`, `@eminent337/aery`, `@eminent337/aery-tui`, `@sinclair/typebox`.
166
+ Pi bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@eminent337/aery-ai`, `@eminent337/aery-core`, `@eminent337/aery`, `@eminent337/aery-tui`, `typebox`.
162
167
 
163
- Other aery packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.
168
+ Other pi packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Pi loads packages with separate module roots, so separate installs do not collide or share modules.
164
169
 
165
170
  Example:
166
171
 
@@ -170,7 +175,7 @@ Example:
170
175
  "shitty-extensions": "^1.0.1"
171
176
  },
172
177
  "bundledDependencies": ["shitty-extensions"],
173
- "aery": {
178
+ "pi": {
174
179
  "extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
175
180
  "skills": ["skills", "node_modules/shitty-extensions/skills"]
176
181
  }
@@ -207,7 +212,7 @@ Filter what a package loads using the object form in settings:
207
212
 
208
213
  ## Enable and Disable Resources
209
214
 
210
- Use `aery config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.aery/agent`) and project (`.aery/`) scopes.
215
+ Use `pi config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.aery/agent`) and project (`.pi/`) scopes.
211
216
 
212
217
  ## Scope and Deduplication
213
218
 
@@ -1,4 +1,4 @@
1
- > aery can create prompt templates. Ask it to build one for your workflow.
1
+ > pi can create prompt templates. Ask it to build one for your workflow.
2
2
 
3
3
  # Prompt Templates
4
4
 
@@ -10,7 +10,7 @@ Pi loads prompt templates from:
10
10
 
11
11
  - Global: `~/.aery/agent/prompts/*.md`
12
12
  - Project: `.aery/prompts/*.md`
13
- - Packages: `prompts/` directories or `aery.prompts` entries in `package.json`
13
+ - Packages: `prompts/` directories or `pi.prompts` entries in `package.json`
14
14
  - Settings: `prompts` array with files or directories
15
15
  - CLI: `--prompt-template <path>` (repeatable)
16
16
 
package/docs/providers.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Providers
2
2
 
3
- Aery supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, aery knows all available models. The list is updated with every aery release.
4
-
5
- > Provider support is shared across the ecosystem. [pi](https://github.com/badlogic/pi-mono), [Aery](https://github.com/eminent337/aery), [openclaude](https://github.com/Gitlawb/openclaude), and [opencode](https://github.com/sst/opencode) all support similar provider configurations.
3
+ Pi supports subscription-based providers via OAuth and API key providers via environment variables or auth file. For each provider, pi knows all available models. The list is updated with every pi release.
6
4
 
7
5
  ## Table of Contents
8
6
 
@@ -17,30 +15,25 @@ Aery supports subscription-based providers via OAuth and API key providers via e
17
15
 
18
16
  Use `/login` in interactive mode, then select a provider:
19
17
 
20
- - Claude Pro/Max
21
18
  - ChatGPT Plus/Pro (Codex)
19
+ - Claude Pro/Max
22
20
  - GitHub Copilot
23
- - Google Gemini CLI
24
- - Google Antigravity
25
21
 
26
22
  Use `/logout` to clear credentials. Tokens are stored in `~/.aery/agent/auth.json` and auto-refresh when expired.
27
23
 
28
- ### GitHub Copilot
24
+ ### OpenAI Codex
29
25
 
30
- - Press Enter for github.com, or enter your GitHub Enterprise Server domain
31
- - If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
26
+ - Requires ChatGPT Plus or Pro subscription
27
+ - Officially endorsed by OpenAI: [Codex for OSS](https://developers.openai.com/community/codex-for-oss)
32
28
 
33
- ### Google Providers
29
+ ### Claude Pro/Max
34
30
 
35
- - **Gemini CLI**: Standard Gemini models via Cloud Code Assist
36
- - **Antigravity**: Sandbox with Gemini 3, Claude, and GPT-OSS models
37
- - Both free with any Google account, subject to rate limits
38
- - For paid Cloud Code Assist: set `GOOGLE_CLOUD_PROJECT` env var
31
+ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party harness usage draws from [extra usage](https://claude.ai/settings/usage) and is billed per token, not against Claude plan limits.
39
32
 
40
- ### OpenAI Codex
33
+ ### GitHub Copilot
41
34
 
42
- - Requires ChatGPT Plus or Pro subscription
43
- - Personal use only; for production, use the OpenAI Platform API
35
+ - Press Enter for github.com, or enter your GitHub Enterprise Server domain
36
+ - If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
44
37
 
45
38
  ## API Keys
46
39
 
@@ -50,7 +43,7 @@ Use `/login` in interactive mode and select a provider to store an API key in `a
50
43
 
51
44
  ```bash
52
45
  export ANTHROPIC_API_KEY=sk-ant-...
53
- aery
46
+ pi
54
47
  ```
55
48
 
56
49
  | Provider | Environment Variable | `auth.json` key |
@@ -63,6 +56,7 @@ aery
63
56
  | Mistral | `MISTRAL_API_KEY` | `mistral` |
64
57
  | Groq | `GROQ_API_KEY` | `groq` |
65
58
  | Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
59
+ | Cloudflare AI Gateway | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`, `CLOUDFLARE_GATEWAY_ID`) | `cloudflare-ai-gateway` |
66
60
  | Cloudflare Workers AI | `CLOUDFLARE_API_KEY` (+ `CLOUDFLARE_ACCOUNT_ID`) | `cloudflare-workers-ai` |
67
61
  | xAI | `XAI_API_KEY` | `xai` |
68
62
  | OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
@@ -72,11 +66,16 @@ aery
72
66
  | OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
73
67
  | Hugging Face | `HF_TOKEN` | `huggingface` |
74
68
  | Fireworks | `FIREWORKS_API_KEY` | `fireworks` |
69
+ | Together AI | `TOGETHER_API_KEY` | `together` |
75
70
  | Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
76
71
  | MiniMax | `MINIMAX_API_KEY` | `minimax` |
77
72
  | MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
73
+ | Xiaomi MiMo | `XIAOMI_API_KEY` | `xiaomi` |
74
+ | Xiaomi MiMo Token Plan (China) | `XIAOMI_TOKEN_PLAN_CN_API_KEY` | `xiaomi-token-plan-cn` |
75
+ | Xiaomi MiMo Token Plan (Amsterdam) | `XIAOMI_TOKEN_PLAN_AMS_API_KEY` | `xiaomi-token-plan-ams` |
76
+ | Xiaomi MiMo Token Plan (Singapore) | `XIAOMI_TOKEN_PLAN_SGP_API_KEY` | `xiaomi-token-plan-sgp` |
78
77
 
79
- Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
78
+ Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/eminent337/aery/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/eminent337/aery/blob/main/packages/ai/src/env-api-keys.ts).
80
79
 
81
80
  #### Auth File
82
81
 
@@ -89,22 +88,17 @@ Store credentials in `~/.aery/agent/auth.json`:
89
88
  "deepseek": { "type": "api_key", "key": "sk-..." },
90
89
  "google": { "type": "api_key", "key": "..." },
91
90
  "opencode": { "type": "api_key", "key": "..." },
92
- "opencode-go": { "type": "api_key", "key": "..." }
91
+ "opencode-go": { "type": "api_key", "key": "..." },
92
+ "together": { "type": "api_key", "key": "..." },
93
+ "xiaomi": { "type": "api_key", "key": "..." },
94
+ "xiaomi-token-plan-cn": { "type": "api_key", "key": "..." },
95
+ "xiaomi-token-plan-ams": { "type": "api_key", "key": "..." },
96
+ "xiaomi-token-plan-sgp": { "type": "api_key", "key": "..." }
93
97
  }
94
98
  ```
95
99
 
96
100
  The file is created with `0600` permissions (user read/write only). Auth file credentials take priority over environment variables.
97
101
 
98
- ### Custom OpenAI-compatible setup
99
-
100
- For OpenAI-compatible endpoints that need a custom base URL and model ID, run `/login`, choose `Use an API key`, then choose `Custom OpenAI-compatible`.
101
-
102
- Aery saves:
103
- - provider structure in `~/.aery/agent/models.json`
104
- - API key in `~/.aery/agent/auth.json`
105
-
106
- This covers common proxy and self-hosted endpoints without needing the provider extension path.
107
-
108
102
  ### Key Resolution
109
103
 
110
104
  The `key` field supports three formats:
@@ -138,7 +132,7 @@ export AZURE_OPENAI_BASE_URL=https://your-resource.openai.azure.com
138
132
  export AZURE_OPENAI_RESOURCE_NAME=your-resource
139
133
 
140
134
  # Optional
141
- export AZURE_OPENAI_API_VERSION=2024-02-01
135
+ export AZURE_OPENAI_AAERY_VERSION=2024-02-01
142
136
  export AZURE_OPENAI_DEPLOYMENT_NAME_MAP=gpt-4=my-gpt4,gpt-4o=my-gpt4o
143
137
  ```
144
138
 
@@ -162,14 +156,14 @@ export AWS_REGION=us-west-2
162
156
  Also supports ECS task roles (`AWS_CONTAINER_CREDENTIALS_*`) and IRSA (`AWS_WEB_IDENTITY_TOKEN_FILE`).
163
157
 
164
158
  ```bash
165
- aery --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
159
+ pi --provider amazon-bedrock --model us.anthropic.claude-sonnet-4-20250514-v1:0
166
160
  ```
167
161
 
168
162
  Prompt caching is enabled automatically for Claude models whose ID contains a recognizable model name (base models and system-defined inference profiles). For application inference profiles (whose ARNs don't contain the model name), set `AWS_BEDROCK_FORCE_CACHE=1` to enable cache points:
169
163
 
170
164
  ```bash
171
165
  export AWS_BEDROCK_FORCE_CACHE=1
172
- aery --provider amazon-bedrock --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc123
166
+ pi --provider amazon-bedrock --model arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc123
173
167
  ```
174
168
 
175
169
  If you are connecting to a Bedrock API proxy, the following environment variables can be used:
@@ -185,6 +179,30 @@ export AWS_BEDROCK_SKIP_AUTH=1
185
179
  export AWS_BEDROCK_FORCE_HTTP1=1
186
180
  ```
187
181
 
182
+ ### Cloudflare AI Gateway
183
+
184
+ `CLOUDFLARE_API_KEY` can be set via `/login`. The account ID and gateway slug must be set as environment variables.
185
+
186
+ ```bash
187
+ export CLOUDFLARE_API_KEY=... # or use /login
188
+ export CLOUDFLARE_ACCOUNT_ID=...
189
+ export CLOUDFLARE_GATEWAY_ID=... # create at dash.cloudflare.com → AI → AI Gateway
190
+ pi --provider cloudflare-ai-gateway --model "claude-sonnet-4-5"
191
+ ```
192
+
193
+ Routes to OpenAI, Anthropic, and Workers AI through Cloudflare AI Gateway. Workers AI uses the Unified API (`/compat`) and prefixed model IDs (`workers-ai/@cf/...`). OpenAI uses the OpenAI passthrough route (`/openai`) with native OpenAI model IDs such as `gpt-5.1`. Anthropic uses the Anthropic passthrough route (`/anthropic`) with native Anthropic model IDs such as `claude-sonnet-4-5`.
194
+
195
+ AI Gateway authentication uses `CLOUDFLARE_API_KEY` as `cf-aig-authorization`. Upstream authentication can be one of:
196
+
197
+ | Mode | Request auth | Upstream auth |
198
+ |------|--------------|---------------|
199
+ | Workers AI | Cloudflare token only | Cloudflare-native |
200
+ | Unified billing | Cloudflare token only | Cloudflare handles upstream auth and deducts credits |
201
+ | Stored BYOK | Cloudflare token only | Cloudflare injects provider keys stored in the AI Gateway dashboard |
202
+ | Inline BYOK | Cloudflare token plus upstream `Authorization` header | The request supplies the upstream provider key |
203
+
204
+ For normal pi usage, prefer unified billing or stored BYOK. Inline BYOK requires configuring an additional upstream `Authorization` header for the Cloudflare AI Gateway provider, for example via a `models.json` provider/model override.
205
+
188
206
  ### Cloudflare Workers AI
189
207
 
190
208
  `CLOUDFLARE_API_KEY` can be set via `/login`. `CLOUDFLARE_ACCOUNT_ID` must be set as an environment variable.
@@ -192,7 +210,7 @@ export AWS_BEDROCK_FORCE_HTTP1=1
192
210
  ```bash
193
211
  export CLOUDFLARE_API_KEY=... # or use /login
194
212
  export CLOUDFLARE_ACCOUNT_ID=...
195
- aery --provider cloudflare-workers-ai --model "@cf/moonshotai/kimi-k2.6"
213
+ pi --provider cloudflare-workers-ai --model "@cf/moonshotai/kimi-k2.6"
196
214
  ```
197
215
 
198
216
  Pi automatically sets `x-session-affinity` for [prefix caching](https://developers.cloudflare.com/workers-ai/features/prompt-caching/) discounts.
@@ -211,8 +229,6 @@ Or set `GOOGLE_APPLICATION_CREDENTIALS` to a service account key file.
211
229
 
212
230
  ## Custom Providers
213
231
 
214
- **Via `/login`:** Use the built-in `Custom OpenAI-compatible` flow for endpoints that need `baseUrl + model ID + API key`.
215
-
216
232
  **Via models.json:** Add Ollama, LM Studio, vLLM, or any provider that speaks a supported API (OpenAI Completions, OpenAI Responses, Anthropic Messages, Google Generative AI). See [models.md](models.md).
217
233
 
218
234
  **Via extensions:** For providers that need custom API implementations or OAuth flows, create an extension. See [custom-provider.md](custom-provider.md) and [examples/extensions/custom-provider-gitlab-duo](../examples/extensions/custom-provider-gitlab-duo/).