can1357 17b7e7217b feat(ai/scripts): added model generation script to fetch AI model definitions from external APIs
- Added model generation script to automatically fetch and update AI model definitions from models.dev and OpenRouter APIs.
- Implemented support for multiple providers including Anthropic, Google, OpenAI, Groq, Cerebras, xAI, Mistral, OpenCode, GitHub Copilot, OpenRouter, Google Vertex, and Cursor.
- Updated generated file comment to reference bun instead of npm for running the script.
2026-01-11 07:36:36 +01:00
2026-01-08 14:13:08 +01:00
2026-01-10 06:32:51 +01:00
2026-01-11 04:38:09 +01:00

Pi Monorepo

AI coding agent for the terminal

npm version Changelog CI License TypeScript Bun

Fork of badlogic/pi-mono by @mariozechner


Installation

Requires Bun runtime:

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

Via installer script

Linux / macOS:

curl -fsSL https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.ps1 | iex

By default, the installer uses bun if available, otherwise downloads the prebuilt binary.

Options:

  • --source / -Source: Install via bun (installs bun first if needed)
  • --binary / -Binary: Always use prebuilt binary
  • --ref <ref> / -Ref <ref>: Install a tag/commit/branch (defaults to source install)
# Force bun installation
curl -fsSL .../install.sh | sh -s -- --source

# Install a tag via binary
curl -fsSL .../install.sh | sh -s -- --binary --ref v3.20.1

# Install a branch or commit via source
curl -fsSL .../install.sh | sh -s -- --source --ref main
# Install a tag via binary
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.ps1))) -Binary -Ref v3.20.1

# Install a branch or commit via source
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.ps1))) -Source -Ref main

Manual download

Download binaries directly from GitHub Releases.


+ LSP Integration (Language Server Protocol)

lsp

Full IDE-like code intelligence with automatic formatting and diagnostics:

  • Format-on-write: Auto-format code using the language server's formatter (rustfmt, gofmt, prettier, etc.)
  • Diagnostics on write/edit: Immediate feedback on syntax errors and type issues after every file change
  • Workspace diagnostics: Check entire project for errors (lsp action=workspace_diagnostics)
  • 40+ language configs: Out-of-the-box support for Rust, Go, Python, TypeScript, Java, Kotlin, Scala, Haskell, OCaml, Elixir, Ruby, PHP, C#, Lua, Nix, and many more
  • Local binary resolution: Auto-discovers project-local LSP servers in node_modules/.bin/, .venv/bin/, etc.
  • Hover docs, symbol references, code actions, workspace-wide symbol search

+ Time Traveling Streamed Rules (TTSR)

ttsr

Zero context-use rules that inject themselves only when needed:

  • Pattern-triggered injection: Rules define regex triggers that watch the model's output stream
  • Just-in-time activation: When a pattern matches, the stream aborts, the rule injects as a system reminder, and the request retries
  • Zero upfront cost: TTSR rules consume no context until they're actually relevant
  • One-shot per session: Each rule only triggers once, preventing loops
  • Define via ttsrTrigger field in rule files (regex pattern)

Example: A "don't use deprecated API" rule only activates when the model starts writing deprecated code, saving context for sessions that never touch that API.

+ Interactive Code Review

review

Structured code review with priority-based findings:

  • /review command: Interactive mode selection (branch comparison, uncommitted changes, commit review)
  • Structured findings: report_finding tool with priority levels (P0-P3: critical → nit)
  • Verdict rendering: aggregates findings into approve/request-changes/comment
  • Combined result tree showing verdict and all findings

+ Task Tool (Subagent System)

task

Parallel execution framework with specialized agents and real-time streaming:

  • 5 bundled agents: explore, plan, browser, task, reviewer
  • Parallel exploration: Reviewer agent can spawn explore agents for large codebase analysis
  • Real-time artifact streaming: Task outputs stream as they're created, not just at completion
  • Output tool: Read full agent outputs by ID when truncated previews aren't sufficient
  • User-level (~/.omp/agent/agents/) and project-level (.omp/agents/) custom agents
  • Concurrency-limited batch execution with progress tracking

+ Model Roles

models

Configure different models for different purposes with automatic discovery:

  • Three roles: default (main model), smol (fast/cheap), slow (comprehensive reasoning)
  • Auto-discovery: Smol finds haiku → flash → mini; Slow finds codex → gpt → opus → pro
  • Role-based selection: Task tool agents can use model: pi/smol for cost-effective exploration
  • CLI args (--smol, --slow) and env vars (OMP_SMOL_MODEL, OMP_SLOW_MODEL)
  • Configure via /model selector with keybindings (Enter=default, S=smol, L=slow)

+ Ask Tool (Interactive Questioning)

ask

Structured user interaction with typed options:

  • Multiple choice questions: Present options with descriptions for user selection
  • Multi-select support: Allow multiple answers when choices aren't mutually exclusive

+ Custom TypeScript Slash Commands

slash

Programmable commands with full API access:

  • Create at ~/.omp/agent/commands/[name]/index.ts or .omp/commands/[name]/index.ts
  • Export factory returning { name, description, execute(args, ctx) }
  • Full access to HookCommandContext for UI dialogs, session control, shell execution
  • Return string to send as LLM prompt, or void for fire-and-forget actions
  • Also loads from Claude Code directories (~/.claude/commands/, .claude/commands/)

+ Universal Config Discovery

discovery

Unified capability-based discovery that loads configuration from 8 AI coding tools:

  • Multi-tool support: Claude Code, Cursor, Windsurf, Gemini, Codex, Cline, GitHub Copilot, VS Code
  • Discovers everything: MCP servers, rules, skills, hooks, tools, slash commands, prompts, context files
  • Native format support: Cursor MDC frontmatter, Windsurf rules, Cline .clinerules, Copilot applyTo globs, Gemini system.md, Codex AGENTS.md
  • Provider attribution: See which tool contributed each configuration item
  • Discovery settings: Enable/disable individual providers via /config interactive tab
  • Priority ordering: Multi-path resolution across .omp, .pi, and .claude directories

+ MCP & Plugin System

perplexity

Full Model Context Protocol support with external tool integration:

  • Stdio and HTTP transports for connecting to MCP servers
  • Plugin CLI (omp plugin install/enable/configure/doctor)
  • Hot-loadable plugins from ~/.omp/plugins/ with npm/bun integration
  • Automatic Exa MCP server filtering with API key extraction

+ Web Search & Fetch

arxiv

Multi-provider search and full-page scraping:

  • Anthropic, Perplexity, and Exa search integration with caching
  • HTML-to-markdown conversion with link preservation
  • JavaScript rendering support, image handling

+ TUI Overhaul

Modern terminal interface with smart session management:

  • Auto session titles: Sessions automatically titled based on first message using smol model
  • Welcome screen: Logo, tips, recent sessions with selection
  • Powerline footer: Model, cwd, git branch/status, token usage, context %
  • LSP status: Shows which language servers are active and ready
  • Hotkeys: ? displays shortcuts when editor empty
  • Emergency terminal restore: Crash handlers prevent terminal corruption

+ Edit Fuzzy Matching

Handles whitespace and indentation variance automatically:

  • High-confidence fuzzy matching for oldText in edit operations
  • Fixes the #1 pain point: edits failing due to invisible whitespace differences
  • Configurable via edit.fuzzyMatch setting (enabled by default)

... and many more

  • Git context: System prompt includes branch, status, recent commits
  • Bun runtime: Native TypeScript execution, faster startup, all packages migrated
  • Centralized file logging: Debug logs with daily rotation to ~/.omp/logs/
  • Clipboard export: /export --copy copies session as formatted text
  • Bash interceptor: Optionally block shell commands that have dedicated tools
  • Hidden tools: Custom tools can be excluded from default list unless explicitly requested
  • @file auto-read: Type @path/to/file in prompts to inject file contents inline
  • Additional tools: AST (structural code analysis), Replace (find & replace across files)

Packages

Package Description
@oh-my-pi/pi-agent-core Agent runtime with tool calling and state management
@oh-my-pi/pi-coding-agent Interactive coding agent CLI
@oh-my-pi/pi-git-tool Structured Git tool with safety guards and typed output
@oh-my-pi/pi-tui Terminal UI library with differential rendering

License

MIT - Original work copyright Mario Zechner

S
Description
Local fork of can1357/oh-my-pi with omp-specific patches
Readme 449 MiB
Languages
TypeScript 83.8%
Rust 9.7%
Python 5.3%
Nix 0.3%
CSS 0.2%
Other 0.5%