Cross-platform Pi extension that overrides the built-in read and edit tools with a hash-anchored workflow designed to avoid fragile oldText must match exactly failures.
It is especially useful on:
- Windows projects
- repos with mixed
CRLF/LF - models that are flaky with Pi's exact-text
edit
This package is based on the hashline editing approach pioneered by oh-my-pi and the excellent RimuruW/pi-hashline-edit package. This repo focuses on a release-ready, cross-platform variant for global Pi use.
Returns text files as LINE#HASH:content:
8#VR:function hello() {
9#KT: console.log("world");
10#BH:}
Edits by anchor instead of raw exact-match text:
{
"path": "src/main.ts",
"edits": [
{ "op": "replace", "pos": "11#KT", "lines": [" console.log('hashline');"] }
]
}Supported ops:
replaceappendprependreplace_text
The package still accepts native Pi-style compatibility payloads and normalizes them before validation when possible.
Pi's built-in edit is strict by design: oldText must match exactly, including whitespace and newlines. That breaks often when:
- the model copies text imperfectly
- the file changed after
read - the repo uses
CRLF - the model sends ambiguous multi-edit payloads
Hashline anchors reduce that fragility by targeting explicit line references from the latest read.
- Windows-friendly test suite
- CI ready for Linux + Windows
- CRLF note in
readoutput, with preserved line endings on write - global Pi install instructions
- release packaging metadata
pi install git:github.com/cervantesh/pi-hashline-edit-plus@v0.1.0git clone https://github.com/cervantesh/pi-hashline-edit-plus
cd pi-hashline-edit-plus
pi install .pi listYou should see git:github.com/cervantesh/pi-hashline-edit-plus@v0.1.0 in your global packages.
- Use
readbeforeeditunless you already have fresh anchors. - Batch all edits for one file into a single
editcall. - If
readsays the file usesCRLF, edits still preserveCRLFon write. - Prefer anchor-based edits over
replace_text.
npm install
npm run checkMIT