Omarchy Apps Sponsor

AI coding agent guide

Pi on Omarchy

A minimal terminal coding agent — four tools, any model, and a core you reshape yourself.

Reviewed 2026-11-22 · independent editorial guide

Short answer

Install Pi with omarchy pkg add pi-coding-agent, run pi in a project folder, and sign in with /login — OAuth for Claude Pro, ChatGPT Plus, GitHub Copilot, or any API key. Free and MIT-licensed; you pay only your model provider. Note: Pi has no permission prompts — it runs shell commands as soon as the model decides to.

Pi on Omarchy

Pi is a minimal, open-source (MIT) terminal coding agent — four tools, any model provider, and a tiny core you extend yourself instead of a sealed product with features you didn’t ask for.

TL;DR

omarchy pkg add pi-coding-agent
cd ~/your-project
pi

Then run /login, pick your provider (Claude Pro, ChatGPT Plus, GitHub Copilot, or any API key), and type a task. Pi reads files, edits code, and runs shell commands in the folder you started it in.

Getting started (5 minutes)

1. Install and launch.

Run the command above, then cd into any project and run pi. The terminal UI opens with three parts: your conversation, a prompt editor, and a footer showing the current folder, model, and session status.

2. The 3 things you need to know:

  • Authenticate first, or nothing works. Pi ships with no model configured. Inside Pi, run /login and pick a provider — OAuth for subscriptions you already pay for (Claude Pro/Max, ChatGPT Plus, GitHub Copilot, Google Gemini) or paste an API key for Anthropic, OpenAI, Google, Mistral, Groq, OpenRouter, and 15+ others. Keys are stored in ~/.pi/agent/auth.json; you can also export them as environment variables (e.g. ANTHROPIC_API_KEY) in the shell that starts Pi.
  • Pi only has four tools: read, write, edit, and bash. That’s the whole built-in toolset, by design. There are no sub-agents, no plan mode, and no permission popups in the core. Everything else — sub-agents, plan mode, permission gates, sandboxing, MCP servers, to-do lists — you add as a TypeScript extension or install as a package from pi.dev/packages (5,000+ community packages). If you want it, ask Pi to build it for you, or pi install a package that does it your way.
  • Switch models mid-session. Run /model (or press Ctrl+L) to swap providers/models without leaving the conversation; Ctrl+P cycles your favorites. This is the killer feature for Omarchy users: one agent, whatever model is cheapest or best for the task, including local models via Ollama or llama.cpp.

3. Config location.

Global config lives at ~/.pi/agent/ — auth.json (credentials), settings.json (default provider/model), models.json (custom providers/models). Project instructions go in AGENTS.md (loaded from ~/.pi/agent/, parent directories, and the current directory) and SYSTEM.md replaces or appends to the default system prompt per project. Sessions are stored as trees — /tree jumps to any earlier point and continues from there, /export saves a session to HTML, /share uploads it to a GitHub gist.

Practical notes: Pi also runs headless — pi -p "query" for one-shot scripting, --mode json for event streams, plus an RPC mode and an SDK for embedding it in your own apps. The system prompt is deliberately tiny (under 1,000 tokens), so most of your context budget goes to your actual code.

Common issues & fixes

First launch shows no model / missing-auth warning

You run pi, the TUI opens, but there’s no model selected and Pi warns about missing auth. This is the normal first-run state, not a broken install — Pi ships with no provider configured. Upstream even improved these warnings in 2026 specifically to point people at /login (changelog).

Fix: Inside Pi, run /login, pick your provider, and follow the prompt (paste an API key, or complete the browser OAuth flow). When it works, the footer shows a model name instead of an empty slot, and a test prompt like say hello gets a reply. Credentials land in ~/.pi/agent/auth.json. If you prefer environment variables, export e.g. ANTHROPIC_API_KEY in the same shell before launching pi — auth-file keys take priority over env vars.

OAuth login fails — port 1455 in use, or token expired

During /login, the browser flow stalls, or a previously working login suddenly reports an expired/failed token. Documented in the Pi README troubleshooting section: the OAuth callback listens on port 1455, and tokens can expire or fail to refresh.

Fix: If port 1455 is in use, close the conflicting process, or paste the auth code/URL when Pi prompts for it instead of relying on the automatic callback. If you get “token expired” or “refresh failed”, just run /login again for that provider — it re-authenticates and replaces the stored credentials. Use /logout to clear OAuth tokens entirely.

Custom model doesn’t appear in the /model picker

You added a custom provider/model in models.json, but it never shows up in /model. This is the most common custom-provider gotcha: models load from models.json but stay unavailable in the picker until Pi can resolve credentials for them (Nebul Pi docs).

Fix: Make sure the API key is set in the shell that started Pi — export NEBUL_API_KEY=... (or your provider’s variable) before running pi, not in a different terminal. apiKey in models.json accepts ${NAME} env-var interpolation, a literal value, or a leading !command for secrets from a password manager. Also check the model id matches the provider’s catalog ID exactly, including vendor prefix and casing — a wrong id surfaces as “model not found”, and a wrong base URL as a 404 (e.g. OpenAI-compatible endpoints usually need the /v1 suffix).

npm install fails — Node.js too old

Installing via npm errors out or Pi won’t start. The npm route needs Node.js 22.19 or newer (Pi docs, GetOrchestra walkthrough) — older Node versions are the blocker that stops most people.

Fix: On Omarchy, skip npm entirely: omarchy pkg add pi-coding-agent installs the packaged build and its dependencies for you. If you do want the npm route, check node --version first and upgrade Node (or use the official installer curl -fsSL https://pi.dev/install.sh | sh, which pins dependencies and lets you update later with pi update). The docs note the npm route doesn’t pin transitive dependencies, which is why they recommend the installer.

Pi contacts the network on startup / you want it fully offline

Pi checks pi.dev at startup for a newer version and to refresh its model list, and sends an anonymous ping after installs and updates (Flavio Copes deep dive). On a machine you want quiet, that’s unwanted traffic.

Fix: Set export PI_OFFLINE=1 before launching Pi — this disables all startup network operations, including the update check and install/update telemetry (Nebul Pi docs). Note this also means no automatic update notifications; run pi update manually when you want the latest version.

Pi runs shell commands without asking first

You asked Pi to do something and it ran bash commands — including file writes — with no confirmation prompt. This is not a bug: Pi’s own security page is direct that Pi “does not ask for approval before every tool call” and has no built-in permission system for files, processes, network, or credentials (Pi docs, via Zenolab guide).

Fix: Treat Pi like a trusted pair-programmer with your shell, not a sandbox. Run it in a project directory you can afford to have modified, keep real work in git so anything can be reverted, and use a scratch repo for first experiments. If you want gates, install a community package that adds permission prompts, path protection, or sandboxing — pi.dev/packages lists several — or ask Pi to build one for you. Never run Pi as root or in a directory containing credentials you wouldn’t hand to a stranger.

Pairs well with / If you hate this, try

Pairs well with

  • Claude Code (same Claude subscription, different philosophy — use Pi when you want provider freedom, Claude Code when you want Anthropic’s batteries-included agent), Ghostty (Omarchy’s default terminal — Pi’s TUI lives here), and git (Pi edits files freely, so commit early and often; sessions are trees, and so is your history).

If you hate this, try

  • Crush — another terminal coding agent in the store, with more built in out of the box; or OpenAI Codex if you’re all-in on ChatGPT Plus and want OpenAI’s own agent. Pi is the pick when you want the smallest possible core and the freedom to swap models mid-task.

Comparison: Pi vs Claude Code vs OpenAI Codex vs Crush

PiClaude CodeOpenAI CodexCrush
PriceFree forever (MIT). You pay only your model provider (API key or existing subscription)Free CLI; needs Claude Pro ($20/mo) via OAuth or an Anthropic API keyFree CLI; needs ChatGPT Plus/Pro via OAuth or an OpenAI API keyFree to use; source-available under FSL-1.1-MIT
Best forPeople who want one agent for every model, including local ones, and a core they can reshapeClaude users who want Anthropic’s full-featured agent with sub-agents, plan mode, and hooks built inChatGPT subscribers who want OpenAI’s agent in the terminalA batteries-included terminal agent with more defaults than Pi
Model freedom15+ providers, hundreds of models, Ollama/llama.cpp local, mid-session switchingClaude models onlyOpenAI/Codex models onlyMultiple providers
Built-in tools4 (read, write, edit, bash) — everything else is an extensionFull set: sub-agents, plan mode, permissions, hooks, MCPFull agent toolsetFull agent toolset
Omarchy installomarchy pkg add pi-coding-agentomarchy pkg add claude-codeomarchy pkg add openai-codex-binomarchy pkg add crush-bin

Verdict: Pick Pi if you want the smallest agent that runs on any model — especially if you already pay for more than one provider, or you run local models and don’t want to be locked to a single vendor’s CLI. Pick Claude Code or Codex if you live inside one ecosystem and want the guardrails and built-in features Pi deliberately leaves out.

How to switch from Claude Code (~15 minutes)

  1. Keep your subscription: Pi signs in to the same Claude Pro/Max account via OAuth — no new billing. Run pi, then /login and pick Anthropic.
  2. Install Pi on Omarchy: omarchy pkg add pi-coding-agent.
  3. Bring your project instructions: copy your CLAUDE.md content into AGENTS.md in the project root (Pi reads AGENTS.md at startup, same idea). Add a global ~/.pi/agent/AGENTS.md for rules you want everywhere.
  4. Re-create your workflow: anything Claude Code did natively that you miss — sub-agents, plan mode, permission gates — install as a Pi package (pi install npm:... or from pi.dev/packages) or ask Pi to build it for you.
  5. What doesn’t transfer: Claude Code’s hooks, its specific slash-command set, and its permission system. Your code, your git history, and your Claude subscription all come with you — the switch is the agent harness, not the model.

Open the Pi package

See the live version, upstream screenshot, requirements, source and exact Omarchy install command.

View Pi →

Frequently asked questions

Does Pi work on Omarchy?

Yes. It’s packaged in the official Omarchy repository as pi-coding-agent (version 1.6.0-1, added 2026-11-22) and installs with one command. It’s a terminal app, so it runs in Ghostty or any terminal on Hyprland — no Wayland or display-server quirks apply.

Is Pi really free?

Yes — MIT licensed, no paid tier, no account required for the agent itself. The cost is whatever your model provider charges: an API key (pay-per-token), an existing subscription (Claude Pro, ChatGPT Plus, GitHub Copilot via OAuth), or $0 with local models through Ollama or llama.cpp. Earendil (the company behind Pi) sells hosted services around it (Lefos), but the coding agent core stays MIT.

Does Pi ask before running commands?

No — and this is the most important thing to know before your first session. Pi has no built-in permission system. It runs bash and edits files as soon as the model decides to. Work in git, commit before big tasks, and install a permission-gate package if you want prompts.

Which models can Pi use?

15+ providers and hundreds of models: Anthropic, OpenAI, Google (Gemini, Vertex AI), Azure, Bedrock, Mistral, Groq, Cerebras, xAI, Hugging Face, Kimi, MiniMax, NVIDIA, OpenRouter, and local models via Ollama or llama.cpp. Authenticate by API key or OAuth, and switch mid-session with /model or Ctrl+L.

Pi vs Claude Code — which should I pick?

Pick Pi if you use (or want to use) more than one model provider, run local models, or want a minimal core you can reshape with TypeScript extensions. Pick Claude Code if you want the most polished single-vendor agent with sub-agents, plan mode, and permission prompts already built in — and you’re happy living inside Anthropic’s ecosystem.

Can I use Pi without the internet?

Mostly. Set PI_OFFLINE=1 to stop the startup update check and telemetry. But the model itself still needs to be reachable — unless you’re running a local model via Ollama or llama.cpp, in which case Pi works fully offline.

Official sources

Commands and fixes verified against official sources November 2026; on-machine verification pending.