pi-boundary-boost

Rank direct directory children first in pi's @ file completion — @dir/prefix reads the directory directly and merges fd fuzzy results after, so deep matches never crowd out the obvious hit

Packages

Package details

extension

Install pi-boundary-boost from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-boundary-boost
Package
pi-boundary-boost
Version
0.1.1
Published
Aug 26, 2026
Downloads
340/mo · 10/wk
Author
cyzlmh
License
MIT
Types
extension
Size
9.3 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

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

README

pi-boundary-boost

Rank direct directory children first in pi's @ file completion.

The problem

pi's built-in @ completion always routes to fd fuzzy search with --max-results 100. When you type a scoped query like @~/projects/pro, the result set floods with deep nested matches (venv/.../site-packages/profile/…), and the direct child you obviously meant can be cut by the 100-result cap before scoring even runs.

The fix

Any @<dir>/<prefix> query reads <dir> directly via readdir and ranks its direct children matching prefix first, then merges the built-in fd fuzzy results (deduplicated) after them — so deep fuzzy search still works, but the obvious hit always appears.

  • @~/work/ → direct children of ~/work/ first, fd matches after
  • @src/compsrc/components/ ranks above packages/foo/src/components/…
  • At the home root (@~/<prefix>), known noise dirs (.cache, .npm, .nvm, …) are filtered unless they themselves match the prefix
  • Bare fuzzy queries without a / (@foo) and non-@ queries pass through to the built-in provider unchanged

Install

pi install npm:pi-boundary-boost

Zero configuration, zero dependencies. Works on top of the built-in completion provider (registered via addAutocompleteProvider), so it composes with pi's default behavior instead of replacing it.

Compatibility

Tested with pi 0.84.x. The extension wraps pi's autocomplete provider interface (@earendil-works/pi-tui), which is not yet a frozen API — if a future pi version changes completion internals, please open an issue.

License

MIT — © cyzlmh. See LICENSE.