@liushihao456/pi-emacs

Pi extension that allows switching to emacs seamlessly in a popup terminal.

Packages

Package details

extension

Install @liushihao456/pi-emacs from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@liushihao456/pi-emacs
Package
@liushihao456/pi-emacs
Version
0.1.3
Published
Jun 13, 2026
Downloads
533/mo · 533/wk
Author
liushihao456
License
MIT
Types
extension
Size
30.4 KB
Dependencies
2 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-emacs

Pi extension for opening emacsclient from Pi's TUI.

Features

  • Starts an Emacs daemon automatically when Pi starts.
  • Adds /emacs command.
  • Adds /emacs:find-file command with a file explorer for opening files or directories.
  • Adds /emacs:project-find-file command with a fuzzy picker over non-ignored project files from ripgrep.
  • Adds ctrl+g shortcut to open emacsclient -nw in the terminal.
  • Remembers the last file touched by Pi edit / write tools and opens it on next launch.
  • Falls back to dired in the current working directory when no recent file exists.
  • Enables terminal mouse support inside Emacs.
  • Stops the daemon on Pi quit only if this extension started it.

Install

pi install npm:@liushihao456/pi-emacs

For local development:

pi install /path/to/pi-emacs
# or copy this directory to ~/.pi/agent/extensions/pi-emacs

Requirements

  • Emacs available as emacs
  • Emacs client available as emacsclient
  • Pi interactive TUI mode
  • @vscode/ripgrep installed with this package for /emacs:project-find-file

Usage

  • /emacs — open Emacs client
  • /emacs:find-file — choose a file or directory and open it in Emacs
  • /emacs:project-find-file — fuzzy-find a non-ignored project file and open it in Emacs
  • ctrl+g — open Emacs client

Pi extension shortcuts currently support single key events, so Emacs-style multi-key chords such as C-x C-f and C-c p f are documented here as commands instead of registered as shortcuts.

Publish

npm publish --access public