A local-first multi-agent app development platform, built on PenguinHarness
#!/bin/sh
# penguin CLI launcher, installed as bin/penguin inside the program directory.
#
# Runs the CLI on the Node runtime bundled at node/ when this package carries one,
# otherwise on system Node (>= 24). The web assets sit beside it at web/.
# This script's real location; readlink -f is not portable to macOS, hence the loop.
SOURCE=$0
while [ -h "$SOURCE" ]; do
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SOURCE=$(readlink "$SOURCE")
case $SOURCE in
/*) ;;
*) SOURCE="$DIR/$SOURCE" ;;
esac
done
DIR=$(dirname "$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)")
# The front-end build this install serves. Adelie's own spelling wins, then the pre-rename
# PENGUIN_WEB_DIST a launcher from an older release (or an operator's shell rc) set — the reader
# accepts both and prefers this one (core's state/boundary-env.ts), so honoring the old name here
# is what keeps an explicit override working across the rename.
export ADELIE_WEB_DIST="${ADELIE_WEB_DIST:-${PENGUIN_WEB_DIST:-$DIR/web}}"
# The data root this install owns. The installer lays the program out in a program directory and
# keeps the data root inside it (`<program>/data`) — that is where an install made before Adelie
# spelled its environment Adelie's way has its Agents, Sessions and usage, so exporting the path
# here is what carries them across an upgrade: without it the new CLI would resolve Adelie's
# default root (~/.adelie/data) instead and that install's data would look gone. An explicit
# ADELIE_HOME wins, then the pre-2.2 PENGUIN_HOME, then this install's own `data/`.
export ADELIE_HOME="${ADELIE_HOME:-${PENGUIN_HOME:-$DIR/data}}"
if [ -x "$DIR/node/bin/node" ]; then
exec "$DIR/node/bin/node" "$DIR/lib/dist/penguin.js" "$@"
fi
exec node "$DIR/lib/dist/penguin.js" "$@"