npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@almegal/pi-file-browser

v1.3.1

Published

TUI file browser extension for pi

Readme

pi-file-browser

A TUI file browser extension for pi. Navigate directories, open files for editing, and switch workspace sessions — all from within pi.

demo

Install

pi install npm:@almegal/pi-file-browser

Or from this repo:

pi install git:github.com/almegal/pi-file-browser

After install, run /reload in pi.

Features

🗂 File browsing

Navigate the filesystem from within pi with vim-style keys.

| Key | Action | |-----|--------| | / j k | Move selection | | / h / Backspace | Go to parent directory | | / l | Enter selected directory | | Enter on directory | Select directory for workspace switch | | Enter on file | Open file in pi editor | | Esc / q | Close browser |

🔍 Type-to-filter search

Start typing to instantly filter the file list. Press / to enter search mode explicitly.

  • Prefix matches appear before substring matches
  • Directories always float to the top
  • In search mode, j/k/h/l are treated as search characters, not navigation — use arrow keys to move selection

| Key | Action | |-----|--------| | Printable char | Append to search query | | | Move selection within results | | | Navigate into selected directory | | Enter | Confirm selection and act on entry | | Esc / | Cancel search, restore previous position | | Backspace | Delete last char, or exit search if query is empty |

. Toggle hidden files

Press . to show or hide dotfiles and dot-directories (.env, .git, .pi, etc.). When hidden files are visible, the status bar shows a [hidden] marker. The hints bar shows .=hidden when files are hidden and A=hidden when they are visible.

🎨 Smart file-type icons

Files and directories get context-aware emoji icons instead of generic 📄/📂:

| Type | Icon | Examples | |------|------|----------| | TypeScript | 🟦 | .ts, .tsx | | JavaScript | 🟢 | .js, .jsx, .vue, .svelte | | Python | 🐍 | .py | | Ruby | 💎 | .rb | | Go | 🦋 | .go | | Rust | 🧩 | .rs | | Java | ☕ | .java | | Kotlin | 💜 | .kt | | Swift | 🦁 | .swift | | C / C++ | ⚙️ | .c, .cpp, .h | | C# | 💡 | .cs | | PHP | 🐘 | .php | | Web / Markup | 🌐 | .html, .htm | | Styles | 🎨 | .css, .scss, .less | | Config/Data | 📦 | .json, .yaml, .toml, .xml | | Data | 📊 | .csv | | Database | 🗃 | .sql | | Documentation | 📝 | .md, .mdx, .rst, .adoc | | Plain text | 📄 | .txt | | Shell | 💻 | .sh, .bash, .zsh, .fish | | Lock files | 🔒 | .lock | | Source maps | 🗺 | .map | | Images | 🖼 | .png, .jpg, .jpeg, .gif, .svg, .webp, .ico | | Audio | 🎵 | .mp3, .wav, .flac | | Video | 🎬 | .mp4, .mkv, .avi, .mov | | Archives | 🗜 | .zip, .tar, .gz, .bz2, .7z, .rar | | Fonts | 🔡 | .ttf, .otf, .woff, .woff2 | | Binaries | ⚡ | .exe, .dll, .so, .bin, .wasm | | Special files | 🔨 | Makefile, Dockerfile, Vagrantfile | | Environment | 🔑 | .env, .env.* | | Ignore files | 🚫 | .gitignore, .dockerignore | | Package config | 📦 | package.json, tsconfig.json | | License | 📜 | LICENSE, LICENSE* | | Readme | 📖 | README.md, README* | | Git | 🔀 | .git/, .github/ | | Pi config | 🔮 | .pi/ directory | | Agents config | 🤖 | .agents/ directory | | IDE | 💻 | .vscode/, .idea/ | | Tests | ✅ | test/, tests/, __tests__/ | | Source | 📂 | src/ | | Dist | 📤 | dist/ | | Build | 🔨 | build/ | | Docs | 📚 | docs/, lib/ | | Public | 🌐 | public/ | | Assets | 🎨 | assets/ | | Config | ⚙️ | config/ | | Scripts | 💻 | scripts/ | | Vendor | 💰 | vendor/ | | Bin | ⚡ | bin/ | | node_modules | 📦 | node_modules/ |

60+ extension mappings + special filename and directory detection.

🎨 Pi theme integration

The browser respects the active pi theme — no hardcoded colors:

| Element | Theme token | |---------|------------| | Directory names | accent | | Selected item | selectedBg | | Hints & dim text | dim | | Status bar | accent | | Border frame | border / borderAccent | | Loading message | muted |

Switch pi themes and the browser adapts automatically.

🔄 Directory selection & session switching

Pressing Enter on a directory shows a menu:

  • 🆕 New session — create a new pi session with that directory as cwd
  • 🔄 Resume session — switch to an existing session (shows date, name, message count, and first message preview)
  • Back — return to the browser

Config discovery: the browser detects AGENTS.md, CLAUDE.md, .pi/, .agents/ in the target directory and shows what's available.

| Key | Action | |-----|--------| | | Select option | | Enter | Confirm selected option | | Esc / | Return to browser |

✏️ File editing

Pressing Enter on a file closes the browser and opens pi's built-in editor with the file contents. On save, changes are written back. On cancel, the browser reopens at the same directory.

🧭 Navigation history

When navigating into a directory with /l and then going back with /h/Backspace, the selection is automatically restored to the directory you came from — no need to scroll back to find your place.

📏 Status bar details

The status bar shows the selected entry's type (DIR or FILE), name, and file size (e.g., 1.2KB). When hidden files are visible, a [hidden] marker appears.

📜 Scroll behavior

The entry list scrolls to keep the selected item centered in view, so you never lose context when moving through long directories.


Usage

Run /files in pi to open the browser.

Build

npm run build

Architecture

src/
├── index.ts                  # Entry point (Composition Root)
├── app/FileBrowserApp.ts     # Command registration, session logic
├── components/FileBrowserComponent.ts  # TUI rendering & input
├── handlers/NavigationInputHandler.ts   # Key → action mapping
├── interfaces/               # IFileSystemProvider, IInputHandler, IPanelModel
├── models/PanelModel.ts      # Panel state (navigation, selection, search, hidden toggle)
├── providers/FileSystemProvider.ts      # Node.js fs implementation
├── services/
│   ├── ConfigDiscovery.ts    # Detects AGENTS.md, .pi/, etc.
│   └── FileTypeIconProvider.ts  # Extension/directory → emoji icon mapping
└── types.ts                  # Domain types