{"_id":"@arnavpadwal/pi-universal-sessions","name":"@arnavpadwal/pi-universal-sessions","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@arnavpadwal/pi-universal-sessions","version":"1.0.0","description":"Universal session switch for pi — browse, switch, delete, and rename sessions from ANY project","keywords":["pi-package","pi-extension","sessions","session-switch","productivity"],"license":"MIT","pi":{"extensions":["./extensions/pi-universal-sessions.ts"]},"_id":"@arnavpadwal/pi-universal-sessions@1.0.0","_nodeVersion":"26.1.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-V5OFthemWO7ivKgcHbDNUEYIeWN3otJXyrVkuRo9UaoNBLyodjsohA0pL+i/SBqRawBqAxxneYIbN80GfWphGw==","shasum":"9673828f7ab1f53221ea87e1bab7830bc643603d","tarball":"https://registry.npmjs.org/@arnavpadwal/pi-universal-sessions/-/pi-universal-sessions-1.0.0.tgz","fileCount":3,"unpackedSize":12350,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE0xlSUOlbaq7vMqlgNv7giuJkZ0HgLY3KywCp8TyfbKAiEAyzZUT5Sf3iySHjqJWnE1h8U8ft2RTAHHOj1rXQ8DnNQ="}]},"_npmUser":{"name":"arnavpadwal","email":"arnav.padwal7+npm@gmail.com"},"directories":{},"maintainers":[{"name":"arnavpadwal","email":"arnav.padwal7+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-universal-sessions_1.0.0_1778595857416_0.41291315195670686"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-12T14:24:17.320Z","1.0.0":"2026-05-12T14:24:17.557Z","modified":"2026-05-12T14:24:17.775Z"},"maintainers":[{"name":"arnavpadwal","email":"arnav.padwal7+npm@gmail.com"}],"description":"Universal session switch for pi — browse, switch, delete, and rename sessions from ANY project","keywords":["pi-package","pi-extension","sessions","session-switch","productivity"],"license":"MIT","readme":"# pi-universal-sessions\n\nUniversal session switch for [pi](https://pi.dev) — like opencode's `session_list` (`<leader>l`).\n\nBrowse, switch, delete, and rename sessions from **all your projects** in one place.\n\n## Installation\n\n```bash\npi install npm:@arnavpadwal/pi-universal-sessions\n# or from source:\npi install /path/to/pi-universal-sessions\n```\n\nOr just copy `extensions/pi-universal-sessions.ts` to `~/.pi/agent/extensions/`.\n\n## Usage\n\n| Command | Description |\n|---------|-------------|\n| `/sessions` | Open the universal session browser |\n\n### Features\n\n- **List all sessions** — Scans all projects under `~/.pi/agent/sessions/` via `SessionManager.listAll()`\n- **Smart grouping** — Current-project sessions shown first, others grouped by directory, sorted by most recent\n- **Switch session** — Pick one to switch; queues a `cd <dir>` so the agent's bash shell lands in the right project directory\n- **Delete sessions** — Select \"🗑  Delete a session\" → pick one → confirm with details → permanently removed\n- **Rename sessions** — Select \"✏️  Rename a session\" → pick one → input a new display name\n\n### Workflow\n\n```\n/sessions\n  → See all sessions from all projects\n  → Pick a session to switch to it\n  → Or pick \"Delete/ Rename\" actions at the top\n  → After delete/rename, the list refreshes automatically\n```\n\n## How it works\n\nThe extension uses `SessionManager.listAll()` (a built-in pi API) to discover every session file across all project directories. It groups them by `cwd` and shows them sorted by most recently modified.\n\n- Switch: `ctx.switchSession()` + `replacedCtx.sendUserMessage(\"cd ...\")`\n- Delete: `fs.unlink()` on the session `.jsonl` file\n- Rename: appends a `session_info` entry to the JSONL file\n\n## Note on directory switching\n\nPi's extension API doesn't expose a `chdir()` — `ctx.cwd` is read-only. When you switch to a session from another project, the extension queues a `cd <dir>` instruction in the agent's bash session so tool executions work in the right directory. You may need to `cd` manually in your terminal for a fully clean state.\n\n## Publishing\n\n```bash\ncd pi-universal-sessions\nnpm publish --access public\n# or push to GitHub and install via:\npi install git:github.com/arnavpadwal/pi-universal-sessions\n```\n","readmeFilename":"README.md","_rev":"1-c48075649c475e929ff93ec30102ec6d"}