pi-autocomplete-above0.1.0
Pi extension that shows the native autocomplete menu above the prompt as an overlay
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
Pi Autocomplete Above
A Pi extension that shows Pi's existing autocomplete menu above the prompt, as an overlay over the transcript, instead of below the prompt. It is the only behavior it changes: suggestions, order, filtering, descriptions, the configured number of visible items, keybindings, and mouse behavior stay Pi's own.
The prompt and the transcript do not move when the menu opens, updates, scrolls, or closes. When the menu closes, the transcript lines it covered are shown again.
Status
- Verified only against Pi 1.6.0, in both TUI modes: fullscreen (the default) and
--tui-mode regular. Other Pi versions are not claimed to work. - Requires Node.js 22.19.0 or newer, which is Pi 1.6.0's own requirement.
- No runtime dependencies and no third-party editor package.
@earendil-works/pi-coding-agentand@earendil-works/pi-tuiare declared as peer dependencies because Pi supplies them to extensions.
Install
pi install npm:pi-autocomplete-above
For local development, point Pi at the package directory. Pi reads the pi.extensions entry from package.json and loads local packages from their path without copying them. A packed archive can be extracted and installed the same way.
pi install /absolute/path/to/pi-autocomplete-above
To try it for one run without changing settings:
pi -e /absolute/path/to/pi-autocomplete-above
Add -l to pi install to write the package into the project's .pi/settings.json instead of your user settings. pi list shows installed packages. Start Pi or run /reload after installing.
Remove
pi remove /absolute/path/to/pi-autocomplete-above
Use the same source you installed, or pi remove npm:pi-autocomplete-above for an npm install, and add -l for a project-scoped install. Restart Pi or run /reload to return to the default editor.
What changes on screen
- The menu is drawn in the rows directly above the prompt, covering transcript lines. It takes no layout space, so neither the prompt nor the transcript shifts.
- The menu height is limited to the rows available above the prompt. In a short terminal or against a long transcript, fewer items are visible than your configured
autocompleteMaxVisible.- With room for one row only, the selected item is shown and the native scroll indicator is dropped.
- With no room, the menu is not drawn at all. The prompt keeps working and the layout still does not move.
- Where there is room, the native visible-item preference applies unchanged, along with native selection, scrolling, acceptance, dismissal, mouse interaction where Pi supports it, theme, and editor appearance.
Native fallback
The extension never replaces an editor that another extension already installed. If you use an editor extension such as Zentui, that editor stays in place and Pi's unmodified autocomplete continues below the prompt. Zentui 0.34.0 was checked only as a compatibility sample: above-prompt placement is not supported for it, and it is not a dependency of this package.
The same fallback applies when the running Pi version does not expose the renderer information the overlay needs: Pi's native editor and menu are left untouched instead of a broken menu being drawn. Non-interactive modes (--print, --mode json, --mode rpc) are not modified.
Host API assumptions and risks
The editor slot (setEditorComponent with CustomEditor) and the overlay (ctx.ui.custom with overlay options) are documented extension APIs. Placing the overlay exactly above the prompt and fitting the native list into the space there also reads host internals that Pi does not document as public API:
- editor internals: the native autocomplete list state and the rendered autocomplete height;
- renderer internals: the previous frame's child lines in regular mode and the layout frame in fullscreen mode.
A Pi update can change any of these. After a Pi upgrade, expect breakage or a silent native fallback until the extension has been re-verified. Only Pi 1.6.0 is verified.
Development
npm ci
npm test
npm run typecheck
npm pack --dry-run --json
npm test drives the extension through Pi's real extension loader, editor, and TUI renderer, and also packs the repository and exercises the unpacked archive. Use Node.js 22.19.0 or newer; older Node versions report EBADENGINE for Pi's own dependencies during npm ci.
License
MIT. Copyright (c) 2026 mollehxh.