oh-my-pi README

项目的 README,来自 github.com/can1357/oh-my-pi。合并为一个 markdown 文件:README.md。

omp

A coding agent with the IDE wired in. omp.sh

Language: English | 简体中文

npm version Changelog CI License TypeScript Rust Bun Discord

Built by Stencil Labs · Fork of Pi by @mariozechner

The most capable agent surface that ships. Continuously tuned by real-world use — complete out of the box, open all the way down.

60+ providers · 31 built-in tools · 14 lsp ops · 28 dap ops · ~80k lines of Rust core.

[!NOTE] Pull requests are temporarily open to everyone as a trial. We previously required a vouch before accepting PRs; that requirement is lifted for now while we evaluate how open contributions go. Depending on the results, the vouch system may return.

Install

macOS · Linux

curl -fsSL https://omp.sh/install | sh

The install scripts fetch the prebuilt binary from build.stencil.so and check its SHA-256 before installing it; pass --source (PowerShell: -Source) to install the package with bun instead. Pin a release with curl -fsSL https://omp.sh/install | sh -s -- --binary --ref v<version> (PowerShell: -Binary -Ref v<version>).

Alpine / musl: the prebuilt musl binary links libstdc++/libgcc dynamically, which stock Alpine does not ship. Install them first: apk add libstdc++ libgcc.

Homebrew

brew install can1357/tap/omp

Bun (recommended)

bun install -g @oh-my-pi/pi-coding-agent

Nix

# Run without installing
nix run github:can1357/oh-my-pi

# Or install into the active profile (Nix < 2.30: `nix profile install`)
nix profile add github:can1357/oh-my-pi

Flake consumers can use packages.<system>.omp, overlays.default, nixosModules.default, or homeManagerModules.default. A Home Manager configuration can install OMP and own its settings declaratively:

{
  inputs.omp.url = "github:can1357/oh-my-pi";

  # In your Home Manager module:
  imports = [ inputs.omp.homeManagerModules.default ];
  programs.omp = {
    enable = true;
    settings.startup.quiet = true;
  };
}

Windows (PowerShell)

irm https://omp.sh/install.ps1 | iex

Pinned versions (mise)

mise use -g github:can1357/oh-my-pi

macOS · Linux · Windows · bun ≥ 1.4.4

Uninstall

curl -fsSL https://omp.sh/install | sh -s -- --uninstall
& ([scriptblock]::Create((irm https://omp.sh/install.ps1))) -Uninstall

The uninstaller removes what the install scripts installed: the standalone binary (~/.local/bin/omp, or $PI_INSTALL_DIR/omp; on Windows %LOCALAPPDATA%\omp\omp.exe and the user PATH entry the installer added) or the bun global package. It also removes an npm global install of @oh-my-pi/pi-coding-agent. For a Homebrew install it prints brew uninstall omp for you to run.

omp keeps its state in ~/.omp ($HOME/$PI_CONFIG_DIR when that is set, plus $XDG_*_HOME/omp if you ran omp config init-xdg): sessions, settings, credentials, caches, and the git worktrees omp created. The uninstaller keeps that state unless you confirm its prompt, which only interactive runs show (PowerShell, or sh install.sh --uninstall); curl … | sh runs never prompt, so they never delete it on their own. Pass --purge (PowerShell: -Purge) to uninstall and delete the state without a prompt. Shell completion files and PATH lines you added yourself stay in place.

Shell completions

omp generates its own completion scripts for bash, zsh, and fish from the live command/flag metadata, so they never drift from the actual CLI. Subcommands, flags, and enum values complete statically; model names (--model, --smol, --slow, --plan) resolve against the bundled model catalog and --resume against your on-disk sessions.

# zsh — add to ~/.zshrc (or write the output into a file on your $fpath)
eval "$(omp completions zsh)"

# bash — add to ~/.bashrc
eval "$(omp completions bash)"

# fish
omp completions fish > ~/.config/fish/completions/omp.fish

Every tool, benchmaxxed.

Edits that land on the first attempt. Reads that summarize files instead of dumping their content. Searches that return instantly. Pick any model — omp will get it right.

model metric what
Grok Code Fast 1 6.7% → 68.3% Tenfold lift the moment the edit format stops eating the model alive.
Gemini 3 Flash +5 pp Over str_replace — beats Google's own best attempt at the format.
Grok 4 Fast −61% tokens Output collapses once the retry loop on bad diffs disappears.
MiniMax 2.1× Pass rate more than doubles. Same weights, same prompt.

Read the full post ↗

The Pi you love, with batteries included.

Originally built on Mario Zechner's wonderful Pi, omp adds everything you're missing.

01 · Code execution w/ tool-calling

Most harnesses give the agent a Python sandbox and call it done. Ours runs persistent Python and a Bun worker, and either kernel can call back into the agent's own tools — read, search, task — over a loopback bridge. The agent loads a CSV with tool.read from inside Python, charts it from JavaScript, and never leaves the cell.

omp TUI running Python code and rendering a chart.

02 · LSP wired into every write

Ask for a rename and you get a rename. The call goes through workspace/willRenameFiles, so re-exports, barrel files, and aliased imports update before the file moves. Everything your IDE knows, the agent knows.

omp TUI with TypeScript and Biome language servers active.

Read the LSP config docs

03 · Drives a real debugger

A C binary segfaults: the agent attaches lldb, steps to the bad pointer, reads the frame. A Go service hangs: it attaches dlv and walks the goroutines. A Python process is wedged: debugpy, pause, inspect, evaluate. Most agents are still sprinkling print statements.

omp TUI: a live lldb-dap session against a native binary at /tmp/omp-native/demo. Adapter=lldb-dap, Status=stopped, Frame=xorshift32, Instruction pointer 0x10000055C, Location demo.c:6:10. Debug scopes and Debug variables cards show locals (x = 57351) and the agent confirms the math: x went from 7 → 57351 (= 7 ^ (7<<13)).

Watch the capture ↗

04 · Time-traveling stream rules

Your rules sit dormant until the model goes off-script. A regex match aborts the stream mid-token, injects the rule as a system reminder, and retries from the same point. You get course-correction without paying context tax on every turn. Injections survive compaction, so the fix sticks.

omp TUI: agent reading src.rs and about to write Box::leak when the request aborts (red Error: Request was aborted), an amber ⚠ Injecting rule: box-leak card injects the rule body Don't reach for Box::leak in production code paths, and the agent then course-corrects by proposing Arc<str> and asking the user to confirm.

Watch the capture ↗

05 · First-class subagents

Split a job across workers and get typed results back. task fans out into isolated worktrees, each worker runs its own tool surface, and the final yield is a schema-validated object the parent reads directly. No prose to parse, no merge conflicts between siblings, no orphaned edits.

omp TUI showing task spawning two subagents ComponentsExports and RoutesExports, the constraints block requiring an IRC DM between peers, the per-subagent status cards with cost and duration, and a final Findings section listing both exports plus an honest 'IRC coordination note' about a one-sided handshake.

Watch the capture ↗

Watch the fan-out while it runs: Alt+A opens Agent Hub, where the roster shows current activity and usage for every subagent. Open one to read its live transcript, type a steering message, revive a parked worker, or kill a stuck one without aborting the parent session.

06 · A second model, watching every turn.

Pair a reviewer model to the 'advisor' role and it reads every turn the main agent takes, injecting notes inline — a quiet aside, a concern, or a hard blocker. It runs on its own context and its own model, so it catches what the doer rushed past. The main agent sees the note and course-corrects, or tells you why it won't.

omp TUI: /advisor status shows the advisor running on openai-codex/gpt-5.5; after the main agent scopes a catch to ENOENT instead of swallowing every error, an amber 'Advisor 1 note (concern)' card warns the fix no longer matches the user's literal acceptance criterion.

Watch the capture ↗

/collab puts your live session on a relay and hands back a link — and a QR. A teammate joins from another terminal with omp join, or just opens it in a browser. Share read-write to pair on the same agent, or /collab view for a read-only link anyone can watch but no one can steer. Frames are sealed client-side; the relay never sees your keys.

omp TUI: /collab view prints 'Collab session started!' with an omp join command, a my.omp.sh browser link, the note 'Anyone with this link can watch the session but cannot prompt the agent', and a large scannable QR code.

Watch the capture ↗

08 · Read a pdf on arxiv, why not?

web_search chains twenty-five ranked providers and hands whatever URLs it finds straight to read. Arxiv PDFs, GitHub pages, Stack Overflow threads come back as structured markdown with anchors intact — the same tool surface you use on local files. Cite, follow, quote, never lose where you came from.

omp TUI: web_search returns 10 ranked Perplexity sources for inference-time compute scaling, the agent picks an arxiv paper, calls read https://arxiv.org/pdf/2604.10739v1, and summarizes the paper's headline result with real numbers.

Watch the capture ↗

09 · Unapologetically native. Even on Windows.

Other agents shell out to rg, grep, find, and bash. On many machines those binaries don't exist, and on the ones where they do, every call costs a fork-exec round-trip. omp links the real implementations into the process. ripgrep, glob, find: in-process. The bash is our own bash 5.3 engine — with sessions that survive across calls, and 58 command-line utilities (ls, sed, sort, xargs, even jq) ported into the builtins crate and run in-process, zero fork/exec. The same omp binary runs on macOS, Linux, and Windows — no WSL bridge.

10 · Code review with priorities and a verdict

Get a clear verdict on whether the change ships, with every issue ranked P0 through P3 and scored for confidence. /review spawns dedicated reviewer subagents that sweep branches, single commits, or uncommitted work in parallel. You tackle what blocks release first; nothing important hides in a wall of prose.

Want to steer the review yourself? /annotate code-review opens the diff so you can pin notes to lines before the reviewers run. /annotate also takes the latest reply, a session message, a file, or quoted text and pastes your notes into the prompt. See /annotate.

11 · Hashline: edit by content hash

Perfect edits, fewer tokens. The model points at anchors instead of retyping the lines it wants to change, so whitespace battles and string-not-found loops just stop happening. Edit a stale file and the anchors diverge — we reject the patch before it corrupts anything. Grok 4 Fast spends 61% fewer output tokens on the same work.

12 · GitHub is just another filesystem

Other harnesses bolt on gh_issue_view, gh_pr_view, gh_search — each with its own parameters the agent has to learn and you have to debug. We skipped that. read already handles paths; PRs are paths. One interface to teach the model, one surface to keep correct.

13 · Memory the agent curates

The agent remembers your codebase between sessions. It writes facts mid-run with retain, captures reusable lessons with learn, pulls them back with recall, and compresses each session into a mental model that loads on the first turn of the next one. Pick the engine with memory.backend — local, Hindsight, or Mnemopi. Project-scoped by default, so what it learns about this repo stays with this repo.

14 · ACP: editor-drivable agent

Run omp inside Zed and you get the same agent you drive from the terminal — reading the buffer you're actually looking at, writing through the editor's save path, spawning shells in the editor's terminal. Destructive tools pause for a permission prompt you can answer once and forget. No bridge, no plugin, no second brain to keep in sync.

15 · Works with what your repo already has

omp reads the project files your team already committed in their native shape — AGENTS.md, CLAUDE.md, .claude/ skills, commands and MCP servers, Codex .codex/config.toml and skills, OpenCode opencode.json, and .agents/. Your home directory stays yours: omp never reads another tool's ~/ config, and if you used to opt into it, a one-time prompt offers to copy or symlink it into ~/.omp/agent.

16 · omp commit: atomic splits, validated messages

omp reads the working tree through git_overview, git_file_diff, and git_hunk, then splits unrelated changes into atomic commits ordered by their dependencies. Cycles are rejected before anything is written. Source files score above tests, docs, and configs, so the headline commit is the one that matters. Lock files are excluded from analysis entirely.

17 · Read PRs. Walk skills. Pull JSON out of subagents.

Sixteen internal schemes — pr://, issue://, agent://, skill://, ssh://, and the rest — resolve transparently inside every FS-shaped tool the agent already calls. read pr://1428 returns the same shape as read src/foo.ts. grep walks a diff like a directory. agent://<id>/findings.0.path pulls a field out of a subagent's output by path.

18 · Conflict resolution, made easy.

Each merge conflict becomes one URL. The agent writes @theirs, @ours, or @base to conflict://N and the file resolves cleanly. Bulk form: conflict://*.

omp TUI: ✓ Read src/session.ts (⚠ 1 conflict), then ✓ Write conflict://1 · 1 line with content @theirs, then a confirmation 'Resolved.'

Watch the capture ↗

19 · Preview, then accept.

ast_edit returns a (proposed) card with the replacement count. The change is staged. The agent runs resolve "<reason>"; the TUI turns it into an Accept card and the disk move happens — atomic, all or nothing.

omp TUI: ✓ AST Edit: console.log($X) (proposed) 3 replacements · 1 file, then ✓ Accept: 3 replacements in 1 file (AST Edit), followed by 'Applied 3 replacements in src/auth.ts.'

Watch the capture ↗

20 · Drives a real browser. Or your Slack?

Eval's browser.open(...) returns a tab handle with direct navigation, inspection, interaction, and element helpers; tab.run(...) handles custom JavaScript. It drives Chromium or Electron in an isolated tab runtime. Stealth is on by default, while the browser relay can adopt Chrome tabs you already have open without stealing focus.

21 · Hands on the desktop itself

Eval's computer helpers — computer.window(...), win.screenshot(), win.ax(), el.press(), plus computer.run(fnOrCode, options) for multi-step scripts — control the real host: enumerate windows and displays, capture screenshots, send native input, walk the OS accessibility tree, and use the clipboard. It exposes no browser DOM.

Whatever the task needs, it's already in the box.

Core tools live in the same namespace as read and bash. Pin the active set with --tools read,edit,bash,…; rarely used discoverable tools mount as bash commands when tools.commands is enabled — run <tool> <args> with the bash tool, and <tool> --help for schema-derived usage instead of schemas shipped on every request.

Files & search

Runtime

Code intelligence

Coordination

Desktop & web

Memory & skills

Setting-gated, off by default: github, security_scan, generate_image, tts, checkpoint, rewind, and the memory tools (retain/recall/reflect/memory_edit, per memory.backend).

Full reference →

Prompt controls

Standalone, lowercase words opt a turn into specialized agent behavior:

They trigger only in prose, not inside code spans, fenced code blocks, XML/HTML sections, identifiers, or paths. See Magic keywords for exact matching rules and configuration.

Session controls

Slash commands shift how a whole session runs:

Sixty-plus providers, a thousand models, one /model away.

Nine roles route work by intent. default for normal turns. smol for cheap subagent fan-out. slow for deep reasoning. plan for plan mode. commit for changelogs. Plus vision, task, advisor, and tiny for their namesakes. Override at launch with --smol, --slow, or --plan; cycle through the configured models for the active role with Ctrl+P. Swap the active model mid-session with the /model slash command.

Auth tags below: oauth signs in with your provider account, plan routes through a coding-plan subscription, local runs against a local server with the key optional.

Frontier APIs

Direct APIs and gateways. Mix providers per role.

Anthropic oauth · OpenAI · OpenAI Codex oauth · Google Gemini · Google Vertex · xAI · SuperGrok oauth · DeepSeek · Mistral · Groq · Cerebras · SambaNova · Fireworks · Together · Modular · Baseten · Chutes · DeepInfra · ArkaneCloud · Hugging Face · NVIDIA · Meta · Inception · Amazon Bedrock · Azure OpenAI · SiliconFlow · GMI Cloud · CoreWeave · Sakana AI · Command Code · Charm Hyper · StepFun · Helmcode · OpenRouter · Synthetic · Vercel AI Gateway · Cloudflare AI Gateway · Wafer Serverless · Scaleway · Otari · Refuseless · Verda

Coding plans

Subscription-routed. /login attaches the session.

Cursor oauth · GitHub Copilot oauth · GitLab Duo · Devin oauth · Kiro oauth · Kimi Code plan · Moonshot · MiniMax Coding Plan plan · MiniMax Coding Plan CN plan · Alibaba Coding Plan plan · Qwen Portal oauth · Z.AI / GLM Coding Plan plan · Zhipu Coding Plan plan · Xiaomi MiMo · Qianfan · Umans plan · NanoGPT · Novita · Venice · Kilo · ZenMux · OpenCode Go · OpenCode Zen

Run it yourself

OpenAI-compatible /v1/models. Local instances skip the key.

Ollama local · Ollama Cloud · LM Studio local · llama.cpp local · vLLM local · LiteLLM · Bifrost

Custom OpenAI-compatible providers

Define custom providers in ~/.omp/agent/models.yml:

providers:
   spark:
      baseUrl: http://192.168.10.223:8000/v1
      api: openai-completions
      apiKey: dummy
      models:
         - id: minimax-m3
           name: MiniMax M3
           contextWindow: 100000
           maxTokens: 32000

Run omp models spark to verify discovery. Then run omp setup and choose the model in the default-model step, or open /model in a session and assign it to the default role.

To preconfigure the default without the picker, add the selector to ~/.omp/agent/config.yml:

modelRoles:
   default: spark/minimax-m3

Four knobs that make routing useful

Full provider & routing reference at omp.sh/docs/providers.

Twenty-five backends. One tool the agent already knows.

web_search is built in, not bolted on. auto walks a twenty-five-provider chain; pin one by name if you already pay for it. Behind every hit, site-aware extraction turns GitHub, registries, arXiv, Stack Overflow, and docs into structured markdown — anchors and link targets survive.

Search providers

Twenty-five backends. Pin one, or let auto walk the chain in order.

provider auth
auto chain
perplexity PERPLEXITY_API_KEY (anonymous fallback)
gemini oauth
anthropic oauth
codex oauth
xai oauth or XAI_API_KEY
zai ZAI_API_KEY
exa EXA_API_KEY (or mcp)
tinyfish TINYFISH_API_KEY
keenable KEENABLE_API_KEY (keyless fallback)
sofya SOFYA_API_KEY
jina JINA_API_KEY
kagi KAGI_API_KEY
tavily TAVILY_API_KEY
firecrawl FIRECRAWL_API_KEY (keyless fallback)
brave BRAVE_API_KEY
kimi /login kimi-code or search key
parallel PARALLEL_API_KEY
synthetic SYNTHETIC_API_KEY
searxng self-hosted
duckduckgo no key
startpage no key
google no key (browser)
ecosia no key (browser)
mojeek no key (browser)
public no key (all of the above, consolidated)

Exa also accepts a stored API key through /login exa; explicit keyless selection uses the public MCP fallback.

Specialised handlers

The agent gets structured content, not stripped HTML.

Pages convert to markdown with link structure intact. The agent can cite, follow, and quote without losing anchors.

Security databases

Vuln lookups answer with vendor data, not blog summaries.

web_search reference ↗

Roughly ~80,000 lines of Rust, doing the work other harnesses shell out for.

Six crates, one platform-tagged N-API addon. Search, shell, AST, highlight, PTY, desktop control, image decode, BPE counting — all in-process on the libuv pool. No fork/exec on the hot path. The shell is our own bash 5.3 engine, and 58 command-line utilities — coreutils, findutils, sed, jq, ripgrep-backed grep, fd, diff, moreutils — are ported into the builtins crate and compiled straight into the shell.

Per crate, code lines only:

Crate What it does ~LoC
omp-shell Embedded bash engine · persistent sessions · in-process coreutils dispatch · minimizer 38,000
omp-natives The N-API surface — every module in the table below 25,000
omp-xfs Parallel walker · listing cache · glob · regex search for natives and shell rg/grep/fd 11,400
omp-iso Workspace isolation · apfs · btrfs · zfs · reflink · overlayfs · projfs · rcopy 3,300
omp-ast tree-sitter + ast-grep matching, block resolution, structural summaries 2,900
omp-voice Audio capture/playback · Opus · live WebRTC 1,000

Inside omp-natives, the per-module breakdown (glue and tests omitted):

Module What it does Powered by ~LoC
desktop Window/display enumeration · screenshot · native input · AX tree for computer xcap · enigo · OS AX FFI 10,600
grep Regex search · parallel/sequential · glob & type filters · fuzzy find grep-regex · grep-searcher 3,280
text ANSI-aware width · truncation · column slicing · SGR-preserving wrap unicode-width · segmentation 2,070
snapcompact Bitmap-frame rasterization + PNG encode for context compression image · png 1,760
keys Kitty keyboard protocol with xterm fallback · PHF perfect-hash lookup phf 1,740
ast ast-grep pattern matching and structural rewrites ast-grep-core 1,510
diff Structured file diffing for tools and previews in-tree 1,030
pty Native PTY allocation for sudo · ssh interactive prompts in-tree 630
crash_handler Native crash capture and reporting in-tree 610
highlight Syntax highlighting · 11 semantic categories · 30+ aliases syntect 550
appearance Mode 2031 + native macOS dark/light via CoreFoundation FFI core-foundation 450
task Blocking work on libuv thread pool · cancellation · timeout · profiling tokio · napi 440
glob Discovery with glob · type filters · mtime sort · gitignore respect ignore · globset 430
fd Filesystem walker for find-tool replacement ignore 385
clipboard Text copy and image read from system clipboard · no xclip/pbcopy arboard 370
workspace Workspace walker with gitignore + AGENTS.md discovery in one pass ignore 275
power macOS power-assertion API for idle/system/display-sleep prevention IOKit FFI 270
prof Circular buffer profiler with folded-stack and SVG flamegraph output inferno 240
file_lock Cross-process advisory file locking in-tree 210
ps Cross-platform process-tree kill and descendant listing libc · libproc · CreateToolhelp32Snapshot 195
tokens O200k / Cl100k BPE token counting · both tables embedded tiktoken-rs 70
html HTML to Markdown with optional content cleaning html-to-markdown-rs 60
sixel Terminal image rendering · decode PNG · JPEG · WebP · GIF · resize · SIXEL encode icy_sixel · image 55

Four entry points: interactive, one-shot, RPC, and ACP.

Same engine, four wrappers. omp runs the TUI. omp -p answers a single prompt and exits. The Node SDK embeds the session in your process. omp --mode rpc and omp acp hand the wheel to another program over stdio.

Interactive — when in doubt, the agent asks

The TUI is the default surface. Tool calls render as cards, edits preview before they land, and ambiguity routes through the ask tool — a form the agent can put up mid-turn, with its recommendation preselected. The keyboard handles the rest.

The same forms surface over ACP as elicitations, so editors get them without writing a dialog.

omp TUI showing a multi-select field of an ask form.

SDK — embed in Node

@oh-my-pi/pi-coding-agent

Node and TypeScript hosts pull the engine in directly. The package exposes ModelRegistry, SessionManager, createAgentSession, and discoverAuthStorage; the session emits typed events you subscribe to.

import { ModelRegistry, SessionManager, createAgentSession, discoverAuthStorage } from "@oh-my-pi/pi-coding-agent";

const auth = await discoverAuthStorage();
const models = new ModelRegistry(auth);
await models.refresh();

const { session } = await createAgentSession({
	sessionManager: SessionManager.inMemory(),
	authStorage: auth,
	modelRegistry: models,
});
await session.prompt("list .ts files");

RPC — drive over stdio

omp --mode rpc

For non-Node embedders, or when you want process isolation. NDJSON commands in, response and event frames out; each prompt ends with its own prompt_result. --mode rpc-ui adds tool cards, selectors, and dialogs as extension_ui_request frames the host must answer; --no-ui keeps even extension dialogs off the wire for hosts with no UI.

$ omp --mode rpc --no-session
> {"id":"r1","type":"prompt","message":"list .ts files"}
< {"id":"r1","type":"response", ...}
> {"id":"r2","type":"set_model","provider":"anthropic","modelId":"sonnet-4.5"}
> {"id":"r3","type":"abort"}

ACP — speak to editors

omp acp

The Agent Client Protocol over JSON-RPC. When the editor advertises capabilities, tool I/O routes through it and writes are gated by session/request_permission. On SIGTERM or SIGHUP, omp acp records its active turn as interrupted. omp --restore can resume it.

omp tool ACP route
bash terminal/create + terminal/output
read fs/read_text_file
write fs/write_text_file
edit, bash session/request_permission

Full reference: omp.sh/docs/sdk.

A harness worth keeping is one you don't outgrow.

Pick it up at omp.sh.

omp is a fork of Pi by Mario Zechner, rewritten as a coding-first surface: sessions, subagents, slash commands, extensions — all TypeScript, all MIT, all on GitHub. Shape it from config, hook it from outside, or read the source when you need to.

Primitives

An extension is a TypeScript module. Same tool API, same slash-command registry, same hotkey table, same TUI primitives the built-ins use. Nothing is reserved.

Discovery

omp picks up project-level context, skills, commands, and MCP servers from .claude, .codex, .opencode/opencode.json, .agents, and standalone AGENTS.md/CLAUDE.md. Other tools' home-directory config is never read.

Extensibility

Ask omp to write the piece you're missing, then /reload-plugins. Keep it local, ship it in a marketplace, or publish it to npm.

Philosophy

omp is a fork of pi-mono by Mario Zechner, extended with a batteries-included coding workflow.

Key ideas:

Project inputs and trust

Opening a repository loads its project inputs by design: settings, extensions, hooks, tools, commands, skills, rules, and project MCP configuration. To exclude project .mcp.json for one invocation, pass --config <file> pointing at a YAML overlay with nested keys (a flat mcp.enableProjectConfig: false line is ignored):

mcp:
   enableProjectConfig: false

Use --no-extensions to skip ambient extension discovery; or use --trusted-extension /absolute/path/to/file.ts for an exact extension allowlist. --no-tools disables built-in tools, but project tool modules remain a separate discovery surface. These flags narrow inputs without changing the repository-trust model.


Development

Getting started from source

Fresh clones need both workspace dependencies and the local Rust/N-API addon before the source CLI can start.

bun setup
bun dev

bun setup installs Bun workspaces and builds @oh-my-pi/pi-natives. Re-run bun run build:native after changing Rust crates or packages/natives.

Nix users get the pinned Bun and Rust toolchains plus all native build dependencies:

nix develop
bun setup
bun dev

Build and smoke-test the distributable Nix package with nix build .#omp. Wayland screencast support is off by default (putting libpipewire on the addon's library path adds ~750 MB of runtime closure); enable it with omp.override { withWaylandScreencast = true; }. Release builds link omp-natives with fat LTO; omp.override { withFatLto = false; } uses thin LTO for much faster local rebuilds. Rust dependencies and the native addon build in separate derivations, so Rust edits reuse compiled dependencies and TypeScript edits reuse the addon. nix/bun.nix is generated only when bun.lock changes; releases regenerate it automatically. For dependency changes, run:

bun run gen:nix

The command uses bun2nix from nix develop when available, otherwise enters the development shell through Nix, then falls back to the pinned bunx [email protected]. Do not edit nix/bun.nix manually.

For a non-interactive smoke check:

bun dev -- --version

Apple Silicon Nix builds

On Apple Silicon, nix build .#omp compiles the Apple Foundation Models bridge with nixpkgs' Swift compiler and apple-sdk_27; host Xcode or Command Line Tools are never used, and the build fails rather than shipping without the bridge. Both are build-only dependencies. Using the models still requires macOS 27+, an eligible device, and Apple Intelligence enabled. To build without the bridge, use omp.override { withAppleFm = false; }.

Debug Command

/debug opens tools for debugging, reporting, and profiling.

For architecture and contribution guidelines, see packages/coding-agent/DEVELOPMENT.md.


Monorepo Packages

Package Description
@oh-my-pi/collab-web Browser guest client, mock host, and local relay for collab live sessions
@oh-my-pi/pi-ai Multi-provider LLM client with streaming and model/provider integration
@oh-my-pi/pi-catalog Model catalog: bundled model database, provider descriptors, and identity
@oh-my-pi/pi-agent-core Agent runtime with tool calling and state management
@oh-my-pi/pi-coding-agent Interactive coding agent CLI and SDK
@oh-my-pi/pi-tui Terminal UI library: one component tree, rendered as rows or natively (TSP)
@oh-my-pi/pi-natives N-API bindings for grep, shell, image, text, syntax highlighting, and more
@oh-my-pi/omp-stats Local observability dashboard for AI usage statistics
@oh-my-pi/omptype ArkType-compatible schema validation with lazy JIT compilation
@oh-my-pi/pi-utils Shared utilities (logging, streams, dirs/env/process helpers)
@oh-my-pi/pi-wire Shared collab live-session protocol types and relay constants
@oh-my-pi/pi-mnemopi Local SQLite memory engine for omp agents
@oh-my-pi/snapcompact Bitmap-frame context compression package and SQuAD eval suite
@oh-my-pi/browser-relay Chrome extension that lets the Eval browser API drive your existing tabs
@oh-my-pi/pi-metaharness Unified benchmark runners, Harbor run storage, REST/SSE API, live dashboard
@oh-my-pi/typescript-edit-benchmark Edit benchmark suite built on TypeScript source mutations

Rust Crates

Crate Description
omp-natives Core Rust native addon (N-API cdylib) used by @oh-my-pi/pi-natives; aggregates the crates below
omp-shell Embedded bash 5.3 engine (parser, VM, process spawning, sessions), PTY, and process management
omp-ast tree-sitter-based code summarizer and AST utilities (50+ language grammars)
omp-iso Task isolation backend resolver: APFS clones, btrfs/zfs reflinks, overlayfs, projfs, rcopy
omp-voice Audio capture/playback, Opus codecs, and live WebRTC streaming primitives
omp-xfs Parallel ignore-aware walker, directory-listing cache, glob, and content search for natives + shell
omp-edit Edit engine behind the edit tool: line-anchored patch/hashline modes, streaming previews, atomic apply
omp-builtins 67 in-process command-line utilities plus process builtins (ps, top, pgrep, pkill, …)

Contributing

Issues and pull requests are open to everyone. Open PRs are currently a trial — the previous vouch requirement is lifted while we evaluate how it goes, and it may return. See CONTRIBUTING.md for guidelines on contributing.


License

OMP is licensed under the MIT License.

Third-party and vendored code, including the third-party portions identified in crates/builtins/LICENSE, remains under its respective upstream license. Each shipped component carries its own THIRD-PARTY-NOTICES.txt: the CLI (packages/coding-agent), the native addon (packages/natives), and robomp (python/robomp). omp --license prints the CLI's and the addon's.

© 2025 Mario Zechner
© 2025-2026 Can Bölük
© 2026 Stencil Labs, Inc.

made for terminals that stay open

oh-my-pi (can1357/oh-my-pi)

正在搜索数据库…

这是什么?omp(oh-my-pi)是一个终端编程助手(coding agent),基于 Mario Zetchner 的 Pi 修改而来,集成了 IDE 功能,由 Stencil Labs 开发:支持 60 多家模型服务商、31 个内置工具、14 种 LSP 操作和 28 种调试器操作,Rust 核心代码约 8 万行。
它是我在终端里运行的命令行工具,还是装到编辑器里的东西?是一个终端工具:你在 shell 里运行 omp,通过它的 TUI 界面来干活。它也能从 Zed 这类编辑器通过 ACP 调用——还是同一个 agent,读取你正在看的文件内容——但主战场还是你的终端。
怎么安装?macOS 和 Linux 上可以用 Homebrew 或 Bun(推荐),也可以用带 Home Manager 模块的 Nix flake,Windows 上有 PowerShell 安装器,还能通过 mise 安装固定版本。走 Bun 的话需要 bun 1.3.14 或更新版本。
它能用哪些模型服务商——我需要 Anthropic 的密钥吗?用哪家服务商就带哪家的密钥:omp 支持多家服务商,有 60 多种选择,包括 OpenAI 和 Anthropic,不会被绑死在一家厂商上。程序本身是自包含的,系统里不需要装 rg、grep 或 bash。
安装上有什么坑需要提前知道?在 Alpine 或 musl 系统上,先运行 apk add libstdc++ libgcc——预编译的二进制文件动态链接了这两个库,而原生 Alpine 不自带。另外,目前对所有人开放的 PR 政策是试行的,之后可能恢复需要担保人(vouch)的要求。
它在 Windows 上能原生运行吗,还是需要 WSL?三大系统都能原生运行——同一个 omp 二进制文件可以直接在 macOS、Linux 和 Windows 上跑,不需要 WSL。连 shell 都是内置的:brush 充当 bash,ls、sed、sort、xargs 和 jq 也都被移植成进程内运行。
它能做到大多数编程助手做不到的什么事?它会接入真正的调试器(lldb、dlv、debugpy),而不是靠 print 语句瞎猜;能跑 LSP 重命名并同步更新 barrel 文件和再导出;能像读本地文件一样用同一个 read 工具读取 arxiv 的 PDF 和 GitHub 的 PR;甚至能控制你的桌面——窗口、截图、无障碍树、原生输入。
队友能加入我的 agent 会话一起结对吗?可以——/collab 会把当前会话放到一个中继服务器上,返回一个链接和一个二维码。队友可以在另一个终端用 omp join 加入,或直接用浏览器打开;可以共享读写权限一起操控,也可以只给只读权限旁观。数据帧在客户端就加密了,中继服务器看不到你的密钥。
这个 agent 会记住我的代码库吗,跨会话也行吗?会。它在运行过程中用 retain 记录事实,用 learn 沉淀可复用的经验,再用 recall 取回来,把每次会话压缩成一个心智模型,下次运行时自动加载。默认按项目隔离,memory.backend 可以选择引擎:local、Hindsight 或 Mnemopi。
我已经有 Cursor 和 Cline 的规则文件了——必须转换格式吗?不用。omp 能直接读取八种现有格式的原始形态——Cursor 的 MDC、Cline 的 .clinerules、Codex 的 AGENTS.md、Copilot 的 applyTo 等等——所以你们团队上季度写的配置今晚就能用,不需要迁移脚本,也没有“仅支持部分特性”之类的脚注。
作者
can1357
大小
886.9 MB
星标
40.3K
时长
11个月
提交 · 90 天