docs(adr): put install and update ownership in pi2d (ADR 0004)

Two owners for one artifact broke exactly as expected: on a machine with the
standalone pi2, the plugin's npm copy sat on a lower rung of the resolution
ladder, so `:PiWebUpdate` upgraded a copy nobody ran and reported success while
the daemon kept the old version.

ADR 0004 records the fix. The standalone artifact is the one self-updating
channel (`install.sh` + `pi2 update`, built on ADR 0003's receipt); npm, Homebrew
and the AUR stay as distributions whose upgrades belong to their package
manager — `pi2 update` refuses them with the right command, the uv model. The
plugin becomes a pure client: resolve, delegate, print.

docs/install.md and README.md are reordered to match: the standalone installer is
the recommended path, the package managers are alternatives that upgrade
themselves. ADR 0002 §2.1 keeps its survey but is marked amended where it had
left `:PiWebInstall` as a plugin-side npm installer.
This commit is contained in:
yuez committed 2026-10-30 09:55:08 +08:00
1 parent 2240289426
commit 086cac8c8e
4 files changed
+183 -96

No files matched your search

+18 -16
View File
@@ -22,21 +22,10 @@ Requirements: **Node >= 20** (for the npm channel; the curl installer and system
> **Status.** The daemon CLI, the web console and the standalone installer are ready today (`npm i -g @yuez/pi2d` and `install.sh` work today). `:PiWeb` and `:PiWebInstall` land with the next pi2.nvim release, so today the flow is `pi2 daemon` + `pi2 open` (or running the daemon as a user service).
### Channel A: Global package manager (Node >= 20)
### Recommended: the standalone installer (the self-updating channel)
If your machine has Node >= 20:
```bash
npm i -g @yuez/pi2d
# or:
pnpm add -g @yuez/pi2d
bun add -g @yuez/pi2d
mise use -g npm:@yuez/pi2d
```
### Channel B: Standalone curl installer (no Node required)
For machines without Node, with an older distro Node (e.g. Debian 12 ships 18), or where you want a self-contained installation with no global npm or root access:
One self-contained binary, no Node, no root — the only channel that updates itself with
`pi2 update`. Also the right choice for an older distro Node (Debian 12 ships 18) or musl systems:
```bash
curl -fsSL https://raw.githubusercontent.com/zgs225/pi2d/main/scripts/install.sh | sh
@@ -47,6 +36,19 @@ points `~/.local/lib/pi2d/current` at it, writes an install receipt and symlinks
`~/.local/bin/pi2`. After that, `pi2 update` upgrades it in place (verified download, SLSA
provenance check, atomic `current` switch, one-step rollback).
### Or: a package manager (it owns the upgrade)
If you prefer npm-style installs (Node >= 20). Upgrades belong to that package manager —
`pi2 update` refuses npm trees and prints `npm i -g @yuez/pi2d@latest`:
```bash
npm i -g @yuez/pi2d
# or:
pnpm add -g @yuez/pi2d
bun add -g @yuez/pi2d
mise use -g npm:@yuez/pi2d
```
To uninstall, first remove the daemon's local state (runtime, service unit, and — with flags —
data/state/config), then the binaries:
@@ -60,7 +62,7 @@ On the npm / Homebrew / AUR channels the binary tree belongs to the package mana
[Complete removal](docs/install.md#uninstall) for the full table of paths and the two things
no CLI can clean (browser site data, the plugin-private copy).
### Channel C: System packages (Homebrew, AUR)
### Or: Homebrew / AUR (they own the upgrade)
*(Available once the release that publishes binaries has shipped)*:
@@ -69,7 +71,7 @@ no CLI can clean (browser site data, the plugin-private copy).
brew install zgs225/tap/pi2d
```
- **Arch Linux / Manjaro / EndeavourOS (AUR `pi2d-bin`):**
*(AUR account registration is temporarily closed upstream — until it reopens, Arch users install with the [curl installer](#channel-b-standalone-curl-installer-no-node-required) above)*:
*(AUR account registration is temporarily closed upstream — until it reopens, Arch users install with the [standalone installer](#standalone) above)*:
```bash
paru -S pi2d-bin # or: yay -S pi2d-bin
```