aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-12 16:28:53 +0200
committeruser <user@clank>2026-08-12 19:34:35 +0200
commit2db5d93ce8269a922eba3674597cbcbc1f2a3cb1 (patch)
tree644d2753300388a36db153b880503f81487d5a73
parentadd pir: fuzzy-find and resume pi sessions for the current dir (diff)
downloadsl0ppi-2db5d93ce8269a922eba3674597cbcbc1f2a3cb1.tar.gz
sl0ppi-2db5d93ce8269a922eba3674597cbcbc1f2a3cb1.tar.xz
sl0ppi-2db5d93ce8269a922eba3674597cbcbc1f2a3cb1.zip
installers: sync scripts/ CLI helpers into ~/bin
The repo already treated extensions as a deliberate snapshot: copy every *.ts into ~/.pi/agent/extensions, skip files already identical. Standalone helpers in scripts/ had no such path, so pir had to be copied by hand and then drifted from the checkout. CLI_TOOLS is a "<source in scripts/>:<installed name>" list, so the installed command name can differ from the filename (pi-resume -> pir). Same copy-not-symlink policy as the extensions, for the same reason: the global set should not track in-progress edits. Copies are chmod +x, the destination is PI_BIN_DIR-overridable like PI_EXT_DIR, a missing source is reported and skipped rather than aborting the whole install, and the entries participate in the existing --dry-run output and the "nothing changed" tally. Also records why answer-picker.ts is absent from the list: it needed a helper binary in its socket+separate-pane form (c88fe0d), and does not any more now that zellij draws and hit-tests the buttons itself and reports clicks on pi's stdin. That implementation is parked in attic/, which this script does not glob -- top-level *.ts only -- so nothing there installs.
-rwxr-xr-xpi-ext/install.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/pi-ext/install.sh b/pi-ext/install.sh
index aea61b4..38d51e6 100755
--- a/pi-ext/install.sh
+++ b/pi-ext/install.sh
@@ -6,6 +6,9 @@
# Files already identical at the destination are skipped.
# After installing, use /reload inside a running pi session to pick them up.
#
+# Also installs the standalone CLI helpers in scripts/ into ~/bin (override with
+# PI_BIN_DIR), same copy-not-symlink policy.
+#
# Override the target dir with PI_EXT_DIR, e.g:
# PI_EXT_DIR=~/.config/pi/agent/extensions ./install.sh
#
@@ -16,6 +19,14 @@ set -euo pipefail
cd "$(dirname "$0")"
DEST="${PI_EXT_DIR:-$HOME/.pi/agent/extensions}"
+BIN_DEST="${PI_BIN_DIR:-$HOME/bin}"
+
+# Standalone CLI tools: "<source in scripts/>:<installed name>"
+# answer-picker.ts needs no helper binary any more: zellij draws and hit-tests
+# the buttons itself (OSC 5577) and reports clicks on pi's stdin. The previous
+# socket+separate-pane implementation is kept, unwired, in attic/ — attic is not
+# globbed by this script, so nothing there is installed.
+CLI_TOOLS=( "pi-resume:pir" )
dry_run=0
case "${1:-}" in
@@ -56,6 +67,15 @@ if [ "$dry_run" -eq 1 ]; then
echo " copy $f"
fi
done
+ echo "Would sync ${#CLI_TOOLS[@]} CLI tool(s) into: $BIN_DEST"
+ for spec in "${CLI_TOOLS[@]}"; do
+ src="scripts/${spec%%:*}"; name="${spec##*:}"
+ if cmp -s "$src" "$BIN_DEST/$name"; then
+ echo " skip (identical) $name"
+ else
+ echo " copy $name"
+ fi
+ done
exit 0
fi
@@ -71,6 +91,20 @@ for f in "${files[@]}"; do
copied=$((copied + 1))
done
+mkdir -p "$BIN_DEST"
+for spec in "${CLI_TOOLS[@]}"; do
+ src="scripts/${spec%%:*}"; name="${spec##*:}"
+ [ -f "$src" ] || { echo "install.sh: missing $src" >&2; continue; }
+ if cmp -s "$src" "$BIN_DEST/$name"; then
+ echo "skipped (identical) $name"
+ continue
+ fi
+ cp "$src" "$BIN_DEST/$name"
+ chmod +x "$BIN_DEST/$name"
+ echo "installed $name -> $BIN_DEST/$name"
+ copied=$((copied + 1))
+done
+
echo
if [ "$copied" -eq 0 ]; then
echo "Nothing changed; global set already up to date."