Show HN:Pi-coding-agent - AI 輔助編碼的 Emacs 前端

Show HN:Pi-coding-agent - AI 輔助編碼的 Emacs 前端

Hacker News·

這篇 Hacker News 的「Show HN」文章介紹了 pi-coding-agent,這是一個 Emacs 前端,旨在將 AI 輔助功能直接整合到編碼工作流程中,讓使用者能在 Emacs 環境中與 AI 編碼代理進行互動。

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

To see all available qualifiers, see our documentation.

Emacs frontend for the pi coding agent

License

Uh oh!

There was an error while loading. Please reload this page.

dnouri/pi-coding-agent

Folders and files

Latest commit

History

Repository files navigation

pi-coding-agent

Image

Image

Image

Image

Image

An Emacs frontend for the pi coding agent.

Image

Features

Requirements

Installing pi coding agent

Installation

MELPA

Once available on MELPA, you can install directly:

Or with use-package:

If you don’t have MELPA configured, add this to your init file:

Manual installation

Clone the repository and add to your load path:

Or with use-package:

Usage

Start a session with M-x pi. This opens two windows:

Type your prompt and press C-c C-c to send. Press C-c C-p for the full command menu.

For multiple sessions in the same directory, use C-u M-x pi to create a named session.

Key Bindings

Press C-c C-p to access the full menu with model selection, thinking level,
session management (new, resume, branch, export), statistics, and custom commands.

Tips & Tricks

✏️ Composing Prompts

The input buffer is a full Emacs buffer, one of the main advantages over
terminal interfaces. Take your time composing, write multi-line prompts,
paste from other buffers, use registers or kill-ring history. Your prompt
stays put while the AI responds above.

Slash commands (/command) work with completion: type / then TAB to
see available commands, including your custom ones from ~/.pi/commands/.

🔧 Tool Output

Tool output is collapsed by default to keep the chat readable, with a
preview of the first few lines visible. Press TAB on a tool block to
expand and see everything. File operations (read, write, edit) show full
syntax highlighting, and edit diffs highlight what changed. Long-running
commands stream output live so you can watch progress.

📁 Folding Turns

Press TAB on a turn header (You/Assistant) to fold it, TAB again to
unfold. Use S-TAB to cycle visibility of all turns at once.

💾 Sessions

Each project directory gets its own session automatically. To run multiple
sessions in the same directory, use C-u M-x pi to create a named session.

Resume (C-c C-r) and branch (C-c C-p b) present a selection menu:
pick from previous sessions or conversation messages to start from.

🌿 Branching and Context Management

When a conversation gets long, the AI’s context window fills up. The menu
(C-c C-p) offers tools to manage this:

The context indicator in the status area shows current usage, warning
when getting full.

Configuration

Example configuration with use-package:

Testing

Running tests locally

Requires Docker for integration and GUI tests (Ollama runs in a container).

GUI tests with visible window

By default, GUI tests auto-detect whether to show a window or run headless.

CI setup

GitHub Actions runs on every push:

Nightly builds test against multiple pi versions (0.30.2, latest, and main branch).

Links

License

GPL-3.0-or-later. See LICENSE.

About

Emacs frontend for the pi coding agent

Resources

License

Uh oh!

There was an error while loading. Please reload this page.

Stars

Watchers

Forks

Releases

  1

Packages

  0

Contributors

  2

Uh oh!

There was an error while loading. Please reload this page.

Languages

Footer

Footer navigation

Hacker News

相關文章

其他收藏 · 0