{"id":49251111,"url":"https://github.com/fitchmultz/pi-edit-session-in-place","last_synced_at":"2026-05-01T22:02:07.115Z","repository":{"id":351449970,"uuid":"1203867348","full_name":"fitchmultz/pi-edit-session-in-place","owner":"fitchmultz","description":"pi extension that lets you re-edit or delete an earlier user message in the current session branch","archived":false,"fork":false,"pushed_at":"2026-04-24T02:38:28.000Z","size":267,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-25T00:36:30.030Z","etag":null,"topics":["extension","history","pi","pi-extension","pi-package","session","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/fitchmultz/pi-edit-session-in-place#readme","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fitchmultz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-07T13:11:11.000Z","updated_at":"2026-04-24T02:38:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fitchmultz/pi-edit-session-in-place","commit_stats":null,"previous_names":["fitchmultz/pi-edit-session-in-place"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/fitchmultz/pi-edit-session-in-place","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitchmultz%2Fpi-edit-session-in-place","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitchmultz%2Fpi-edit-session-in-place/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitchmultz%2Fpi-edit-session-in-place/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitchmultz%2Fpi-edit-session-in-place/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fitchmultz","download_url":"https://codeload.github.com/fitchmultz/pi-edit-session-in-place/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fitchmultz%2Fpi-edit-session-in-place/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32514340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["extension","history","pi","pi-extension","pi-package","session","typescript"],"created_at":"2026-04-25T00:05:18.298Z","updated_at":"2026-05-01T22:02:07.110Z","avatar_url":"https://github.com/fitchmultz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi edit-session-in-place\n\nA [pi](https://github.com/badlogic/pi-mono) extension that lets you rewind to an earlier user message in the current branch, then either **edit it in place** or **delete it and continue from there**.\n\n## Compatibility\n\nTested with:\n\n- `@mariozechner/pi-coding-agent` `0.71.1`\n- `@mariozechner/pi-tui` `0.71.1`\n- Node.js `\u003e=20.6.0`\n\nLocal development and verification in this repo target pi `0.71.1`. `@mariozechner/pi-coding-agent` stays in `devDependencies` for local typechecking and tests, while the extension relies on pi's bundled runtime packages at execution time.\n\n## What it does\n\n- Adds `/edit-turn`\n- Adds a global hotkey: `Ctrl+Shift+E`\n- Lets you choose an earlier user message from the current branch\n- Rewinds pi to that point in the same session file\n- Loads your edited text back into the main editor\n- Treats an empty submit as **delete this message and continue from here**\n\n## Install\n\nInstall from npm with pi:\n\n```bash\npi install npm:pi-edit-session-in-place\n```\n\nOr install directly from GitHub with pi:\n\n```bash\npi install https://github.com/fitchmultz/pi-edit-session-in-place\n```\n\nThen reload pi from inside the app with:\n\n```text\n/reload\n```\n\n## Usage\n\nInside pi:\n\n```text\n/edit-turn\n```\n\nOr press:\n\n```text\nCtrl+Shift+E\n```\n\n### Message picker behavior\n\n- Shows earlier user messages from the current branch only\n- Uses a viewport so long threads stay navigable\n- Orders messages **oldest → newest**\n- Starts with the **newest** message selected at the bottom\n- `↑` moves to older messages, `↓` moves to newer ones\n- `PageUp` / `PageDown` jump faster\n\n### Editor behavior\n\n- `Ctrl+X` clears the entire selected message instantly\n- `Enter` submits the edited message\n- `Shift+Enter` inserts a newline\n- `Escape` cancels without changing history\n- `Ctrl+G` opens your external editor if `$VISUAL` or `$EDITOR` is set\n\nIf you clear the message and submit an empty value, the selected message is effectively deleted: pi rewinds to just before that message and leaves the main editor empty so you can type a new prompt.\n\n## Behavior notes\n\n- Works in interactive mode; non-interactive modes do not show the picker/editor UI\n- Later messages on the abandoned branch are not deleted from the session file; they remain reachable through `/tree`\n- If the selected message contains images, the extension warns that re-editing or deleting it will drop the images and keep only text behavior\n- The extension only offers text-bearing user messages for editing; image-only or whitespace-only user messages are skipped\n- Queued messages must be cleared before using the command\n\n## Development\n\nFor local development you can point pi at the extension directly:\n\n```bash\npi -e ./extensions/edit-session-in-place.ts\n```\n\nLocal verification:\n\n```bash\nnpm run verify\n```\n\nThat runs:\n\n- `npm test` — compiles the TypeScript test fixtures to `.test-dist/` and runs them with Node's built-in test runner\n- `npm run typecheck` — strict TypeScript type-checking\n- `npm pack --dry-run` — publishability check for the npm package contents\n\nCurrent regression coverage in `tests/edit-session-in-place.test.ts` includes:\n\n- message extraction from mixed session content\n- oldest-to-newest ordering for the picker\n- skipping image-only and whitespace-only user messages\n- preserving the image-warning flag for mixed text+image messages\n- `$VISUAL`/`$EDITOR` resolution rules\n- external editor command parsing with quoting/escaping\n- trimming exactly one trailing newline from external-editor output\n\n## Files\n\n- `extensions/edit-session-in-place.ts` — publishable extension implementation\n- `tests/edit-session-in-place.test.ts` — regression tests for message extraction, ordering, and external-editor helpers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitchmultz%2Fpi-edit-session-in-place","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffitchmultz%2Fpi-edit-session-in-place","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffitchmultz%2Fpi-edit-session-in-place/lists"}