57K‑Star AI Agent Toolkit: Terminal Coding Assistant and Unified LLM API

The open‑source Pi Agent Harness, starring over 57 K GitHub stars, provides a terminal‑based AI coding assistant, a unified Node.js LLM API covering 20+ providers, and an extensible plug‑in system for skills, themes, and custom agents.

Geek Labs
Geek Labs
Geek Labs
57K‑Star AI Agent Toolkit: Terminal Coding Assistant and Unified LLM API

Installation

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

Set the appropriate API key, then launch the interactive interface with pi. OAuth login is supported, and users with Anthropic Claude Pro/Max, OpenAI ChatGPT Plus/Pro (Codex), or GitHub Copilot can authenticate via their subscription. export ANTHROPIC_API_KEY=sk-ant-... pi Press Enter, describe the desired task, and Pi analyzes, generates code, modifies files, and executes commands.

Supported Models

Pi integrates more than 20 model providers. Subscription‑based login works for Anthropic Claude Pro/Max, OpenAI ChatGPT Plus/Pro (Codex), and GitHub Copilot. API‑key access includes Anthropic, OpenAI, DeepSeek, Google Gemini, Mistral, Groq, Cerebras, xAI, OpenRouter, Together AI, Hugging Face, Fireworks, Kimi for Coding, Xiaomi MiMo, and others. Custom OpenAI‑compatible endpoints such as Ollama, vLLM, and LM Studio can also be added.

Cross‑model switching is possible within a single conversation: context can be serialized to JSON and passed from one model to another (e.g., using DeepSeek for analysis then Claude for code generation).

Coding Assistant CLI

The core of Pi is an AI‑driven coding assistant that runs in the terminal. By default it equips the model with four tools: read, write, edit, and bash. Users issue commands in the terminal, and Pi performs the actions using these tools.

Interaction mode displays an editor‑style UI with a top hint bar, conversation history, input line, and a status bar showing the current directory, session name, token usage, and cost.

The editor supports fuzzy file search with @, path tab‑completion, Shift+Enter for new lines, Ctrl+V for image paste, and !command to run a bash command and feed the result back to the AI.

pi interaction mode screenshot
pi interaction mode screenshot

Session Management

Sessions are stored as a tree of JSONL files. Each conversation node can be branched without overwriting previous content.

The /tree command opens a tree navigator that allows searching, collapsing, tagging, and jumping to any historic node—similar to Git branches but for dialogue.

pi conversation tree navigation
pi conversation tree navigation

Additional commands include /fork to create a new session from a historic message and /compact to manually compress context when a session becomes too long, retaining only the most recent key information.

Message Queue

While the AI is processing, users can continue typing. Pressing Enter queues a message to be sent after the current tool call finishes; Alt+Enter queues a message to be sent after the entire AI turn completes, eliminating the need to wait.

Unified LLM API ( @earendil-works/pi-ai )

Unified streaming and completion : identical call pattern for OpenAI, Anthropic, DeepSeek, etc.

Function calling : parameters defined with TypeBox and validated at runtime.

Thinking/reasoning support : normalizes chain‑of‑thought handling across models.

Token and cost tracking : records input/output tokens and monetary cost per call, accurate to the cent.

Context serialization : entire conversation can be serialized to JSON for hand‑off to another model.

Multimodal input and image generation : supports image data as input and generation.

Built‑in OAuth flows : Google, GitHub, OpenAI and others.

The design principle is “write once, run everywhere,” abstracting away provider‑specific differences.

Extension Mechanisms

Pi offers four extension avenues, allowing users to plug in custom functionality without modifying the core:

Extensions : TypeScript modules that can register custom tools, commands, shortcuts, event handlers, and UI components. Examples include sub‑agents, planning modes, permission controls, Git auto‑commit, SSH remote execution, and a Doom mini‑game.

Skills : Markdown files following the Agent Skills standard, defining when the AI should invoke a particular skill.

Prompt Templates : Reusable Markdown snippets that expand with /template-name.

Themes : Hot‑reloaded UI themes that take effect instantly after file changes.

Extensions can be packaged into an npm package and shared, e.g.:

pi install npm:@foo/pi-tools
pi Doom extension
pi Doom extension

Target Audience

Developers who want a terminal‑based AI coding assistant without switching between browsers and IDEs.

Teams that need a shared context file to enforce consistent behavior across members.

LLM application developers who want a single library to hide the differences among 20+ model APIs.

AI tool authors who wish to build custom agents on top of Pi’s extension system instead of starting from scratch.

It is not suitable for occasional AI queries that are easier in a web UI, or for users unfamiliar with terminal operations.

GitHub: https://github.com/earendil-works/pi Stars: 57K+ Language: TypeScript License: MIT
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

CLITypeScriptLLMopen-sourceExtensionAI Agent
Geek Labs
Written by

Geek Labs

Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.