Pi Coding Agent is a minimal terminal-based coding agent designed for developers who want to build their own AI agent harness. According to the official project site, npm registry, and GitHub repository, the focus is on extending the core rather than relying on pre-built full-featured agents. Information from independent official sources (pi.dev, npm, GitHub) is used to organize installation methods and extension points.

📑Table of Contents
  1. What is Pi Coding Agent
  2. Installation and Initial Setup
  3. Core Tools and Model Selection
  4. Extension Examples — Adding Hatena Bookmark Search or Web Search
  5. Comparison with Other Agents
  6. Summary and Next Steps
  7. Frequently Asked Questions (FAQ)
  8. Pi Coding Agentとは
  9. インストールと初期設定
  10. 基本ツールとモデル選択
  11. 拡張例 —— はてなブックマーク検索やWeb検索の追加
  12. 他のエージェントとの比較
  13. まとめと次のステップ
  14. よくある質問(FAQ)

What is Pi Coding Agent

Pi Coding Agent (hereafter Pi) is an open-source terminal-based coding agent developed by Mario Zechner. The GitHub repository is earendil-works/pi and the npm package is @earendil-works/pi-coding-agent. The official site pi.dev positions it as “There are many agent harnesses but this one is yours.”

The key characteristic is its thin abstraction layer. It operates close to the LLM API, allowing easy switching between models and providers such as ChatGPT, Claude, Gemini, and xAI Grok. Default tools include read, write, edit, and bash, with additional CLI tools like grep and find available.

The design emphasizes extensibility through TypeScript. Examples include adding custom tools such as Hatena bookmark search or web search. It is also referenced in the author’s book “作って学ぶAIエージェント.”


Installation and Initial Setup

Installation is straightforward via npm.

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Alternatively, use the official script:

curl -fsSL https://pi.dev/install.sh | sh

After installation, use /login to authenticate with model providers and /model to select the active model. It supports ChatGPT Plus/Pro, Claude Pro/Max, GitHub Copilot, and various API providers. The setup requires minimal configuration files due to the thin design.


Core Tools and Model Selection

The default tools focus on file operations and shell execution. The read tool inspects file contents, while write and edit modify them. The bash tool executes arbitrary commands, covering most development workflows.

Model flexibility is a major advantage. You can route requests through OpenRouter or Vercel AI Gateway and choose from multiple providers. Official sources highlight the ability to switch models without being locked into a single ecosystem.


Extension Examples — Adding Hatena Bookmark Search or Web Search

Extensions are implemented as TypeScript extensions. You define new tools and register them with the agent. A Hatena bookmark search tool can fetch popular entries via the API and use them as context. Web search tools follow the same pattern by integrating external APIs.

Extensions can be shared via npm packages or Git repositories. The pi.dev documentation covers Skills, Prompt Templates, Themes, and Pi packages as additional extension mechanisms. These allow tailoring the agent to specific tasks or personal workflows.


Comparison with Other Agents

Compared to Claude Code or Codex, Pi Coding Agent maintains a thinner harness layer. It starts with minimal features but offers greater flexibility for customization.

Item Pi Coding Agent Claude Code Codex
Harness Layer Thin (extension-first) Thick Thick
Extensibility TypeScript extension Limited Limited
Model Flexibility High (multiple providers) Restricted Restricted
Installation npm / shell script Dedicated client Dedicated client

This table shows that Pi is designed with customization in mind. Rather than relying on the rich features provided by other tools, the style is to build only the necessary parts yourself. Official sources emphasize this approach as “your own.”


Summary and Next Steps

Other AI tool articles on devgent.org (such as AI Browser Comparison and AI Cost Comparison Tool) are also recommended for reference.

Pi Coding Agent serves as a foundation for shifting from “using” AI agents to “building” them. Understanding the flow from installation to extension can streamline daily development work.

As a next step, try installing it via npm and testing basic file operations. Then, add a simple search tool in TypeScript and consider extensions tailored to your workflow. It is recommended to proceed while referring to the official GitHub repository and pi.dev.


Frequently Asked Questions (FAQ)

Q: What are the main features of Pi Coding Agent?

It is a minimal terminal-based harness with TypeScript extensibility and high model selection flexibility. Details are explained on the official blog and pi.dev.

Q: How do I install it?

Use npm install -g –ignore-scripts @earendil-works/pi-coding-agent or the official install script. See pi.dev for reference.

Q: Which model is recommended?

Depending on your use case, leverage OpenRouter or API keys from various providers. The design makes it easy to switch between multiple models.

Q: How do I extend it?

Create a TypeScript extension and add tools. Examples such as Hatena bookmark search or web search are useful references.

Q: What is the difference from Claude Code or Codex?

Pi uses a thin layer with extension as a premise, so initial features are fewer, but the degree of customization freedom is higher.


Pi Coding Agentとは

Pi Coding Agent(以下、Pi)は、Mario Zechner氏が開発したオープンソースのターミナル型コーディングエージェントです。GitHubリポジトリはearendil-works/pi、npmパッケージは@earendil-works/pi-coding-agentとして公開されています。公式サイトpi.devでは「多くのエージェントハーネスがあるが、これはあなた自身のもの」と位置づけられています。

このツールの特徴は、薄い抽象化レイヤーです。LLMのAPIに近い位置で動作するため、モデルやプロバイダの切り替えが容易です。ChatGPT、Claude、Gemini、xAI Grokなど複数のプロバイダに対応します。デフォルトでread、write、edit、bashなどの基本ツールが用意されており、grepやfindなどのCLIツールも利用可能です。

拡張性を重視した設計により、TypeScriptでカスタム機能を追加できます。はてなブックマーク検索やWeb検索などの独自ツールを組み込む例が、公式の文脈で示されています。著者の書籍「作って学ぶAIエージェント」との関連も指摘されています。


インストールと初期設定

インストールはシンプルです。npm経由でグローバルインストールします。

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

または、公式のインストールスクリプトを利用できます。

curl -fsSL https://pi.dev/install.sh | sh

インストール後、/loginコマンドでモデルプロバイダにログインします。/modelコマンドで使用モデルを選択可能です。ChatGPT Plus/Pro、Claude Pro/Max、GitHub Copilotなどに対応しています。APIキーを持つプロバイダも柔軟に設定できます。

初期設定では、プロジェクトディレクトリ内でエージェントを起動し、対話形式でコード生成や編集を行います。薄い設計のため、追加の設定ファイルは最小限で済みます。


基本ツールとモデル選択

デフォルトツールはファイル操作とシェル実行に特化しています。readでファイル内容を確認し、writeやeditで変更を加えます。bashツールで任意のコマンドを実行可能です。これにより、開発ワークフローの大部分をカバーします。

モデル選択の柔軟性が強みです。OpenRouterやVercel AI Gateway経由で多様なモデルを利用できます。プロバイダの制限を受けにくいため、最新モデルやコストの低い選択肢を試せます。公式情報では、複数のプロバイダを切り替える実例が紹介されています。


拡張例 —— はてなブックマーク検索やWeb検索の追加

Pi Coding Agentの拡張はTypeScript extensionで行います。新しいツールを定義し、エージェントのツールセットに登録します。はてなブックマーク検索ツールの追加例では、APIを呼び出して人気エントリを取得し、コンテキストとして活用します。

Web検索ツールの追加も同様です。外部APIと連携し、最新情報をエージェントに与えます。拡張はnpmパッケージやGitリポジトリ経由で共有可能です。pi.devのドキュメントでは、Skills、Prompt Templates、Themes、Pi packagesといった拡張手段が説明されています。

これらの拡張により、汎用エージェントを自分専用のハーネスに近づけられます。特定の業務や趣味に特化した機能を追加するケースが想定されています。


他のエージェントとの比較

Claude CodeやCodexなどの既存エージェントと比較すると、Pi Coding Agentはハーネス層が薄い点が異なります。拡張前提の設計のため、初期機能は最小限ですが、柔軟性が高いです。

項目 Pi Coding Agent Claude Code Codex
ハーネス層 薄い (拡張前提) 厚め 厚め
拡張性 TypeScript extension 限定的 限定的
モデル柔軟性 高い (複数provider) 制限あり 制限あり
インストール npm / シェルスクリプト 専用クライアント 専用クライアント

この表からわかるように、Piはカスタマイズを前提としています。他のツールが提供する豊富な機能に頼るのではなく、必要な部分だけを自分で構築するスタイルです。公式ソースでは、このアプローチが「自分のもの」として強調されています。


まとめと次のステップ

devgent.orgの他のAIツール記事(AI ブラウザ比較 や AI コスト比較ツール)も参考にしてください。

Pi Coding Agentは、AIエージェントを「使う」から「作る」へシフトするための基盤となります。インストールから拡張までの一連の流れを理解すれば、日常の開発作業を効率化できます。

次のステップとして、実際にnpmでインストールし、基本的なファイル操作を試してみてください。その後、TypeScriptで簡単な検索ツールを追加し、自分のワークフローに合わせた拡張を検討すると良いでしょう。公式のGitHubリポジトリやpi.devを参照しながら進めることをおすすめします。


Related articles:

よくある質問(FAQ)

Q: Pi Coding Agentの主な特徴は?

最小限のターミナル型ハーネスで、TypeScriptによる拡張性とモデル選択の柔軟性が特徴です。公式ブログやpi.devで詳細が解説されています。

Q: インストール方法は?

npm install -g –ignore-scripts @earendil-works/pi-coding-agent または公式インストールスクリプトで導入できます。pi.devを参照してください。

Q: どのモデルがおすすめ?

用途に応じてOpenRouterや各プロバイダのAPIキーを活用できます。複数のモデルを切り替えやすい設計です。

Q: 拡張はどのように行う?

TypeScript extensionを作成し、ツールを追加します。はてなブックマーク検索やWeb検索の例が参考になります。

Q: Claude CodeやCodexとの違いは?

Piは薄いレイヤーで拡張を前提とするため、初期機能は少ないですが、カスタマイズの自由度が高い点が異なります。

krona23

Author

krona23

Over 20 years in the IT industry, serving as Division Head and CTO at multiple companies running large-scale web services in Japan. Experienced across Windows, iOS, Android, and web development. Currently focused on AI-native transformation. At DevGENT, sharing practical guides on AI code editors, automation tools, and LLMs in three languages.

DevGENT about →

Leave a Reply

Trending

Discover more from DevGENT

Subscribe now to keep reading and get access to the full archive.

Continue reading