{"_id":"@dg-forsonny/dg-pi-coding-agent","name":"@dg-forsonny/dg-pi-coding-agent","dist-tags":{"latest":"0.62.0"},"versions":{"0.62.0":{"name":"@dg-forsonny/dg-pi-coding-agent","version":"0.62.0","description":"Coding agent CLI with read, bash, edit, write tools and session management","type":"module","dgPiConfig":{"name":"dg-pi","configDir":".dg-pi"},"bin":{"dg-pi":"dist/cli.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./hooks":{"types":"./dist/core/hooks/index.d.ts","import":"./dist/core/hooks/index.js"}},"scripts":{"clean":"shx rm -rf dist","dev":"tsgo -p tsconfig.build.json --watch --preserveWatchOutput","build":"tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && npm run copy-assets","build:binary":"npm --prefix ../tui run build && npm --prefix ../ai run build && npm --prefix ../agent run build && npm run build && bun build --compile ./dist/bun/cli.js --outfile dist/dg-pi && npm run copy-binary-assets","copy-assets":"shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/","copy-binary-assets":"shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/","test":"vitest --run","prepublishOnly":"npm run clean && npm run build"},"dependencies":{"@mariozechner/jiti":"^2.6.2","@dg-forsonny/dg-pi-agent-core":"^0.62.0","@dg-forsonny/dg-pi-ai":"^0.62.0","@dg-forsonny/dg-pi-tui":"^0.62.0","@silvia-odwyer/photon-node":"^0.3.4","chalk":"^5.5.0","cli-highlight":"^2.1.11","diff":"^8.0.2","extract-zip":"^2.0.1","file-type":"^21.1.1","glob":"^13.0.1","hosted-git-info":"^9.0.2","ignore":"^7.0.5","marked":"^15.0.12","minimatch":"^10.2.3","proper-lockfile":"^4.1.2","strip-ansi":"^7.1.0","undici":"^7.19.1","yaml":"^2.8.2"},"overrides":{"rimraf":"6.1.2","gaxios":{"rimraf":"6.1.2"}},"optionalDependencies":{"@mariozechner/clipboard":"^0.3.2"},"devDependencies":{"@types/diff":"^7.0.2","@types/hosted-git-info":"^3.0.5","@types/ms":"^2.1.0","@types/node":"^24.3.0","@types/proper-lockfile":"^4.1.4","shx":"^0.4.0","typescript":"^5.7.3","vitest":"^3.2.4"},"keywords":["coding-agent","ai","llm","cli","tui","agent"],"author":{"name":"Mario Zechner"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/forsonny/DG-Pi.git","directory":"packages/coding-agent"},"engines":{"node":">=20.6.0"},"gitHead":"219f7fe000febfca79150fd5c02f4e965b0ba187","_id":"@dg-forsonny/dg-pi-coding-agent@0.62.0","bugs":{"url":"https://github.com/forsonny/DG-Pi/issues"},"homepage":"https://github.com/forsonny/DG-Pi#readme","_nodeVersion":"20.19.4","_npmVersion":"11.11.1","dist":{"integrity":"sha512-zGNP0uzH4WIglWSCNnsGzwDiIsjH/X246GgFByjc4sWbsMT2qLCtBjS7GWQni4ixeCZ428+wfKQnmRciiGuFkA==","shasum":"47fe71c34aec8f7df5b52cb85193d6d1db2c8061","tarball":"https://registry.npmjs.org/@dg-forsonny/dg-pi-coding-agent/-/dg-pi-coding-agent-0.62.0.tgz","fileCount":644,"unpackedSize":9501388,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGd6Gpq2CZF5BJRc6FGetB6IUiu7U7VfrX8xVBp0YKUVAiAJAJ3ta24GuVwMKm3hYtcG+J9bynoxgiVMlemebfW2qg=="}]},"_npmUser":{"name":"dgforsonny","email":"maildg@forsonny.com"},"directories":{},"maintainers":[{"name":"dgforsonny","email":"maildg@forsonny.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dg-pi-coding-agent_0.62.0_1774240257664_0.7195166809672515"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-23T04:30:57.453Z","0.62.0":"2026-03-23T04:30:57.956Z","modified":"2026-03-23T04:30:58.295Z"},"maintainers":[{"name":"dgforsonny","email":"maildg@forsonny.com"}],"description":"Coding agent CLI with read, bash, edit, write tools and session management","homepage":"https://github.com/forsonny/DG-Pi#readme","keywords":["coding-agent","ai","llm","cli","tui","agent"],"repository":{"type":"git","url":"git+https://github.com/forsonny/DG-Pi.git","directory":"packages/coding-agent"},"author":{"name":"Mario Zechner"},"bugs":{"url":"https://github.com/forsonny/DG-Pi/issues"},"license":"MIT","readme":"DG-Pi is a minimal terminal coding harness, forked from [Pi](https://github.com/badlogic/pi-mono). Adapt DG-Pi to your workflows, not the other way around, without having to fork and modify 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 [DG-Pi Packages](#dg-pi-packages) and share them with others via npm or git.\n\nDG-Pi ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask DG-Pi to build what you want or install a third party package that matches your workflow.\n\nDG-Pi runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps.\n\n## Table of Contents\n\n- [Quick Start](#quick-start)\n- [Providers & Models](#providers--models)\n- [Interactive Mode](#interactive-mode)\n  - [Editor](#editor)\n  - [Commands](#commands)\n  - [Keyboard Shortcuts](#keyboard-shortcuts)\n  - [Message Queue](#message-queue)\n- [Sessions](#sessions)\n  - [Branching](#branching)\n  - [Compaction](#compaction)\n- [Settings](#settings)\n- [Context Files](#context-files)\n- [Customization](#customization)\n  - [Prompt Templates](#prompt-templates)\n  - [Skills](#skills)\n  - [Extensions](#extensions)\n  - [Themes](#themes)\n  - [Pi Packages](#pi-packages)\n- [Programmatic Usage](#programmatic-usage)\n- [Philosophy](#philosophy)\n- [CLI Reference](#cli-reference)\n\n---\n\n## Quick Start\n\n```bash\nnpm install -g @dg-forsonny/dg-pi-coding-agent\n```\n\nAuthenticate with an API key:\n\n```bash\nexport ANTHROPIC_API_KEY=sk-ant-...\npi\n```\n\nOr use your existing subscription:\n\n```bash\npi\n/login  # Then select provider\n```\n\nThen 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).\n\n**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)\n\n---\n\n## Providers & Models\n\nFor 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).\n\n**Subscriptions:**\n- Anthropic Claude Pro/Max\n- OpenAI ChatGPT Plus/Pro (Codex)\n- GitHub Copilot\n- Google Gemini CLI\n- Google Antigravity\n\n**API keys:**\n- Anthropic\n- OpenAI\n- Azure OpenAI\n- Google Gemini\n- Google Vertex\n- Amazon Bedrock\n- Mistral\n- Groq\n- Cerebras\n- xAI\n- OpenRouter\n- Vercel AI Gateway\n- ZAI\n- OpenCode Zen\n- OpenCode Go\n- Hugging Face\n- Kimi For Coding\n- MiniMax\n\nSee [docs/providers.md](docs/providers.md) for detailed setup instructions.\n\n**Custom providers & models:** Add providers via `~/.dg-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).\n\n---\n\n## Interactive Mode\n\n<p align=\"center\"><img src=\"docs/images/interactive-mode.png\" alt=\"Interactive Mode\" width=\"600\"></p>\n\nThe interface from top to bottom:\n\n- **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions\n- **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI\n- **Editor** - Where you type; border color indicates thinking level\n- **Footer** - Working directory, session name, total token/cache usage, cost, context usage, current model\n\nThe editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.\n\n### Editor\n\n| Feature | How |\n|---------|-----|\n| File reference | Type `@` to fuzzy-search project files |\n| Path completion | Tab to complete paths |\n| Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |\n| Images | Ctrl+V to paste (Alt+V on Windows), or drag onto terminal |\n| Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |\n\nStandard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).\n\n### Commands\n\nType `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.\n\n| Command | Description |\n|---------|-------------|\n| `/login`, `/logout` | OAuth authentication |\n| `/model` | Switch models |\n| `/scoped-models` | Enable/disable models for Ctrl+P cycling |\n| `/settings` | Thinking level, theme, message delivery, transport |\n| `/resume` | Pick from previous sessions |\n| `/new` | Start a new session |\n| `/name <name>` | Set session display name |\n| `/session` | Show session info (path, tokens, cost) |\n| `/tree` | Jump to any point in the session and continue from there |\n| `/fork` | Create a new session from the current branch |\n| `/compact [prompt]` | Manually compact context, optional custom instructions |\n| `/copy` | Copy last assistant message to clipboard |\n| `/export [file]` | Export session to HTML file |\n| `/share` | Upload as private GitHub gist with shareable HTML link |\n| `/reload` | Reload keybindings, extensions, skills, prompts, and context files (themes hot-reload automatically) |\n| `/hotkeys` | Show all keyboard shortcuts |\n| `/changelog` | Display version history |\n| `/quit`, `/exit` | Quit pi |\n\n### Keyboard Shortcuts\n\nSee `/hotkeys` for the full list. Customize via `~/.dg-pi/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).\n\n**Commonly used:**\n\n| Key | Action |\n|-----|--------|\n| Ctrl+C | Clear editor |\n| Ctrl+C twice | Quit |\n| Escape | Cancel/abort |\n| Escape twice | Open `/tree` |\n| Ctrl+L | Open model selector |\n| Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |\n| Shift+Tab | Cycle thinking level |\n| Ctrl+O | Collapse/expand tool output |\n| Ctrl+T | Collapse/expand thinking blocks |\n\n### Message Queue\n\nSubmit messages while the agent is working:\n\n- **Enter** queues a *steering* message, delivered after the current assistant turn finishes executing its tool calls\n- **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work\n- **Escape** aborts and restores queued messages to editor\n- **Alt+Up** retrieves queued messages back to editor\n\nOn 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.\n\nConfigure 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.\n\n---\n\n## Sessions\n\nSessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session.md](docs/session.md) for file format.\n\n### Management\n\nSessions auto-save to `~/.dg-pi/agent/sessions/` organized by working directory.\n\n```bash\npi -c                  # Continue most recent session\npi -r                  # Browse and select from past sessions\npi --no-session        # Ephemeral mode (don't save)\npi --session <path>    # Use specific session file or ID\npi --fork <path>       # Fork specific session file or ID into a new session\n```\n\n### Branching\n\n**`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file.\n\n<p align=\"center\"><img src=\"docs/images/tree-view.png\" alt=\"Tree View\" width=\"600\"></p>\n\n- Search by typing, fold/unfold and jump between branches with Ctrl+←/Ctrl+→ or Alt+←/Alt+→, page with ←/→\n- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all\n- Press `l` to label entries as bookmarks\n\n**`/fork`** - Create a new session file from the current branch. Opens a selector, copies history up to the selected point, and places that message in the editor for modification.\n\n**`--fork <path|id>`** - Fork an existing session file or partial session UUID directly from the CLI. This copies the full source session into a new session file in the current project.\n\n### Compaction\n\nLong sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.\n\n**Manual:** `/compact` or `/compact <custom instructions>`\n\n**Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.\n\nCompaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.\n\n---\n\n## Settings\n\nUse `/settings` to modify common options, or edit JSON files directly:\n\n| Location | Scope |\n|----------|-------|\n| `~/.dg-pi/agent/settings.json` | Global (all projects) |\n| `.dg-pi/settings.json` | Project (overrides global) |\n\nSee [docs/settings.md](docs/settings.md) for all options.\n\n---\n\n## Context Files\n\nPi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:\n- `~/.dg-pi/agent/AGENTS.md` (global)\n- Parent directories (walking up from cwd)\n- Current directory\n\nUse for project instructions, conventions, common commands. All matching files are concatenated.\n\n### System Prompt\n\nReplace the default system prompt with `.dg-pi/SYSTEM.md` (project) or `~/.dg-pi/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.\n\n---\n\n## Customization\n\n### Prompt Templates\n\nReusable prompts as Markdown files. Type `/name` to expand.\n\n```markdown\n<!-- ~/.dg-pi/agent/prompts/review.md -->\nReview this code for bugs, security issues, and performance problems.\nFocus on: {{focus}}\n```\n\nPlace in `~/.dg-pi/agent/prompts/`, `.dg-pi/prompts/`, or a [pi package](#pi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).\n\n### Skills\n\nOn-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.\n\n```markdown\n<!-- ~/.dg-pi/agent/skills/my-skill/SKILL.md -->\n# My Skill\nUse this skill when the user asks about X.\n\n## Steps\n1. Do this\n2. Then that\n```\n\nPlace in `~/.dg-pi/agent/skills/`, `~/.agents/skills/`, `.dg-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).\n\n### Extensions\n\n<p align=\"center\"><img src=\"docs/images/doom-extension.png\" alt=\"Doom Extension\" width=\"600\"></p>\n\nTypeScript modules that extend pi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.\n\n```typescript\nexport default function (pi: ExtensionAPI) {\n  pi.registerTool({ name: \"deploy\", ... });\n  pi.registerCommand(\"stats\", { ... });\n  pi.on(\"tool_call\", async (event, ctx) => { ... });\n}\n```\n\n**What's possible:**\n- Custom tools (or replace built-in tools entirely)\n- Sub-agents and plan mode\n- Custom compaction and summarization\n- Permission gates and path protection\n- Custom editors and UI components\n- Status lines, headers, footers\n- Git checkpointing and auto-commit\n- SSH and sandbox execution\n- MCP server integration\n- Make pi look like Claude Code\n- Games while waiting (yes, Doom runs)\n- ...anything you can dream up\n\nPlace in `~/.dg-pi/agent/extensions/`, `.dg-pi/extensions/`, or a [pi package](#pi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).\n\n### Themes\n\nBuilt-in: `dark`, `light`. Themes hot-reload: modify the active theme file and pi immediately applies changes.\n\nPlace in `~/.dg-pi/agent/themes/`, `.dg-pi/themes/`, or a [pi package](#pi-packages) to share with others. See [docs/themes.md](docs/themes.md).\n\n### Pi Packages\n\nBundle 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).\n\n> **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.\n\n```bash\npi install npm:@foo/pi-tools\npi install npm:@foo/pi-tools@1.2.3      # pinned version\npi install git:github.com/user/repo\npi install git:github.com/user/repo@v1  # tag or commit\npi install git:git@github.com:user/repo\npi install git:git@github.com:user/repo@v1  # tag or commit\npi install https://github.com/user/repo\npi install https://github.com/user/repo@v1      # tag or commit\npi install ssh://git@github.com/user/repo\npi install ssh://git@github.com/user/repo@v1    # tag or commit\npi remove npm:@foo/pi-tools\npi uninstall npm:@foo/pi-tools          # alias for remove\npi list\npi update                               # skips pinned packages\npi config                               # enable/disable extensions, skills, prompts, themes\n```\n\nPackages install to `~/.dg-pi/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.dg-pi/git/`, `.dg-pi/npm/`). 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\"]`.\n\nCreate a package by adding a `pi` key to `package.json`:\n\n```json\n{\n  \"name\": \"my-pi-package\",\n  \"keywords\": [\"pi-package\"],\n  \"pi\": {\n    \"extensions\": [\"./extensions\"],\n    \"skills\": [\"./skills\"],\n    \"prompts\": [\"./prompts\"],\n    \"themes\": [\"./themes\"]\n  }\n}\n```\n\nWithout a `pi` manifest, pi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).\n\nSee [docs/packages.md](docs/packages.md).\n\n---\n\n## Programmatic Usage\n\n### SDK\n\n```typescript\nimport { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from \"@dg-forsonny/dg-pi-coding-agent\";\n\nconst { session } = await createAgentSession({\n  sessionManager: SessionManager.inMemory(),\n  authStorage: AuthStorage.create(),\n  modelRegistry: new ModelRegistry(authStorage),\n});\n\nawait session.prompt(\"What files are in the current directory?\");\n```\n\nSee [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).\n\n### RPC Mode\n\nFor non-Node.js integrations, use RPC mode over stdin/stdout:\n\n```bash\npi --mode rpc\n```\n\nRPC 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.\n\nSee [docs/rpc.md](docs/rpc.md) for the protocol.\n\n---\n\n## Philosophy\n\nPi 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.\n\n**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/)\n\n**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.\n\n**No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.\n\n**No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.\n\n**No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).\n\n**No background bash.** Use tmux. Full observability, direct interaction.\n\nRead the [blog post](https://mariozechner.at/posts/2025-11-30-pi-coding-agent/) for the full rationale.\n\n---\n\n## CLI Reference\n\n```bash\npi [options] [@files...] [messages...]\n```\n\n### Package Commands\n\n```bash\npi install <source> [-l]     # Install package, -l for project-local\npi remove <source> [-l]      # Remove package\npi uninstall <source> [-l]   # Alias for remove\npi update [source]           # Update packages (skips pinned)\npi list                      # List installed packages\npi config                    # Enable/disable package resources\n```\n\n### Modes\n\n| Flag | Description |\n|------|-------------|\n| (default) | Interactive mode |\n| `-p`, `--print` | Print response and exit |\n| `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |\n| `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |\n| `--export <in> [out]` | Export session to HTML |\n\nIn print mode, pi also reads piped stdin and merges it into the initial prompt:\n\n```bash\ncat README.md | pi -p \"Summarize this text\"\n```\n\n### Model Options\n\n| Option | Description |\n|--------|-------------|\n| `--provider <name>` | Provider (anthropic, openai, google, etc.) |\n| `--model <pattern>` | Model pattern or ID (supports `provider/id` and optional `:<thinking>`) |\n| `--api-key <key>` | API key (overrides env vars) |\n| `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |\n| `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |\n| `--list-models [search]` | List available models |\n\n### Session Options\n\n| Option | Description |\n|--------|-------------|\n| `-c`, `--continue` | Continue most recent session |\n| `-r`, `--resume` | Browse and select session |\n| `--session <path>` | Use specific session file or partial UUID |\n| `--fork <path>` | Fork specific session file or partial UUID into a new session |\n| `--session-dir <dir>` | Custom session storage directory |\n| `--no-session` | Ephemeral mode (don't save) |\n\n### Tool Options\n\n| Option | Description |\n|--------|-------------|\n| `--tools <list>` | Enable specific built-in tools (default: `read,bash,edit,write`) |\n| `--no-tools` | Disable all built-in tools (extension tools still work) |\n\nAvailable built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`\n\n### Resource Options\n\n| Option | Description |\n|--------|-------------|\n| `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |\n| `--no-extensions` | Disable extension discovery |\n| `--skill <path>` | Load skill (repeatable) |\n| `--no-skills` | Disable skill discovery |\n| `--prompt-template <path>` | Load prompt template (repeatable) |\n| `--no-prompt-templates` | Disable prompt template discovery |\n| `--theme <path>` | Load theme (repeatable) |\n| `--no-themes` | Disable theme discovery |\n\nCombine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).\n\n### Other Options\n\n| Option | Description |\n|--------|-------------|\n| `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |\n| `--append-system-prompt <text>` | Append to system prompt |\n| `--verbose` | Force verbose startup |\n| `-h`, `--help` | Show help |\n| `-v`, `--version` | Show version |\n\n### File Arguments\n\nPrefix files with `@` to include in the message:\n\n```bash\npi @prompt.md \"Answer this\"\npi -p @screenshot.png \"What's in this image?\"\npi @code.ts @test.ts \"Review these files\"\n```\n\n### Examples\n\n```bash\n# Interactive with initial prompt\npi \"List all .ts files in src/\"\n\n# Non-interactive\npi -p \"Summarize this codebase\"\n\n# Non-interactive with piped stdin\ncat README.md | pi -p \"Summarize this text\"\n\n# Different model\npi --provider openai --model gpt-4o \"Help me refactor\"\n\n# Model with provider prefix (no --provider needed)\npi --model openai/gpt-4o \"Help me refactor\"\n\n# Model with thinking level shorthand\npi --model sonnet:high \"Solve this complex problem\"\n\n# Limit model cycling\npi --models \"claude-*,gpt-4o\"\n\n# Read-only mode\npi --tools read,grep,find,ls -p \"Review the code\"\n\n# High thinking level\npi --thinking high \"Solve this complex problem\"\n```\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `DG_PI_CODING_AGENT_DIR` | Override config directory (default: `~/.dg-pi/agent`) |\n| `DG_PI_PACKAGE_DIR` | Override package directory (useful for Nix/Guix where store paths tokenize poorly) |\n| `DG_PI_SKIP_VERSION_CHECK` | Skip version check at startup |\n| `DG_PI_CACHE_RETENTION` | Set to `long` for extended prompt cache (Anthropic: 1h, OpenAI: 24h) |\n| `VISUAL`, `EDITOR` | External editor for Ctrl+G |\n\n---\n\n## Contributing & Development\n\nSee [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.\n\n---\n\n## License\n\nMIT\n\n## See Also\n\n- [@dg-forsonny/dg-pi-ai](https://www.npmjs.com/package/@dg-forsonny/dg-pi-ai): Core LLM toolkit\n- [@dg-forsonny/dg-pi-agent-core](https://www.npmjs.com/package/@dg-forsonny/dg-pi-agent-core): Agent framework\n- [@dg-forsonny/dg-pi-tui](https://www.npmjs.com/package/@dg-forsonny/dg-pi-tui): Terminal UI components\n","readmeFilename":"README.md","_rev":"1-6053194c29c9cf6369134b988e3139c4"}