{"_id":"@almegal/pi-file-browser","_rev":"6-757ed7323a29669f62ad296659f43fb2","name":"@almegal/pi-file-browser","dist-tags":{"latest":"1.3.1"},"versions":{"1.0.0":{"name":"@almegal/pi-file-browser","version":"1.0.0","keywords":["pi-package"],"_id":"@almegal/pi-file-browser@1.0.0","maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"pi":{"extensions":["./src"]},"dist":{"shasum":"06de5eb78f264b801c7747d8dc6e2e38c81ada57","tarball":"https://registry.npmjs.org/@almegal/pi-file-browser/-/pi-file-browser-1.0.0.tgz","fileCount":35,"integrity":"sha512-mGjL93o5N3yyFa85gxfBOFGr7jonKgMJK3TCHa7W9aiVFf60XjWW8K3/NjtcXIINa4dEHAPuR9nfa4c/BINNVw==","signatures":[{"sig":"MEYCIQDfBnDLA/z2/dQZvOQ/ei39bJSvXoCRAeFB1W6wG8j8VAIhAOSJe9opXEMPiVx/q2aCduT/g7lklf9/73KQMpZcClnR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65577},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"0a35204acf1c8908fe22486c5fab2148dd19c5d2","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"almegal","email":"alekseipeikhel@gmail.com"},"_npmVersion":"11.13.0","description":"TUI file browser extension for pi","directories":{},"_nodeVersion":"24.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-file-browser_1.0.0_1780958465228_0.37622834371150327","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@almegal/pi-file-browser","version":"1.1.0","keywords":["pi-package"],"_id":"@almegal/pi-file-browser@1.1.0","maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"pi":{"extensions":["./src"]},"dist":{"shasum":"592ca7c447dd010870d2b21587e3a49effd1dedf","tarball":"https://registry.npmjs.org/@almegal/pi-file-browser/-/pi-file-browser-1.1.0.tgz","fileCount":35,"integrity":"sha512-nA+WHUcHVH7jXEpKMOlwhzxvUdN+gvwS1J49+ZPlx9WmNkof7d0a+qcMZGnJHN6XJ1iYKMHZRthzGjoD9A4btQ==","signatures":[{"sig":"MEQCIDBPZ29E/MEcRABAAuVgeQlpyTwwNEVfpGRYEIoTxfN6AiACf0KeHgH6+qQSuKnCf9qh8UB9C+KuCZgaBsa++VvgkA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77718},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"28474e64ed666ed76965449afb1ff865aebbd9e1","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"almegal","email":"alekseipeikhel@gmail.com"},"_npmVersion":"11.13.0","description":"TUI file browser extension for pi","directories":{},"_nodeVersion":"24.16.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":"*"},"_npmOperationalInternal":{"tmp":"tmp/pi-file-browser_1.1.0_1780962097499_0.7887428473715963","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@almegal/pi-file-browser","version":"1.2.1","keywords":["pi-package"],"_id":"@almegal/pi-file-browser@1.2.1","maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"pi":{"extensions":["./src"]},"dist":{"shasum":"e68a661c5408ec40adb6110ddbd502c135175319","tarball":"https://registry.npmjs.org/@almegal/pi-file-browser/-/pi-file-browser-1.2.1.tgz","fileCount":35,"integrity":"sha512-j8plERGYUGwty60armsPvKo1JKKGr60sTTmiB903p1YiO2zll8UM8bDKZrl8CfMlT44VvMCnKZ98i95MvAI+7g==","signatures":[{"sig":"MEUCIAGP76VLXv23BebXA/d19u85/o1R7FBk0T+9dfC6TIyyAiEAw6hACgCJsTKWP3+ypZ9tB6PRg4vwz+oPZftCSV6cnJ4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78988},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"26a5d72e1b73ab3953cfe70c5b1ca2eb4efa3bad","scripts":{"test":"npm run build","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"almegal","email":"alekseipeikhel@gmail.com"},"_npmVersion":"10.8.2","description":"TUI file browser extension for pi","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.0","@earendil-works/pi-tui":"^0.79.0","@earendil-works/pi-coding-agent":"^0.79.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-file-browser_1.2.1_1780992009445_0.4229358109240564","host":"s3://npm-registry-packages-npm-production"}},"1.2.3":{"name":"@almegal/pi-file-browser","version":"1.2.3","keywords":["pi-package"],"_id":"@almegal/pi-file-browser@1.2.3","maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"pi":{"extensions":["./src"]},"dist":{"shasum":"391f624114d22715a12d626d9c26bfd1b379766e","tarball":"https://registry.npmjs.org/@almegal/pi-file-browser/-/pi-file-browser-1.2.3.tgz","fileCount":35,"integrity":"sha512-gSZMi4tI8sb8mbNowquGbY5o5USEaPgsyi6MTDK5c7Kv3fdZAykyF4vQlLrQenJo8O2Y4LeVGY1JuutGAOKYEw==","signatures":[{"sig":"MEUCIQCvg8CkIVEZ3JyuvY3H928XEppjQtb2E3AnE4UBT1NlZgIgAluT9OsF8ivHdEEMjPUsw+kMWlLbQHerhucQEifGyVI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80983},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"ea70212e37bd6f4abac9d338a6302a93ce0e9d88","scripts":{"test":"npm run build","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"almegal","email":"alekseipeikhel@gmail.com"},"_npmVersion":"10.8.2","description":"TUI file browser extension for pi","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.0","@earendil-works/pi-tui":"^0.79.0","@earendil-works/pi-coding-agent":"^0.79.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-file-browser_1.2.3_1780993753948_0.3084452712453398","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@almegal/pi-file-browser","version":"1.3.0","keywords":["pi-package"],"_id":"@almegal/pi-file-browser@1.3.0","maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"pi":{"extensions":["./src"]},"dist":{"shasum":"3cc5d776bf275176e520a65e81f94efa4fe5d29b","tarball":"https://registry.npmjs.org/@almegal/pi-file-browser/-/pi-file-browser-1.3.0.tgz","fileCount":38,"integrity":"sha512-eX11opKyfnzmEcgpP+CgBZNiKHq6ba+iUD2yP+buRJwaSjTiO2BuI4nlrzzyxk0SB57Zj9JsuJkRARDuMLsU9g==","signatures":[{"sig":"MEYCIQCQVd3QeDVqDhtfmzRdZTRQ68DoWCjtSMX4qApn2DbJ3AIhAPkeBuo3VkzHEkqkPSrvGaY7iVF6TBjUsRlW1Hx/VFI6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92417},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"1b907f6f218a17a7eacab741145dbc76e1444afb","scripts":{"test":"npm run build","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"almegal","email":"alekseipeikhel@gmail.com"},"_npmVersion":"10.8.2","description":"TUI file browser extension for pi","directories":{},"_nodeVersion":"20.20.2","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.5","@types/node":"^20.14.0","@earendil-works/pi-tui":"^0.79.0","@earendil-works/pi-coding-agent":"^0.79.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-file-browser_1.3.0_1780996377728_0.9278733462379196","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@almegal/pi-file-browser","version":"1.3.1","description":"TUI file browser extension for pi","main":"dist/index.js","keywords":["pi-package"],"scripts":{"build":"tsc","test":"npm run build","prepublishOnly":"npm run build"},"pi":{"extensions":["./src"]},"dependencies":{},"devDependencies":{"@earendil-works/pi-coding-agent":"^0.79.0","@earendil-works/pi-tui":"^0.79.0","@types/node":"^20.14.0","typescript":"^5.4.5"},"_id":"@almegal/pi-file-browser@1.3.1","gitHead":"e1352e30fbfdb12a6a6a9630848130759570e974","types":"./dist/index.d.ts","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ihAmndAxoNzfQFcgzzKh8enBlAFxELtQ8u9u1hgqwKRkBZqXPXH7XkAgsnb6h6POmHxxOlhTmbRZYMowCal0Cw==","shasum":"5a13143ce8b88f9f871d19c705c02b98c871203e","tarball":"https://registry.npmjs.org/@almegal/pi-file-browser/-/pi-file-browser-1.3.1.tgz","fileCount":38,"unpackedSize":97191,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAbZdUBf9l4yKHdf9GWk9ijMDwQD9nTSilTv+wDp9PqqAiEAh1aPDqqlf6gJErCNuhxRLJWRyqT4zuC2eEvfWXXhoes="}]},"_npmUser":{"name":"almegal","email":"alekseipeikhel@gmail.com"},"directories":{},"maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-file-browser_1.3.1_1781024194149_0.8673876472241926"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-08T22:41:05.035Z","modified":"2026-06-09T16:56:34.367Z","1.0.0":"2026-06-08T22:41:05.366Z","1.1.0":"2026-06-08T23:41:37.647Z","1.2.1":"2026-06-09T08:00:09.567Z","1.2.3":"2026-06-09T08:29:14.097Z","1.3.0":"2026-06-09T09:12:57.880Z","1.3.1":"2026-06-09T16:56:34.279Z"},"keywords":["pi-package"],"description":"TUI file browser extension for pi","maintainers":[{"name":"almegal","email":"alekseipeikhel@gmail.com"}],"readme":"# pi-file-browser\n\nA TUI file browser extension for [pi](https://github.com/earendil-works/pi). Navigate directories, open files for editing, and switch workspace sessions — all from within pi.\n\n![demo](https://github.com/user-attachments/assets/9a1d1c2f-2774-4e97-b38d-c8d9d2135b0d)\n\n## Install\n\n```\npi install npm:@almegal/pi-file-browser\n```\n\nOr from this repo:\n\n```sh\npi install git:github.com/almegal/pi-file-browser\n```\n\nAfter install, run `/reload` in pi.\n\n## Features\n\n### 🗂 File browsing\n\nNavigate the filesystem from within pi with vim-style keys.\n\n| Key | Action |\n|-----|--------|\n| `↑` `↓` / `j` `k` | Move selection |\n| `←` / `h` / `Backspace` | Go to parent directory |\n| `→` / `l` | Enter selected directory |\n| `Enter` on directory | Select directory for workspace switch |\n| `Enter` on file | Open file in pi editor |\n| `Esc` / `q` | Close browser |\n\n### 🔍 Type-to-filter search\n\nStart typing to instantly filter the file list. Press `/` to enter search mode explicitly.\n\n- Prefix matches appear before substring matches\n- Directories always float to the top\n- In search mode, `j`/`k`/`h`/`l` are treated as search characters, not navigation — use arrow keys to move selection\n\n| Key | Action |\n|-----|--------|\n| Printable char | Append to search query |\n| `↑` `↓` | Move selection within results |\n| `→` | Navigate into selected directory |\n| `Enter` | Confirm selection and act on entry |\n| `Esc` / `←` | Cancel search, restore previous position |\n| `Backspace` | Delete last char, or exit search if query is empty |\n\n### . Toggle hidden files\n\nPress `.` to show or hide dotfiles and dot-directories (`.env`, `.git`, `.pi`, etc.).\nWhen 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.\n\n### 🎨 Smart file-type icons\n\nFiles and directories get context-aware emoji icons instead of generic 📄/📂:\n\n| Type | Icon | Examples |\n|------|------|----------|\n| TypeScript | 🟦 | `.ts`, `.tsx` |\n| JavaScript | 🟢 | `.js`, `.jsx`, `.vue`, `.svelte` |\n| Python | 🐍 | `.py` |\n| Ruby | 💎 | `.rb` |\n| Go | 🦋 | `.go` |\n| Rust | 🧩 | `.rs` |\n| Java | ☕ | `.java` |\n| Kotlin | 💜 | `.kt` |\n| Swift | 🦁 | `.swift` |\n| C / C++ | ⚙️ | `.c`, `.cpp`, `.h` |\n| C# | 💡 | `.cs` |\n| PHP | 🐘 | `.php` |\n| Web / Markup | 🌐 | `.html`, `.htm` |\n| Styles | 🎨 | `.css`, `.scss`, `.less` |\n| Config/Data | 📦 | `.json`, `.yaml`, `.toml`, `.xml` |\n| Data | 📊 | `.csv` |\n| Database | 🗃 | `.sql` |\n| Documentation | 📝 | `.md`, `.mdx`, `.rst`, `.adoc` |\n| Plain text | 📄 | `.txt` |\n| Shell | 💻 | `.sh`, `.bash`, `.zsh`, `.fish` |\n| Lock files | 🔒 | `.lock` |\n| Source maps | 🗺 | `.map` |\n| Images | 🖼 | `.png`, `.jpg`, `.jpeg`, `.gif`, `.svg`, `.webp`, `.ico` |\n| Audio | 🎵 | `.mp3`, `.wav`, `.flac` |\n| Video | 🎬 | `.mp4`, `.mkv`, `.avi`, `.mov` |\n| Archives | 🗜 | `.zip`, `.tar`, `.gz`, `.bz2`, `.7z`, `.rar` |\n| Fonts | 🔡 | `.ttf`, `.otf`, `.woff`, `.woff2` |\n| Binaries | ⚡ | `.exe`, `.dll`, `.so`, `.bin`, `.wasm` |\n| Special files | 🔨 | `Makefile`, `Dockerfile`, `Vagrantfile` |\n| Environment | 🔑 | `.env`, `.env.*` |\n| Ignore files | 🚫 | `.gitignore`, `.dockerignore` |\n| Package config | 📦 | `package.json`, `tsconfig.json` |\n| License | 📜 | `LICENSE`, `LICENSE*` |\n| Readme | 📖 | `README.md`, `README*` |\n| Git | 🔀 | `.git/`, `.github/` |\n| Pi config | 🔮 | `.pi/` directory |\n| Agents config | 🤖 | `.agents/` directory |\n| IDE | 💻 | `.vscode/`, `.idea/` |\n| Tests | ✅ | `test/`, `tests/`, `__tests__/` |\n| Source | 📂 | `src/` |\n| Dist | 📤 | `dist/` |\n| Build | 🔨 | `build/` |\n| Docs | 📚 | `docs/`, `lib/` |\n| Public | 🌐 | `public/` |\n| Assets | 🎨 | `assets/` |\n| Config | ⚙️ | `config/` |\n| Scripts | 💻 | `scripts/` |\n| Vendor | 💰 | `vendor/` |\n| Bin | ⚡ | `bin/` |\n| node_modules | 📦 | `node_modules/` |\n\n60+ extension mappings + special filename and directory detection.\n\n### 🎨 Pi theme integration\n\nThe browser respects the active pi theme — no hardcoded colors:\n\n| Element | Theme token |\n|---------|------------|\n| Directory names | `accent` |\n| Selected item | `selectedBg` |\n| Hints & dim text | `dim` |\n| Status bar | `accent` |\n| Border frame | `border` / `borderAccent` |\n| Loading message | `muted` |\n\nSwitch pi themes and the browser adapts automatically.\n\n### 🔄 Directory selection & session switching\n\nPressing `Enter` on a directory shows a menu:\n\n- 🆕 **New session** — create a new pi session with that directory as cwd\n- 🔄 **Resume session** — switch to an existing session (shows date, name, message count, and first message preview)\n- ↩ **Back** — return to the browser\n\nConfig discovery: the browser detects `AGENTS.md`, `CLAUDE.md`, `.pi/`, `.agents/` in the target directory and shows what's available.\n\n| Key | Action |\n|-----|--------|\n| `↑` `↓` | Select option |\n| `Enter` | Confirm selected option |\n| `Esc` / `←` | Return to browser |\n\n### ✏️ File editing\n\nPressing `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.\n\n### 🧭 Navigation history\n\nWhen 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.\n\n### 📏 Status bar details\n\nThe 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.\n\n### 📜 Scroll behavior\n\nThe entry list scrolls to keep the selected item centered in view, so you never lose context when moving through long directories.\n\n---\n\n## Usage\n\nRun `/files` in pi to open the browser.\n\n## Build\n\n```sh\nnpm run build\n```\n\n## Architecture\n\n```\nsrc/\n├── index.ts                  # Entry point (Composition Root)\n├── app/FileBrowserApp.ts     # Command registration, session logic\n├── components/FileBrowserComponent.ts  # TUI rendering & input\n├── handlers/NavigationInputHandler.ts   # Key → action mapping\n├── interfaces/               # IFileSystemProvider, IInputHandler, IPanelModel\n├── models/PanelModel.ts      # Panel state (navigation, selection, search, hidden toggle)\n├── providers/FileSystemProvider.ts      # Node.js fs implementation\n├── services/\n│   ├── ConfigDiscovery.ts    # Detects AGENTS.md, .pi/, etc.\n│   └── FileTypeIconProvider.ts  # Extension/directory → emoji icon mapping\n└── types.ts                  # Domain types\n```","readmeFilename":"README.md"}