Skip to content

omerxx/pi-head

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-head

pi-head is a small Pi package that adds /head: a keyboard-scrollable viewer for the latest assistant response, opened from its first line.

Use it when an assistant response is long and you want to jump back to the beginning without entering tmux copy/history mode.

Features

  • Adds the /head slash command.
  • Finds the latest assistant text response on the active session branch.
  • Opens that response in a full-screen Pi TUI viewer starting at line 1.
  • Supports keyboard scrolling, paging, top/bottom jumps, and quick close.
  • Installs as a normal Pi package from GitHub.

Install

Install directly from GitHub:

pi install git:github.com/omerxx/pi-head

Or install with the HTTPS URL:

pi install https://github.com/omerxx/pi-head

Reload Pi after installing:

/reload

Usage

Inside Pi, run:

/head

The viewer opens on the latest assistant text response, starting at the first line.

Keyboard controls

Key Action
j, Scroll down one line
k, Scroll up one line
space, f, PageDown Page down
b, PageUp Page up
g Jump to top
G Jump to bottom
q, Esc Close

Update

Update installed Pi packages:

pi update --extensions

Or update only this package:

pi update git:github.com/omerxx/pi-head

Then reload Pi:

/reload

Uninstall

pi remove git:github.com/omerxx/pi-head

Then reload Pi:

/reload

Local development

Clone the repo:

git clone https://github.com/omerxx/pi-head.git
cd pi-head

Install from a local checkout while testing:

pi install /absolute/path/to/pi-head

Or load for a single run without installing:

pi -e /absolute/path/to/pi-head

Package dry run:

npm pack --dry-run

Package layout

pi-head/
  package.json
  extensions/
    head.ts

package.json declares the Pi extension manifest:

{
  "pi": {
    "extensions": ["./extensions"]
  }
}

Notes

If you previously copied head.ts into ~/.pi/agent/extensions/, remove that standalone file after installing this package to avoid duplicate /head command registrations.

License

MIT

About

A small extension that sets you at the top of the last response with a few keymaps to move around

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors