@phi-code-admin/phi-code 0.85.0 → 0.87.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +92 -123
  3. package/config/routing.example.json +129 -0
  4. package/config/routing.schema.json +58 -0
  5. package/dist/cli/args.d.ts.map +1 -1
  6. package/dist/cli/args.js +1 -1
  7. package/dist/cli/args.js.map +1 -1
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/config.js +1 -1
  10. package/dist/config.js.map +1 -1
  11. package/dist/core/sdk.d.ts.map +1 -1
  12. package/dist/core/sdk.js +1 -1
  13. package/dist/core/sdk.js.map +1 -1
  14. package/dist/core/system-prompt.d.ts.map +1 -1
  15. package/dist/core/system-prompt.js +6 -6
  16. package/dist/core/system-prompt.js.map +1 -1
  17. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  18. package/dist/modes/interactive/components/config-selector.js +1 -1
  19. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  20. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  21. package/dist/modes/interactive/interactive-mode.js +2 -2
  22. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  23. package/dist/package-manager-cli.d.ts.map +1 -1
  24. package/dist/package-manager-cli.js +9 -8
  25. package/dist/package-manager-cli.js.map +1 -1
  26. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  27. package/dist/utils/pi-user-agent.js +4 -1
  28. package/dist/utils/pi-user-agent.js.map +1 -1
  29. package/docs/compaction.md +11 -11
  30. package/docs/custom-provider.md +4 -4
  31. package/docs/development.md +2 -2
  32. package/docs/extensions.md +47 -47
  33. package/docs/fork-policy.md +81 -0
  34. package/docs/index.md +7 -7
  35. package/docs/json.md +3 -3
  36. package/docs/keybindings.md +5 -5
  37. package/docs/models.md +6 -6
  38. package/docs/packages.md +37 -37
  39. package/docs/prompt-templates.md +4 -4
  40. package/docs/providers.md +9 -9
  41. package/docs/quickstart.md +25 -25
  42. package/docs/rpc.md +3 -3
  43. package/docs/sdk.md +34 -34
  44. package/docs/session-format.md +4 -4
  45. package/docs/sessions.md +11 -11
  46. package/docs/settings.md +9 -9
  47. package/docs/shell-aliases.md +2 -2
  48. package/docs/skills.md +9 -9
  49. package/docs/terminal-setup.md +7 -7
  50. package/docs/termux.md +6 -6
  51. package/docs/themes.md +9 -9
  52. package/docs/tmux.md +3 -3
  53. package/docs/tui.md +8 -8
  54. package/docs/usage.md +39 -39
  55. package/docs/windows.md +2 -2
  56. package/extensions/phi/agents.ts +12 -117
  57. package/extensions/phi/benchmark.ts +129 -49
  58. package/extensions/phi/browser.ts +10 -37
  59. package/extensions/phi/btw/btw.ts +1 -7
  60. package/extensions/phi/chrome/index.ts +1283 -741
  61. package/extensions/phi/commit.ts +9 -14
  62. package/extensions/phi/goal/index.ts +10 -33
  63. package/extensions/phi/init.ts +37 -47
  64. package/extensions/phi/keys.ts +2 -7
  65. package/extensions/phi/mcp/callback-server.ts +162 -165
  66. package/extensions/phi/mcp/config.ts +122 -136
  67. package/extensions/phi/mcp/errors.ts +18 -23
  68. package/extensions/phi/mcp/index.ts +322 -355
  69. package/extensions/phi/mcp/oauth-provider.ts +289 -289
  70. package/extensions/phi/mcp/server-manager.ts +390 -413
  71. package/extensions/phi/mcp/tool-bridge.ts +381 -415
  72. package/extensions/phi/memory.ts +2 -2
  73. package/extensions/phi/models.ts +27 -26
  74. package/extensions/phi/orchestrator.ts +343 -266
  75. package/extensions/phi/productivity.ts +4 -2
  76. package/extensions/phi/providers/agent-def.ts +128 -0
  77. package/extensions/phi/providers/alibaba.ts +56 -7
  78. package/extensions/phi/providers/context-window.ts +4 -1
  79. package/extensions/phi/providers/live-models.ts +5 -20
  80. package/extensions/phi/providers/orchestrator-helpers.ts +19 -5
  81. package/extensions/phi/providers/phase-machine.ts +220 -0
  82. package/extensions/phi/setup.ts +196 -169
  83. package/extensions/phi/skill-loader.ts +18 -21
  84. package/extensions/phi/smart-router.ts +6 -6
  85. package/extensions/phi/web-search.ts +90 -50
  86. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,88 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.87.0] - 2026-07-10
4
+
5
+ ### Added
6
+
7
+ - **The /plan orchestrator's phase state machine is now unit-tested.** Its
8
+ decision core — what to do after each phase given the messages and the report
9
+ (user abort > auth error > transient retry > BLOCKED pause > review-FAIL fix
10
+ cycle > continue) — is extracted into a pure module
11
+ (`extensions/phi/providers/phase-machine.ts`) and covered by 32 tests,
12
+ including the cases where a model deviates from the text contract: a missing
13
+ or unparseable `VERDICT:` line is now surfaced to the user instead of being
14
+ silently treated as a pass, and zero-tool-call / queue-race paths are pinned.
15
+ The `agent_end` hook keeps the exact same behavior but now only interprets
16
+ the decision (I/O), it no longer decides.
17
+ - **Section parsing tolerates the header shapes models actually emit.**
18
+ `extractSection` (HANDOFF / BLOCKING) now handles a markdown heading, a
19
+ standalone bold label (`**HANDOFF**`) or a plain `LABEL:` line, and splits a
20
+ report written entirely with bold labels — previously a bold-only `**HANDOFF**`
21
+ returned nothing. Added regression tests for these deviations.
22
+
23
+ ### Changed
24
+
25
+ - **extensions/ and the sigma-\* packages are now linted.** Biome previously
26
+ skipped them entirely (typecheck covered them, lint did not); they are in the
27
+ linted set and the whole repo is clean (`biome ci .` passes on 752 files,
28
+ zero warnings). Idiomatic-but-flagged regex-exec loops in web-search were
29
+ rewritten through an `execAll` generator rather than silenced with rule
30
+ overrides.
31
+ - **Releases are reproducible.** `npm run build` no longer regenerates the
32
+ model catalog from models.dev — the committed `packages/ai/src/*.generated.ts`
33
+ is the source of truth and `build` just compiles it, so a publish ships
34
+ exactly what is in git. Regeneration is an explicit `npm run generate
35
+ --workspace=packages/ai` step; a scheduled `refresh-models.yml` workflow
36
+ opens a PR weekly so the catalog still stays fresh with a human in the loop.
37
+
38
+ ### CI / process
39
+
40
+ - **CI now gates lint, format, types and catalog-cleanliness on every PR**
41
+ (`biome ci`, `tsgo --noEmit`, and `git diff --exit-code` on the generated
42
+ catalog), not just build + test — fork PRs that bypass the local pre-commit
43
+ hook are covered. A pull-request template makes the discipline checklist
44
+ explicit, and `docs/fork-policy.md` documents the reproducible-catalog flow.
45
+
46
+ ## [0.86.0] - 2026-07-10
47
+
48
+ ### Changed
49
+
50
+ - **Single source of truth for bundled assets.** The duplicated root-level
51
+ `agents/`, `skills/` and `config/` directories (which had silently diverged
52
+ from the published copies) are gone; `packages/coding-agent/{agents,skills,config}`
53
+ is now the only copy. Routing defaults live in `SmartRouter.defaultConfig()`
54
+ with `config/routing.example.json` + `config/routing.schema.json` as
55
+ documentation, kept in sync by a dedicated test. Agent `.md` parsing is
56
+ unified in `extensions/phi/providers/agent-def.ts`, shared by the /plan
57
+ orchestrator and the /agents command (they previously had two drifting
58
+ parsers, and /agents' bundled-agents path resolved nowhere in either
59
+ layout).
60
+ - **Rebrand completed for everything user-facing** (see the new
61
+ [docs/fork-policy.md](docs/fork-policy.md) for what deliberately stays "pi"
62
+ to keep upstream merges cheap):
63
+ - The npm README and all docs/ now document `phi`, `~/.phi/` and
64
+ `@phi-code-admin/phi-code` (they still documented upstream `pi` commands,
65
+ `~/.pi/` paths and the upstream install).
66
+ - The system prompt now introduces the agent as phi (it said "operating
67
+ inside pi", so the model described itself as pi).
68
+ - `--help`/`update` texts, the config selector's `~/.pi/` label (factually
69
+ wrong), the tmux hint, the "Location of executable" message and the HTTP
70
+ User-Agent now derive from the configured app name. `phi update pi` keeps
71
+ working as a hidden legacy alias of `update self`.
72
+ - The bun-binary fallback download link pointed at upstream Pi releases; it
73
+ now points at phi-code releases. Cloudflare attribution UA is `phi-code`.
74
+ - Docs now name the runtime env vars `PHI_CODING_AGENT_DIR` /
75
+ `PHI_CODING_AGENT_SESSION_DIR` (the `PI_*` names they documented do not
76
+ exist at runtime; all other `PI_*` variables are unchanged and stay
77
+ supported).
78
+
79
+ ### Removed
80
+
81
+ - **Dead code**: `sigma-agents` no longer ships the unused `SubAgentManager`
82
+ and `ModelProfiler` (never imported by anything; the orchestrator has its
83
+ own phase logic). Legacy root-level `_legacy/`, `pi-test.sh`, `pi-test.ps1`
84
+ and `test.sh` (which still targeted `~/.pi/`) are deleted.
85
+
3
86
  ## [0.85.0] - 2026-07-10
4
87
 
5
88
  ### Fixed
package/README.md CHANGED
@@ -1,43 +1,16 @@
1
+ <p align="center"><strong>φ phi-code</strong></p>
1
2
  <p align="center">
2
- <a href="https://pi.dev">
3
- <img alt="pi logo" src="https://pi.dev/logo-auto.svg" width="128">
4
- </a>
3
+ <a href="https://www.npmjs.com/package/@phi-code-admin/phi-code"><img alt="npm" src="https://img.shields.io/npm/v/@phi-code-admin/phi-code?style=flat-square" /></a>
4
+ <a href="https://github.com/uglyswap/phi-code"><img alt="GitHub" src="https://img.shields.io/badge/github-uglyswap%2Fphi--code-181717?style=flat-square&logo=github" /></a>
5
5
  </p>
6
- <p align="center">
7
- <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>
8
- <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>
9
- </p>
10
- <p align="center">
11
- <a href="https://pi.dev">pi.dev</a> domain graciously donated by
12
- <br /><br />
13
- <a href="https://exe.dev"><img src="docs/images/exy.png" alt="Exy mascot" width="48" /><br />exe.dev</a>
14
- </p>
15
-
16
- > New issues and PRs from new contributors are auto-closed by default. Maintainers review auto-closed issues daily. See [CONTRIBUTING.md](../../CONTRIBUTING.md).
17
6
 
18
7
  ---
19
8
 
20
- 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.
21
-
22
- 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.
23
-
24
- Pi runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps. See [openclaw/openclaw](https://github.com/openclaw/openclaw) for a real-world SDK integration.
25
-
26
- ## Share your OSS coding agent sessions
27
-
28
- If you use pi for open source work, please share your coding agent sessions.
9
+ phi-code is a terminal coding harness with persistent memory, sub-agents, intelligent model routing, and a five-phase plan orchestrator — built as a fork of [Pi](https://github.com/earendil-works/pi-mono) (see [docs/fork-policy.md](docs/fork-policy.md)). Adapt phi to your workflows, not the other way around. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Phi Packages](#phi-packages) and share them with others via npm or git.
29
10
 
30
- Public OSS session data helps improve models, prompts, tools, and evaluations using real development workflows.
11
+ Where upstream Pi deliberately skips sub agents and plan mode, phi-code ships them out of the box: `/plan` runs a five-phase explore → plan → code → test → review pipeline with per-phase models from `~/.phi/agent/routing.json`, a local vector memory (`memory_search`/`memory_write`), and a knowledge-graph ontology.
31
12
 
32
- For the full explanation, see [this post on X](https://x.com/badlogicgames/status/2037811643774652911).
33
-
34
- 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`.
35
-
36
- You can also watch [this video](https://x.com/badlogicgames/status/2041151967695634619), where I show how I publish my `pi-mono` sessions.
37
-
38
- I regularly publish my own `pi-mono` work sessions here:
39
-
40
- - [badlogicgames/pi-mono on Hugging Face](https://huggingface.co/datasets/badlogicgames/pi-mono)
13
+ phi-code runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps.
41
14
 
42
15
  ## Table of Contents
43
16
 
@@ -58,7 +31,7 @@ I regularly publish my own `pi-mono` work sessions here:
58
31
  - [Skills](#skills)
59
32
  - [Extensions](#extensions)
60
33
  - [Themes](#themes)
61
- - [Pi Packages](#pi-packages)
34
+ - [Phi Packages](#phi-packages)
62
35
  - [Programmatic Usage](#programmatic-usage)
63
36
  - [Philosophy](#philosophy)
64
37
  - [CLI Reference](#cli-reference)
@@ -68,30 +41,26 @@ I regularly publish my own `pi-mono` work sessions here:
68
41
  ## Quick Start
69
42
 
70
43
  ```bash
71
- curl -fsSL https://pi.dev/install.sh | sh
72
- ```
73
-
74
- Or with npm:
75
-
76
- ```bash
77
- npm install -g @earendil-works/pi-coding-agent
44
+ npm install -g @phi-code-admin/phi-code
78
45
  ```
79
46
 
80
47
  Authenticate with an API key:
81
48
 
82
49
  ```bash
83
50
  export ANTHROPIC_API_KEY=sk-ant-...
84
- pi
51
+ phi
85
52
  ```
86
53
 
87
54
  Or use your existing subscription:
88
55
 
89
56
  ```bash
90
- pi
57
+ phi
91
58
  /login # Then select provider
92
59
  ```
93
60
 
94
- 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).
61
+ Run `/setup` to configure providers (OpenCode Zen/Go, Alibaba Coding Plan, OpenAI, Anthropic, Google, OpenRouter, Groq, local Ollama/LM Studio) and assign per-phase models, or `/phi-init` for the guided first-run wizard.
62
+
63
+ Then just talk to phi. By default, phi 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 [phi packages](#phi-packages).
95
64
 
96
65
  **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)
97
66
 
@@ -99,7 +68,7 @@ Then just talk to pi. By default, pi gives the model four tools: `read`, `write`
99
68
 
100
69
  ## Providers & Models
101
70
 
102
- For each built-in provider, pi maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
71
+ For each built-in provider, phi maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
103
72
 
104
73
  **Subscriptions:**
105
74
  - Anthropic Claude Pro/Max
@@ -137,7 +106,7 @@ For each built-in provider, pi maintains a list of tool-capable models, updated
137
106
 
138
107
  See [docs/providers.md](docs/providers.md) for detailed setup instructions.
139
108
 
140
- **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).
109
+ **Custom providers & models:** Add providers via `~/.phi/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).
141
110
 
142
111
  ---
143
112
 
@@ -190,11 +159,11 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
190
159
  | `/reload` | Reload keybindings, extensions, skills, prompts, and context files (themes hot-reload automatically) |
191
160
  | `/hotkeys` | Show all keyboard shortcuts |
192
161
  | `/changelog` | Display version history |
193
- | `/quit` | Quit pi |
162
+ | `/quit` | Quit phi |
194
163
 
195
164
  ### Keyboard Shortcuts
196
165
 
197
- See `/hotkeys` for the full list. Customize via `~/.pi/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
166
+ See `/hotkeys` for the full list. Customize via `~/.phi/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
198
167
 
199
168
  **Commonly used:**
200
169
 
@@ -219,7 +188,7 @@ Submit messages while the agent is working:
219
188
  - **Escape** aborts and restores queued messages to editor
220
189
  - **Alt+Up** retrieves queued messages back to editor
221
190
 
222
- 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.
191
+ On Windows Terminal, `Alt+Enter` is fullscreen by default. Remap it in [docs/terminal-setup.md](docs/terminal-setup.md) so phi can receive the follow-up shortcut.
223
192
 
224
193
  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.
225
194
 
@@ -231,14 +200,14 @@ Sessions are stored as JSONL files with a tree structure. Each entry has an `id`
231
200
 
232
201
  ### Management
233
202
 
234
- Sessions auto-save to `~/.pi/agent/sessions/` organized by working directory.
203
+ Sessions auto-save to `~/.phi/agent/sessions/` organized by working directory.
235
204
 
236
205
  ```bash
237
- pi -c # Continue most recent session
238
- pi -r # Browse and select from past sessions
239
- pi --no-session # Ephemeral mode (don't save)
240
- pi --session <path|id> # Use specific session file or ID
241
- pi --fork <path|id> # Fork specific session file or ID into a new session
206
+ phi -c # Continue most recent session
207
+ phi -r # Browse and select from past sessions
208
+ phi --no-session # Ephemeral mode (don't save)
209
+ phi --session <path|id> # Use specific session file or ID
210
+ phi --fork <path|id> # Fork specific session file or ID into a new session
242
211
  ```
243
212
 
244
213
  Use `/session` in interactive mode to see the current session ID before reusing it with `--session <id>` or `--fork <id>`.
@@ -277,14 +246,14 @@ Use `/settings` to modify common options, or edit JSON files directly:
277
246
 
278
247
  | Location | Scope |
279
248
  |----------|-------|
280
- | `~/.pi/agent/settings.json` | Global (all projects) |
281
- | `.pi/settings.json` | Project (overrides global) |
249
+ | `~/.phi/agent/settings.json` | Global (all projects) |
250
+ | `.phi/settings.json` | Project (overrides global) |
282
251
 
283
252
  See [docs/settings.md](docs/settings.md) for all options.
284
253
 
285
254
  ### Telemetry and update checks
286
255
 
287
- Pi has two separate startup features:
256
+ phi has two separate startup features:
288
257
 
289
258
  - **Update check:** fetches `https://registry.npmjs.org/@phi-code-admin/phi-code/latest` to check whether a newer phi-code version exists. Disable it with `PI_SKIP_VERSION_CHECK=1`. Disabling update checks only turns off this check.
290
259
  - **Install/update telemetry:** none. phi-code sends no telemetry pings (the inherited upstream ping to `pi.dev` was removed).
@@ -295,8 +264,8 @@ Use `--offline` or `PI_OFFLINE=1` to disable all startup network operations desc
295
264
 
296
265
  ## Context Files
297
266
 
298
- Pi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
299
- - `~/.pi/agent/AGENTS.md` (global)
267
+ phi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
268
+ - `~/.phi/agent/AGENTS.md` (global)
300
269
  - Parent directories (walking up from cwd)
301
270
  - Current directory
302
271
 
@@ -306,7 +275,7 @@ Disable context file loading with `--no-context-files` (or `-nc`).
306
275
 
307
276
  ### System Prompt
308
277
 
309
- Replace the default system prompt with `.pi/SYSTEM.md` (project) or `~/.pi/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
278
+ Replace the default system prompt with `.phi/SYSTEM.md` (project) or `~/.phi/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
310
279
 
311
280
  ---
312
281
 
@@ -317,19 +286,19 @@ Replace the default system prompt with `.pi/SYSTEM.md` (project) or `~/.pi/agent
317
286
  Reusable prompts as Markdown files. Type `/name` to expand.
318
287
 
319
288
  ```markdown
320
- <!-- ~/.pi/agent/prompts/review.md -->
289
+ <!-- ~/.phi/agent/prompts/review.md -->
321
290
  Review this code for bugs, security issues, and performance problems.
322
291
  Focus on: {{focus}}
323
292
  ```
324
293
 
325
- 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).
294
+ Place in `~/.phi/agent/prompts/`, `.phi/prompts/`, or a [phi package](#phi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
326
295
 
327
296
  ### Skills
328
297
 
329
298
  On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
330
299
 
331
300
  ```markdown
332
- <!-- ~/.pi/agent/skills/my-skill/SKILL.md -->
301
+ <!-- ~/.phi/agent/skills/my-skill/SKILL.md -->
333
302
  # My Skill
334
303
  Use this skill when the user asks about X.
335
304
 
@@ -338,13 +307,13 @@ Use this skill when the user asks about X.
338
307
  2. Then that
339
308
  ```
340
309
 
341
- 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).
310
+ Place in `~/.phi/agent/skills/`, `~/.agents/skills/`, `.phi/skills/`, or `.agents/skills/` (from `cwd` up through parent directories) or a [phi package](#phi-packages) to share with others. See [docs/skills.md](docs/skills.md).
342
311
 
343
312
  ### Extensions
344
313
 
345
314
  <p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
346
315
 
347
- TypeScript modules that extend pi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
316
+ TypeScript modules that extend phi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
348
317
 
349
318
  ```typescript
350
319
  export default function (pi: ExtensionAPI) {
@@ -354,7 +323,7 @@ export default function (pi: ExtensionAPI) {
354
323
  }
355
324
  ```
356
325
 
357
- 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()`.
326
+ The default export can also be `async`. phi 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()`.
358
327
 
359
328
  **What's possible:**
360
329
  - Custom tools (or replace built-in tools entirely)
@@ -366,47 +335,47 @@ The default export can also be `async`. pi waits for async extension factories b
366
335
  - Git checkpointing and auto-commit
367
336
  - SSH and sandbox execution
368
337
  - MCP server integration
369
- - Make pi look like Claude Code
338
+ - Make phi look like Claude Code
370
339
  - Games while waiting (yes, Doom runs)
371
340
  - ...anything you can dream up
372
341
 
373
- 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/).
342
+ Place in `~/.phi/agent/extensions/`, `.phi/extensions/`, or a [phi package](#phi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
374
343
 
375
344
  ### Themes
376
345
 
377
- Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and pi immediately applies changes.
346
+ Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and phi immediately applies changes.
378
347
 
379
- Place in `~/.pi/agent/themes/`, `.pi/themes/`, or a [pi package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).
348
+ Place in `~/.phi/agent/themes/`, `.phi/themes/`, or a [phi package](#phi-packages) to share with others. See [docs/themes.md](docs/themes.md).
380
349
 
381
- ### Pi Packages
350
+ ### Phi Packages
382
351
 
383
352
  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).
384
353
 
385
- > **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.
354
+ > **Security:** phi 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.
386
355
 
387
356
  ```bash
388
- pi install npm:@foo/pi-tools
389
- pi install npm:@foo/pi-tools@1.2.3 # pinned version
390
- pi install git:github.com/user/repo
391
- pi install git:github.com/user/repo@v1 # tag or commit
392
- pi install git:git@github.com:user/repo
393
- pi install git:git@github.com:user/repo@v1 # tag or commit
394
- pi install https://github.com/user/repo
395
- pi install https://github.com/user/repo@v1 # tag or commit
396
- pi install ssh://git@github.com/user/repo
397
- pi install ssh://git@github.com/user/repo@v1 # tag or commit
398
- pi remove npm:@foo/pi-tools
399
- pi uninstall npm:@foo/pi-tools # alias for remove
400
- pi list
401
- pi update # update pi and packages (skips pinned packages)
402
- pi update --extensions # update packages only
403
- pi update --self # update pi only
404
- pi update --self --force # reinstall pi even if current
405
- pi update npm:@foo/pi-tools # update one package
406
- pi config # enable/disable extensions, skills, prompts, themes
357
+ phi install npm:@foo/pi-tools
358
+ phi install npm:@foo/pi-tools@1.2.3 # pinned version
359
+ phi install git:github.com/user/repo
360
+ phi install git:github.com/user/repo@v1 # tag or commit
361
+ phi install git:git@github.com:user/repo
362
+ phi install git:git@github.com:user/repo@v1 # tag or commit
363
+ phi install https://github.com/user/repo
364
+ phi install https://github.com/user/repo@v1 # tag or commit
365
+ phi install ssh://git@github.com/user/repo
366
+ phi install ssh://git@github.com/user/repo@v1 # tag or commit
367
+ phi remove npm:@foo/pi-tools
368
+ phi uninstall npm:@foo/pi-tools # alias for remove
369
+ phi list
370
+ phi update # update phi and packages (skips pinned packages)
371
+ phi update --extensions # update packages only
372
+ phi update --self # update phi only
373
+ phi update --self --force # reinstall phi even if current
374
+ phi update npm:@foo/pi-tools # update one package
375
+ phi config # enable/disable extensions, skills, prompts, themes
407
376
  ```
408
377
 
409
- Packages install to `~/.pi/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.pi/git/`, `.pi/npm/`). 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"]`.
378
+ Packages install to `~/.phi/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.phi/git/`, `.phi/npm/`). 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"]`.
410
379
 
411
380
  Create a package by adding a `pi` key to `package.json`:
412
381
 
@@ -423,7 +392,7 @@ Create a package by adding a `pi` key to `package.json`:
423
392
  }
424
393
  ```
425
394
 
426
- Without a `pi` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
395
+ Without a `pi` manifest, phi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
427
396
 
428
397
  See [docs/packages.md](docs/packages.md).
429
398
 
@@ -434,7 +403,7 @@ See [docs/packages.md](docs/packages.md).
434
403
  ### SDK
435
404
 
436
405
  ```typescript
437
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@earendil-works/pi-coding-agent";
406
+ import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@phi-code-admin/phi-code";
438
407
 
439
408
  const authStorage = AuthStorage.create();
440
409
  const modelRegistry = ModelRegistry.create(authStorage);
@@ -456,7 +425,7 @@ See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
456
425
  For non-Node.js integrations, use RPC mode over stdin/stdout:
457
426
 
458
427
  ```bash
459
- pi --mode rpc
428
+ phi --mode rpc
460
429
  ```
461
430
 
462
431
  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.
@@ -467,11 +436,11 @@ See [docs/rpc.md](docs/rpc.md) for the protocol.
467
436
 
468
437
  ## Philosophy
469
438
 
470
- 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.
439
+ phi 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 [phi packages](#phi-packages). This keeps the core minimal while letting you shape phi to fit how you work.
471
440
 
472
441
  **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/)
473
442
 
474
- **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.
443
+ **No sub-agents.** There's many ways to do this. Spawn phi instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
475
444
 
476
445
  **No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
477
446
 
@@ -488,22 +457,22 @@ Read the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/)
488
457
  ## CLI Reference
489
458
 
490
459
  ```bash
491
- pi [options] [@files...] [messages...]
460
+ phi [options] [@files...] [messages...]
492
461
  ```
493
462
 
494
463
  ### Package Commands
495
464
 
496
465
  ```bash
497
- pi install <source> [-l] # Install package, -l for project-local
498
- pi remove <source> [-l] # Remove package
499
- pi uninstall <source> [-l] # Alias for remove
500
- pi update [source|self|pi] # Update pi and packages (skips pinned packages)
501
- pi update --extensions # Update packages only
502
- pi update --self # Update pi only
503
- pi update --self --force # Reinstall pi even if current
504
- pi update --extension <src> # Update one package
505
- pi list # List installed packages
506
- pi config # Enable/disable package resources
466
+ phi install <source> [-l] # Install package, -l for project-local
467
+ phi remove <source> [-l] # Remove package
468
+ phi uninstall <source> [-l] # Alias for remove
469
+ phi update [source|self] # Update phi and packages (skips pinned packages)
470
+ phi update --extensions # Update packages only
471
+ phi update --self # Update phi only
472
+ phi update --self --force # Reinstall phi even if current
473
+ phi update --extension <src> # Update one package
474
+ phi list # List installed packages
475
+ phi config # Enable/disable package resources
507
476
  ```
508
477
 
509
478
  ### Modes
@@ -516,10 +485,10 @@ pi config # Enable/disable package resources
516
485
  | `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
517
486
  | `--export <in> [out]` | Export session to HTML |
518
487
 
519
- In print mode, pi also reads piped stdin and merges it into the initial prompt:
488
+ In print mode, phi also reads piped stdin and merges it into the initial prompt:
520
489
 
521
490
  ```bash
522
- cat README.md | pi -p "Summarize this text"
491
+ cat README.md | phi -p "Summarize this text"
523
492
  ```
524
493
 
525
494
  ### Model Options
@@ -586,7 +555,7 @@ Prefix files with `@` to include in the message:
586
555
 
587
556
  ```bash
588
557
  pi @prompt.md "Answer this"
589
- pi -p @screenshot.png "What's in this image?"
558
+ phi -p @screenshot.png "What's in this image?"
590
559
  pi @code.ts @test.ts "Review these files"
591
560
  ```
592
561
 
@@ -594,39 +563,39 @@ pi @code.ts @test.ts "Review these files"
594
563
 
595
564
  ```bash
596
565
  # Interactive with initial prompt
597
- pi "List all .ts files in src/"
566
+ phi "List all .ts files in src/"
598
567
 
599
568
  # Non-interactive
600
- pi -p "Summarize this codebase"
569
+ phi -p "Summarize this codebase"
601
570
 
602
571
  # Non-interactive with piped stdin
603
- cat README.md | pi -p "Summarize this text"
572
+ cat README.md | phi -p "Summarize this text"
604
573
 
605
574
  # Different model
606
- pi --provider openai --model gpt-4o "Help me refactor"
575
+ phi --provider openai --model gpt-4o "Help me refactor"
607
576
 
608
577
  # Model with provider prefix (no --provider needed)
609
- pi --model openai/gpt-4o "Help me refactor"
578
+ phi --model openai/gpt-4o "Help me refactor"
610
579
 
611
580
  # Model with thinking level shorthand
612
- pi --model sonnet:high "Solve this complex problem"
581
+ phi --model sonnet:high "Solve this complex problem"
613
582
 
614
583
  # Limit model cycling
615
- pi --models "claude-*,gpt-4o"
584
+ phi --models "claude-*,gpt-4o"
616
585
 
617
586
  # Read-only mode
618
- pi --tools read,grep,find,ls -p "Review the code"
587
+ phi --tools read,grep,find,ls -p "Review the code"
619
588
 
620
589
  # High thinking level
621
- pi --thinking high "Solve this complex problem"
590
+ phi --thinking high "Solve this complex problem"
622
591
  ```
623
592
 
624
593
  ### Environment Variables
625
594
 
626
595
  | Variable | Description |
627
596
  |----------|-------------|
628
- | `PI_CODING_AGENT_DIR` | Override config directory (default: `~/.pi/agent`) |
629
- | `PI_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
597
+ | `PHI_CODING_AGENT_DIR` | Override config directory (default: `~/.phi/agent`) |
598
+ | `PHI_CODING_AGENT_SESSION_DIR` | Override session storage directory (overridden by `--session-dir`) |
630
599
  | `PI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |
631
600
  | `PI_OFFLINE` | Disable startup network operations, including update checks, package update checks, and install/update telemetry |
632
601
  | `PI_SKIP_VERSION_CHECK` | Skip the phi-code version update check at startup. This prevents the npm registry latest-version request |