# pi | Earendil Works | Knowledge Base | Instagit

AI agent toolkit: coding agent CLI, unified LLM API, TUI & web UI libraries, Slack bot, vLLM pods

GitHub Stars: 54.3k

Repository: https://github.com/earendil-works/pi

---

## Articles

### [How Earendil π Handles OAuth Authentication for API Keys](/earendil-works/pi/earendil-pi-oauth-authentication-api-keys)

Learn how Earendil π handles OAuth authentication for API keys. Store and refresh OAuth credentials client-side for seamless API access with models supporting OAuth subscriptions.

- Tags: how-to-guide
- Published: 2026-05-25

### [Using Earendil Pi in RPC Mode: JSON-L Protocol Integration Guide](/earendil-works/pi/using-earendil-pi-in-rpc-mode)

Integrate Earendil Pi's headless JSON-L protocol for RPC mode. Control the coding agent programmatically via stdin/stdout without a terminal interface. Drive Earendil Pi with structured commands.

- Tags: how-to-guide
- Published: 2026-05-25

### [Earendil Pi Message Compaction: Managing Long Sessions in the AgentSession Pipeline](/earendil-works/pi/earendil-pi-message-compaction-long-sessions)

Earendil Pi compacts long agent sessions by summarizing history, ensuring smooth LLM interaction. Discover its abort-aware pipeline for customizable session management.

- Tags: internals
- Published: 2026-05-25

### [Configuring Thinking Budget in Earendil Pi: Complete Technical Guide](/earendil-works/pi/configuring-thinking-budget-earendil-pi)

Learn to configure thinking budget in Earendil Pi. This guide details using settings.json, environment variables, and slash commands for optimal model deliberation. Fine-tune your AI's thought process effortlessly.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Export earendil pi Sessions to HTML: Complete Guide](/earendil-works/pi/how-to-export-earendil-pi-sessions-to-html)

Learn how to export earendil pi sessions to HTML using simple commands or programmatically. Generate syntax-highlighted HTML transcripts easily.

- Tags: how-to-guide
- Published: 2026-05-25

### [Efficient Code Searching with earendil pi grep and find tools](/earendil-works/pi/efficient-code-searching-earendil-pi-grep-find-tools)

Boost code searching with earendil pi grep and find. Leverage high-performance native binaries for massive repositories with intelligent truncation and strict output limits.

- Tags: how-to-guide
- Published: 2026-05-25

### [Safely Editing Files with Earendil π File Tools: Atomic Writes and Conflict Detection](/earendil-works/pi/safely-editing-files-earendil-pi-file-tools)

Safely edit files with Earendil π tools. Enjoy atomic writes, backups, and conflict detection to prevent data corruption during AI-assisted edits.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Use Prompt Templates in earendil pi: A Complete Guide](/earendil-works/pi/how-to-use-prompt-templates-earendil-pi)

Master prompt templates in earendil pi. Learn to use reusable text fragments with variable substitution via placeholders in .prompt.md files. Integrate seamlessly into CLI, TUI, and RPC modes.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Create Extensions for Earendil Pi Agents: A Complete Developer’s Guide](/earendil-works/pi/how-to-create-extensions-earendil-pi-agents)

Learn to create Earendil Pi agent extensions. Export a factory function returning an Extension interface object with metadata and commands. Load with the --extension CLI flag.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Create Custom Tools for earendil π Agents: A Complete Guide](/earendil-works/pi/how-to-create-custom-tools-earendil-pi-agents)

Learn how to create custom tools for earendil pi agents. Follow this complete guide to extend agent capabilities with TypeScript and register your tools easily.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Restore Conversation State in Earendil PI Sessions](/earendil-works/pi/how-to-restore-conversation-state-earendil-pi-sessions)

Easily restore Earendil PI sessions by resuming previous conversations. Learn how to rehydrate your full chat state with `--resume`, `/resume`, or the SDK switchSession method.

- Tags: how-to-guide
- Published: 2026-05-25

### [How earendil π Detects Bun Self-Updates: Runtime Environment and Install Method Checks](/earendil-works/pi/how-earendil-pi-detect-self-updates-for-bun)

Learn how earendil pi detects bun self-updates by checking its runtime environment and install method. Understand Bun's self-update detection process.

- Tags: how-to-guide
- Published: 2026-05-25

### [How Earendil π Detects Self-Updates for Yarn](/earendil-works/pi/how-earendil-pi-detect-self-updates-for-yarn)

Learn how Earendil π detects Yarn self-updates. Discover the script path inspection and global add command with conditional package removal for seamless updates.

- Tags: how-to-guide
- Published: 2026-05-25

### [How the Earendil π Terminal UI Achieves Differential Rendering](/earendil-works/pi/how-earendil-pi-terminal-ui-achieve-differential-rendering)

Learn how the Earendil pi terminal UI uses differential rendering to minimize flicker and I/O by diffing screen states and emitting only changed rows with optimized ANSI escape sequences.

- Tags: internals
- Published: 2026-05-25

### [How the Earendil Pi Agent Runtime Manages State: Session Trees and Append-Only Storage](/earendil-works/pi/how-earendil-pi-agent-runtime-manage-state)

Discover how the earendil pi agent runtime manages state using immutable session trees and append-only storage for deterministic branching and persistent conversation history.

- Tags: internals
- Published: 2026-05-25

### [How the Earendil Pi Agent Runtime Handles Tool Calling: Architecture and Implementation](/earendil-works/pi/how-earendil-pi-agent-runtime-handle-tool-calling)

Discover how the Earendil Pi agent runtime manages LLM tool calls by instantiating components, tracking pending operations, and correlating asynchronous results. Learn the architecture and implementation details.

- Tags: architecture
- Published: 2026-05-25

### [How to Integrate earendil π with Amazon Bedrock: Complete Implementation Guide](/earendil-works/pi/how-to-integrate-earendil-pi-with-amazon-bedrock)

Learn how to integrate earendil π with Amazon Bedrock. This guide shows how to expose Bedrock as a first class LLM provider with AWS credentials or bearer token.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Integrate Earendil PI with Google Cloud AI: A Complete Guide](/earendil-works/pi/how-to-integrate-earendil-pi-with-google-cloud-ai)

Integrate Earendil PI with Google Cloud AI. Install the package, configure credentials, and call getModel with stream or complete for seamless AI integration. Get started today.

- Tags: how-to-guide
- Published: 2026-05-25

### [How to Integrate Earendil Pi with the Anthropic API: A Complete Guide](/earendil-works/pi/how-to-integrate-earendil-pi-with-anthropic-api)

Integrate Earendil Pi with the Anthropic API. Configure credentials, select a Claude model, and use the streaming SDK or CLI with the anthropic-messages provider for seamless integration.

- Tags: how-to-guide
- Published: 2026-05-25

