Implement pi registration with URL dedupe and reload reminder in scripts/local-install.mjs #90
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#90
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement Step 3 (register this repo with pi globally as a local-path package, removing any pre-existing URL-based entries for the same repo identity) and Step 4 (print the completion +
/reloadreminder), so the script exits 0 on the happy path.Background
pi stores installed packages in user settings at
~/.pi/agent/settings.json. A previous install may have registered this repo by URL;pi install <absolute local path>registers it as a local-path package so pi loads exactly this repo'spimanifest — and, unlike URL installs, does NOT runnpm install(the script already did that in Step 2). Any pre-existing URL entry for the same repo must be removed first so there is a single clean identity and no duplicated skills/extensions after/reload.Part of the
npm run install:localfeature (tracking issue #41).Depends on: #88 (Implement git pull and npm install steps in scripts/local-install.mjs).
Implementation Details
~/.pi/agent/settings.json(user settings). A missing or unreadable file means "no entries" — continue rather than abort (the pi commands below still run).https://git.excelera.net/david/pi-extensions-and-skillsAND thegit:/ssh://forms of the same identity (e.g.git://git.excelera.net/david/pi-extensions-and-skills,ssh://git@git.excelera.net/david/pi-extensions-and-skills). Normalize trailing.gitand trailing slashes when comparing.pi remove <source>.pi install <absolute path to repo>— resolve the absolute path from the current working directory (e.g.fs.realpathSync(process.cwd())).picommand failure → abort with that command's output and a non-zero exit.Acceptance Criteria
pi listshows this repo as a local-path package entry.https://git.excelera.net/david/pi-extensions-and-skills(or itsgit:/ssh://forms) remains in~/.pi/agent/settings.json.picommand aborts the script with that command's output and a non-zero exit.Test Plan
~/.pi/agent/settings.json(or back up and temporarily edit it), then runnode scripts/local-install.mjson cleanmain. Afterwards:pi listshows only the local-path entry, and grepping the settings file shows no URL entry for this repo. Restore the settings file afterwards if it was edited.pifail (e.g. run with a PATH wherepiis a failing stub) → verify the abort message includes the command's output and the exit code is non-zero. (Also covered by unit tests in a later step.)pi-loop opened and merged a pull request for this issue: #98