Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions packages/coding-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Then just talk to pi. By default, pi gives the model four tools: `read`, `write`

## Providers & Models

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).
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).

**Subscriptions:**
- Anthropic Claude Pro/Max
Expand Down Expand Up @@ -162,8 +162,8 @@ The editor can be temporarily replaced by other UI, like built-in `/settings` or
|---------|-----|
| File reference | Type `@` to fuzzy-search project files |
| Path completion | Tab to complete paths |
| Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
| Images | Ctrl+V to paste (Alt+V on Windows), or drag onto terminal |
| Multi-line | SHIFT+Enter (or CTRL+Enter on Windows Terminal) |
| Images | CTRL+V to paste (ALT+V on Windows), or drag onto terminal |
| Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |

Standard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).
Expand All @@ -176,7 +176,7 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
|---------|-------------|
| `/login`, `/logout` | OAuth authentication |
| `/model` | Switch models |
| `/scoped-models` | Enable/disable models for Ctrl+P cycling |
| `/scoped-models` | Enable/disable models for CTRL+P cycling |
| `/settings` | Thinking level, theme, message delivery, transport |
| `/resume` | Pick from previous sessions |
| `/new` | Start a new session |
Expand All @@ -202,26 +202,26 @@ See `/hotkeys` for the full list. Customize via `~/.pi/agent/keybindings.json`.

| Key | Action |
|-----|--------|
| Ctrl+C | Clear editor |
| Ctrl+C twice | Quit |
| CTRL+C | Clear editor |
| CTRL+C twice | Quit |
| Escape | Cancel/abort |
| Escape twice | Open `/tree` |
| Ctrl+L | Open model selector |
| Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
| Shift+Tab | Cycle thinking level |
| Ctrl+O | Collapse/expand tool output |
| Ctrl+T | Collapse/expand thinking blocks |
| CTRL+L | Open model selector |
| CTRL+P / SHIFT+CTRL+P | Cycle scoped models forward/backward |
| SHIFT+Tab | Cycle thinking level |
| CTRL+O | Collapse/expand tool output |
| CTRL+T | Collapse/expand thinking blocks |

### Message Queue

Submit messages while the agent is working:

- **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls
- **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
- **ALT+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
- **Escape** aborts and restores queued messages to editor
- **Alt+Up** retrieves queued messages back to editor
- **ALT+Up** retrieves queued messages back to editor

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.
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.

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.

Expand Down Expand Up @@ -251,9 +251,9 @@ Use `/session` in interactive mode to see the current session ID before reusing

<p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>

- Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
- Press Shift+L to label entries as bookmarks and Shift+T to toggle label timestamps
- Search by typing, fold/unfold and jump between branches with CTRL+←/CTRL+→ or ALT+←/ALT+→, page with ←/→
- Filter modes (CTRL+O): default → no-tools → user-only → labeled-only → all
- Press SHIFT+L to label entries as bookmarks and SHIFT+T to toggle label timestamps

**`/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.

Expand Down Expand Up @@ -410,22 +410,23 @@ pi config # enable/disable extensions, skills, pro

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"]`.

Create a package by adding a `pi` key to `package.json`:
Create a package by adding an app-name manifest key to `package.json` (`atomic` for this package). The legacy `pi` key is still accepted as a backwards-compatible shim:

```json
{
"name": "my-pi-package",
"keywords": ["pi-package"],
"pi": {
"atomic": {
"extensions": ["./extensions"],
"skills": ["./skills"],
"prompts": ["./prompts"],
"themes": ["./themes"]
"themes": ["./themes"],
"workflows": ["./workflows"]
}
}
```

Without a `pi` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
Without a manifest, Atomic auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`, `workflows/`). Workflow packages may also use a singular `workflow/` directory.

See [docs/packages.md](docs/packages.md).

Expand Down Expand Up @@ -532,7 +533,7 @@ cat README.md | pi -p "Summarize this text"
| `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |
| `--api-key <key>` | API key (overrides env vars) |
| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
| `--models <patterns>` | Comma-separated patterns for CTRL+P cycling |
| `--list-models [search]` | List available models |

### Session Options
Expand Down Expand Up @@ -634,7 +635,7 @@ pi --thinking high "Solve this complex problem"
| `PI_SKIP_VERSION_CHECK` | Skip the Pi version update check at startup. This prevents the `pi.dev` latest-version request |
| `PI_TELEMETRY` | Override install/update telemetry. Use `1`/`true`/`yes` to enable or `0`/`false`/`no` to disable. This does not disable update checks |
| `PI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |
| `VISUAL`, `EDITOR` | External editor for Ctrl+G |
| `VISUAL`, `EDITOR` | External editor for CTRL+G |

---

Expand Down
4 changes: 2 additions & 2 deletions packages/coding-agent/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ Configure via `package.json`:

```json
{
"piConfig": {
"atomicConfig": {
"name": "atomic",
"configDir": ".atomic"
}
}
```

Change `name`, `configDir`, and the `bin` field for your fork. Atomic sets these to `atomic`, `.atomic`, and the `atomic` executable. Affects CLI banner, config paths, and environment variable names.
Change `name`, `configDir`, and the `bin` field for your fork. The app-specific `<appName>Config` key is preferred; legacy `piConfig` remains a backwards-compatible shim. Atomic sets these to `atomic`, `.atomic`, and the `atomic` executable. Affects CLI banner, config paths, and environment variable names.

## Path Resolution

Expand Down
14 changes: 7 additions & 7 deletions packages/coding-agent/docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,13 @@ This pattern makes the fetched models available during normal startup and to `pi
"zod": "^3.0.0",
"chalk": "^5.0.0"
},
"pi": {
"atomic": {
"extensions": ["./src/index.ts"]
}
}
```

Run `npm install` in the extension directory, then imports from `node_modules/` work automatically.
The manifest key is the app name from `package.json` (`atomic` here); the legacy `pi` key is still accepted as a compatibility shim. Run `npm install` in the extension directory, then imports from `node_modules/` work automatically.

## Events

Expand Down Expand Up @@ -323,14 +323,14 @@ user sends another prompt ◄─────────────────
├─► session_before_tree (can cancel or customize)
└─► session_tree

/model or Ctrl+P (model selection/cycling)
/model or CTRL+P (model selection/cycling)
├─► thinking_level_select (if model change changes/clamps thinking level)
└─► model_select

thinking level changes (settings, keybinding, pi.setThinkingLevel())
└─► thinking_level_select

exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM)
exit (CTRL+C, CTRL+D, SIGHUP, SIGTERM)
└─► session_shutdown
```

Expand Down Expand Up @@ -635,7 +635,7 @@ Header availability depends on provider and transport. Providers that abstract H

#### model_select

Fired when the model changes via `/model` command, model cycling (`Ctrl+P`), or session restore.
Fired when the model changes via `/model` command, model cycling (`CTRL+P`), or session restore.

```typescript
pi.on("model_select", async (event, ctx) => {
Expand Down Expand Up @@ -745,7 +745,7 @@ In parallel tool mode, `tool_result` and `tool_execution_end` may interleave in
- Each handler sees the latest result after previous handler changes
- Handlers can return partial patches (`content`, `details`, or `isError`); omitted fields keep their current values

Use `ctx.signal` for nested async work inside the handler. This lets Esc cancel model calls, `fetch()`, and other abort-aware operations started by the extension.
Use `ctx.signal` for nested async work inside the handler. This lets Escape cancel model calls, `fetch()`, and other abort-aware operations started by the extension.

```typescript
import { isBashToolResult } from "@bastani/atomic";
Expand Down Expand Up @@ -2332,7 +2332,7 @@ For complex UI, use `ctx.ui.custom()`. This temporarily replaces the editor with
import { Text, Component } from "@earendil-works/pi-tui";

const result = await ctx.ui.custom<boolean>((tui, theme, keybindings, done) => {
const text = new Text("Press Enter to confirm, Escape to cancel", 1, 1);
const text = new Text("Enter Confirm · Escape Cancel", 1, 1);

text.onKey = (key) => {
if (key === "return") done(true);
Expand Down
19 changes: 11 additions & 8 deletions packages/coding-agent/docs/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Pi Packages

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.
Pi packages bundle extensions, skills, prompt templates, themes, and workflow definitions 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.

## Table of Contents

Expand Down Expand Up @@ -110,17 +110,18 @@ Local paths point to files or directories on disk and are added to settings with

## Creating a Pi Package

Add a `pi` manifest to `package.json` or use conventional directories. Include the `pi-package` keyword for discoverability.
Add an app manifest to `package.json` or use conventional directories. The manifest key is the configured app name (`atomic` here, from `atomicConfig.name`; legacy `piConfig.name` is also read). The legacy `pi` key remains supported as a backwards-compatible shim. Include the `pi-package` keyword for discoverability.

```json
{
"name": "my-package",
"keywords": ["pi-package"],
"pi": {
"atomic": {
"extensions": ["./extensions"],
"skills": ["./skills"],
"prompts": ["./prompts"],
"themes": ["./themes"]
"themes": ["./themes"],
"workflows": ["./workflows"]
}
}
```
Expand All @@ -135,7 +136,7 @@ The [package gallery](https://pi.dev/packages) displays packages tagged with `pi
{
"name": "my-package",
"keywords": ["pi-package"],
"pi": {
"atomic": {
"extensions": ["./extensions"],
"video": "https://example.com/demo.mp4",
"image": "https://example.com/screenshot.png"
Expand All @@ -158,6 +159,7 @@ If no `pi` manifest is present, pi auto-discovers resources from these directori
- `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
- `prompts/` loads `.md` files
- `themes/` loads `.json` files
- `workflows/` loads workflow SDK files (`.ts`, `.js`, `.mjs`, `.cjs`); `workflow/` is also accepted as a singular alias

## Dependencies

Expand All @@ -175,7 +177,7 @@ Example:
"shitty-extensions": "^1.0.1"
},
"bundledDependencies": ["shitty-extensions"],
"pi": {
"atomic": {
"extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
"skills": ["skills", "node_modules/shitty-extensions/skills"]
}
Expand All @@ -195,7 +197,8 @@ Filter what a package loads using the object form in settings:
"extensions": ["extensions/*.ts", "!extensions/legacy.ts"],
"skills": [],
"prompts": ["prompts/review.md"],
"themes": ["+themes/legacy.json"]
"themes": ["+themes/legacy.json"],
"workflows": ["workflows/*.ts"]
}
]
}
Expand All @@ -212,7 +215,7 @@ Filter what a package loads using the object form in settings:

## Enable and Disable Resources

Use `pi config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.pi/agent`) and project (`.pi/`) scopes.
Use `pi config` to enable or disable extensions, skills, prompt templates, and themes from installed packages and local directories. Works for both global (`~/.pi/agent`) and project (`.pi/`) scopes. Workflow package filters can be configured in settings with `workflows` patterns.

## Scope and Deduplication

Expand Down
4 changes: 2 additions & 2 deletions packages/coding-agent/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pi @README.md "Summarize this"
pi @src/app.ts @src/app.test.ts "Review these together"
```

Images can be pasted with Ctrl+V (Alt+V on Windows) or dragged into supported terminals.
Images can be pasted with CTRL+V (ALT+V on Windows) or dragged into supported terminals.

### Run shell commands

Expand All @@ -105,7 +105,7 @@ The command output is sent to the model. Use `!!command` to run a command withou

### Switch models

Use `/model` or Ctrl+L to choose a model. Use Shift+Tab to cycle thinking level. Use Ctrl+P / Shift+Ctrl+P to cycle through scoped models.
Use `/model` or CTRL+L to choose a model. Use SHIFT+Tab to cycle thinking level. Use CTRL+P / SHIFT+CTRL+P to cycle through scoped models.

### Continue later

Expand Down
2 changes: 1 addition & 1 deletion packages/coding-agent/docs/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ attachJsonlReader(agent.stdout, (line) => {
// Send prompt
agent.stdin.write(JSON.stringify({ type: "prompt", message: "Hello" }) + "\n");

// Abort on Ctrl+C
// Abort on CTRL+C
process.on("SIGINT", () => {
agent.stdin.write(JSON.stringify({ type: "abort" }) + "\n");
});
Expand Down
25 changes: 14 additions & 11 deletions packages/coding-agent/docs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,23 +338,25 @@ const { session } = await createAgentSession({
cwd: process.cwd(), // default

// Global config directory
agentDir: "~/.pi/agent", // default (expands ~)
agentDir: "~/.atomic/agent", // default (expands ~)
});
```

Atomic reads primary `.atomic` locations first and legacy `.pi` locations for compatibility when multiple config directories are supported. Passing an explicit `agentDir` makes that directory the user override.

`cwd` is used by `DefaultResourceLoader` for:
- Project extensions (`.pi/extensions/`)
- Project extensions (`.atomic/extensions/`, then legacy `.pi/extensions/`)
- Project skills:
- `.pi/skills/`
- `.atomic/skills/`, then legacy `.pi/skills/`
- `.agents/skills/` in `cwd` and ancestor directories (up to git repo root, or filesystem root when not in a repo)
- Project prompts (`.pi/prompts/`)
- Project prompts (`.atomic/prompts/`, then legacy `.pi/prompts/`)
- Context files (`AGENTS.md` walking up from cwd)
- Session directory naming

`agentDir` is used by `DefaultResourceLoader` for:
- Global extensions (`extensions/`)
- Global skills:
- `skills/` under `agentDir` (for example `~/.pi/agent/skills/`)
- `skills/` under `agentDir` (for example `~/.atomic/agent/skills/`; legacy `~/.pi/agent/skills/` is also considered by default)
- `~/.agents/skills/`
- Global prompts (`prompts/`)
- Global context file (`AGENTS.md`)
Expand Down Expand Up @@ -389,7 +391,7 @@ const { session } = await createAgentSession({
model: opus,
thinkingLevel: "medium", // off, minimal, low, medium, high, xhigh

// Models for cycling (Ctrl+P in interactive mode)
// Models for cycling (CTRL+P in interactive mode)
scopedModels: [
{ model: opus, thinkingLevel: "high" },
{ model: haiku, thinkingLevel: "off" },
Expand Down Expand Up @@ -418,7 +420,8 @@ API key resolution priority (handled by AuthStorage):
```typescript
import { AuthStorage, ModelRegistry } from "@bastani/atomic";

// Default: uses ~/.pi/agent/auth.json and ~/.pi/agent/models.json
// Default: uses ~/.atomic/agent/auth.json and ~/.atomic/agent/models.json,
// with legacy ~/.pi/agent/* compatibility reads when available.
const authStorage = AuthStorage.create();
const modelRegistry = ModelRegistry.create(authStorage);

Expand Down Expand Up @@ -548,7 +551,7 @@ If you pass `tools`, include each custom or extension tool name you want enabled

### Extensions

Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.pi/agent/extensions/`, `.pi/extensions/`, and settings.json extension sources.
Extensions are loaded by the `ResourceLoader`. `DefaultResourceLoader` discovers extensions from `~/.atomic/agent/extensions/` and `.atomic/extensions/` first, then legacy `~/.pi/agent/extensions/` and `.pi/extensions/`, plus settings.json extension sources.

```typescript
import { createAgentSession, DefaultResourceLoader } from "@bastani/atomic";
Expand Down Expand Up @@ -805,9 +808,9 @@ const { session } = await createAgentSession({

**Project-specific settings:**

Settings load from two locations and merge:
1. Global: `~/.pi/agent/settings.json`
2. Project: `<cwd>/.pi/settings.json`
Settings load from Atomic-first locations and merge:
1. Global: `~/.atomic/agent/settings.json`, then legacy `~/.pi/agent/settings.json`
2. Project: `<cwd>/.atomic/settings.json`, then legacy `<cwd>/.pi/settings.json`

Project overrides global. Nested objects merge keys. Setters modify global settings by default.

Expand Down
2 changes: 1 addition & 1 deletion packages/coding-agent/docs/session-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Where `<path>` is the working directory with `/` replaced by `-`.

Sessions can be removed by deleting their `.jsonl` files under `~/.pi/agent/sessions/`.

Pi also supports deleting sessions interactively from `/resume` (select a session and press `Ctrl+D`, then confirm). When available, pi uses the `trash` CLI to avoid permanent deletion.
Pi also supports deleting sessions interactively from `/resume` (select a session and press `CTRL+D`, then confirm). When available, pi uses the `trash` CLI to avoid permanent deletion.

## Session Version

Expand Down
Loading
Loading