aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-12 22:51:23 +0200
committeruser <user@clank>2026-08-12 22:51:23 +0200
commitf8f035713f29676348602246036aba840468cc5f (patch)
treec14f2298d9771cd9b6215f8a40743627c4412ca2 /packaging
parentcli: init and doctor, and stop one bad project breaking a root (diff)
downloadsl0ppi-f8f035713f29676348602246036aba840468cc5f.tar.gz
sl0ppi-f8f035713f29676348602246036aba840468cc5f.tar.xz
sl0ppi-f8f035713f29676348602246036aba840468cc5f.zip
build: ship the sl0ppi CLI in the tarball
The artifact was stale twice over: it predated the protobuf fix and did not contain the CLI at all. Both fixed, and the whole chain re-verified from the tarball rather than assumed. The CLI ships as a single 31K file (`bun build --target=bun`) run by the bundled bun, rather than a source tree or a second `--compile`d binary that would embed another 90M copy of bun. `install.sh` generates the wrapper and pins SL0PPI_BIN to the sl0ppij it just installed, so the orchestrator can never end up driving some other zellij that happens to come first on PATH. Verified in a throwaway HOME with node, npm, bun, cargo, rustc and python3 all replaced by poison stubs that fail loudly if invoked: sl0ppij --version -> 0.45.0+sl0p1 (static musl, no libc dependency) pi --version -> 0.84.1 (bundled bun) sl0ppi doctor -> all good sl0ppi init x2 -> two projects scaffolded sl0ppi up -> session "dev", 2 tabs, agents suspended sl0ppi ls -> agent:suspended, 1 pane each sl0ppi up (again) -> "up to date" And the promise the whole thing exists for, end to end: attach a client, press Enter in the suspended agent pane, and pi starts on the bundled runtime -- while the other project's agent stays suspended, because only the focused pane got the key. `make test` now runs the CLI suite alongside the Rust ones, so the two halves cannot drift apart unnoticed.
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/install.sh27
-rwxr-xr-xpackaging/stage.sh11
2 files changed, 30 insertions, 8 deletions
diff --git a/packaging/install.sh b/packaging/install.sh
index 07650a3..657085a 100755
--- a/packaging/install.sh
+++ b/packaging/install.sh
@@ -5,7 +5,7 @@
#
# Defaults to a per-user install under ~/.local, touching nothing outside:
#
-# $PREFIX/bin/{sl0ppij,pi,pir} (pi is a wrapper around the bundled bun)
+# $PREFIX/bin/{sl0ppi,sl0ppij,pi,pir} (sl0ppi and pi run on the bundled bun)
# $PREFIX/libexec/sl0ppi/ bundled bun + pi
# $PREFIX/share/sl0ppi/ config templates, layouts, themes, plugins
# ~/.config/sl0ppij/ live config (never clobbered without --force-config)
@@ -44,7 +44,7 @@ run() { if [ "$dry_run" = 1 ]; then echo " would: $*"; else "$@"; fi; }
if [ "$uninstall" = 1 ]; then
say "removing sl0ppi from $PREFIX (config and pi extensions are left alone)"
- for f in sl0ppij pi pir; do run rm -f "$PREFIX/bin/$f"; done
+ for f in sl0ppi sl0ppij pi pir; do run rm -f "$PREFIX/bin/$f"; done
run rm -rf "$LIBEXEC" "$SHARE"
say "done. Config still at $CONFIG_DIR"
exit 0
@@ -57,15 +57,16 @@ run mkdir -p "$PREFIX/bin" "$LIBEXEC" "$SHARE"
run install -m755 "$SRC/bin/sl0ppij" "$PREFIX/bin/sl0ppij"
run install -m755 "$SRC/bin/pir" "$PREFIX/bin/pir"
run install -m755 "$SRC/libexec/bun" "$LIBEXEC/bun"
+run install -m644 "$SRC/libexec/sl0ppi.js" "$LIBEXEC/sl0ppi.js"
run rm -rf "$LIBEXEC/pi"
run cp -a "$SRC/libexec/pi" "$LIBEXEC/pi"
run rm -rf "$SHARE/sl0ppij" "$SHARE/pi-ext"
run cp -a "$SRC/share/sl0ppij" "$SRC/share/pi-ext" "$SHARE/"
run install -m644 "$SRC/MANIFEST" "$SHARE/MANIFEST"
-# pi is a generated wrapper: bundled runtime, bundled agent, no system node.
+# pi and sl0ppi are generated wrappers: bundled runtime, no system node.
if [ "$dry_run" = 1 ]; then
- echo " would: generate $PREFIX/bin/pi wrapper"
+ echo " would: generate $PREFIX/bin/pi and $PREFIX/bin/sl0ppi wrappers"
else
cat > "$PREFIX/bin/pi" <<EOF
#!/usr/bin/env bash
@@ -73,6 +74,16 @@ else
exec "$LIBEXEC/bun" "$LIBEXEC/pi/@earendil-works/pi-coding-agent/dist/cli.js" "\$@"
EOF
chmod +x "$PREFIX/bin/pi"
+
+ # SL0PPI_BIN is pinned to the sl0ppij we just installed, so the orchestrator
+ # never drives some other zellij that happens to come first on PATH.
+ cat > "$PREFIX/bin/sl0ppi" <<EOF
+#!/usr/bin/env bash
+# generated by sl0ppi $VERSION -- the orchestrator, on the bundled bun
+export SL0PPI_BIN="\${SL0PPI_BIN:-$PREFIX/bin/sl0ppij}"
+exec "$LIBEXEC/bun" "$LIBEXEC/sl0ppi.js" "\$@"
+EOF
+ chmod +x "$PREFIX/bin/sl0ppi"
fi
# --- config: install, never silently clobber -------------------------------
@@ -118,7 +129,7 @@ done
# --- report ----------------------------------------------------------------
say "installed:"
-echo " $PREFIX/bin/{sl0ppij,pi,pir}"
+echo " $PREFIX/bin/{sl0ppi,sl0ppij,pi,pir}"
echo " $CONFIG_DIR"
echo " $PI_EXT_DIR"
@@ -133,6 +144,10 @@ if command -v zellij >/dev/null 2>&1; then
echo " run at the same time."
fi
-say "start with: sl0ppij"
+say "start with: sl0ppi up (in a directory that holds your projects)"
+echo " sl0ppi doctor check this installation"
+echo " sl0ppi init make the current directory a project"
+echo " sl0ppij the multiplexer on its own, if you prefer"
+echo
echo " On the very first launch the status bar plugin asks for permissions"
echo " (\"... Allow? (y/n)\") -- press y once and it is remembered."
diff --git a/packaging/stage.sh b/packaging/stage.sh
index 0d867bb..e2aeb14 100755
--- a/packaging/stage.sh
+++ b/packaging/stage.sh
@@ -9,13 +9,14 @@
# bin/sl0ppij the multiplexer
# bin/pir session-resume helper
# libexec/bun pinned runtime
+# libexec/sl0ppi.js the CLI, bundled to one file
# libexec/pi/ pinned agent + deps
# share/sl0ppij/config.kdl
# share/sl0ppij/layouts/ share/sl0ppij/themes/ share/sl0ppij/plugins/
# share/pi-ext/ extensions installed into the user's pi dir
#
-# bin/pi is NOT staged: the installer generates it as a wrapper, because it must
-# point at wherever libexec landed.
+# bin/pi and bin/sl0ppi are NOT staged: the installer generates them as wrappers,
+# because they must point at wherever libexec landed.
set -euo pipefail
STAGE="${1:?stage dir}"
@@ -80,6 +81,11 @@ done
shopt -u nullglob
install -m755 "$ROOT/pi-ext/scripts/pi-resume" "$STAGE/bin/pir"
+# --- the orchestrator -------------------------------------------------------
+CLI_BUNDLE="$ROOT/cli/dist/sl0ppi.js"
+need "$CLI_BUNDLE" cli
+install -m644 "$CLI_BUNDLE" "$STAGE/libexec/sl0ppi.js"
+
# --- vendored runtime + agent ----------------------------------------------
need "$VENDOR/bun-$BUN_VERSION/bun" vendor
need "$VENDOR/pi-$PI_VERSION/node_modules" vendor
@@ -93,6 +99,7 @@ echo "$VERSION" > "$STAGE/VERSION"
echo "sl0ppi $VERSION"
echo "sl0ppij $(grep -m1 '^version = ' "$ROOT/sl0ppij/Cargo.toml" | cut -d'"' -f2)"
echo "sl0pstatus $(grep -m1 '^version = ' "$ROOT/sl0pstatus/Cargo.toml" | cut -d'"' -f2)"
+ echo "sl0ppi-cli $(grep -m1 '"version"' "$ROOT/cli/package.json" | cut -d'"' -f4)"
echo "pi $PI_VERSION"
echo "bun $BUN_VERSION"
} > "$STAGE/MANIFEST"