Files
composes/paseo/entrypoint.sh
T
tiennm99 feaf4b7e4c feat(paseo): install the agent CLIs named in AGENT_CLIS on start
The entrypoint runs each vendor's installer through gosu paseo for every name
in AGENT_CLIS whose command is not already on PATH, so a fresh paseo-home
volume comes up with agents ready. Defaults to claude and codex; the other
four are opt-in.

On start rather than in the Dockerfile: Docker seeds a named volume from the
image once, at creation, so a build-time install into /home/paseo would only
ever reach a volume that did not exist yet. The check also chowns /home/paseo
first, since a freshly created volume can arrive owned by root and the base
entrypoint has not run its own chown by then.

Unknown names and failed installs are logged and skipped rather than taking
the container down with them.

entrypoint.sh loses its explanations to the README along the way.
2026-09-17 10:36:51 +07:00

44 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Runs as root ahead of the image's own entrypoint: sets the paseo user's
# login password, then installs any agent CLI named in AGENT_CLIS that is not
# already on PATH. See README.md.
set -euo pipefail
if [[ "$(id -u)" == "0" && -n "${PASEO_PASSWORD:-}" ]]; then
printf 'paseo:%s\n' "$PASEO_PASSWORD" | chpasswd
fi
agent_installer() {
case "$1" in
claude) echo 'curl -fsSL https://claude.ai/install.sh | bash' ;;
codex) echo 'curl -fsSL https://chatgpt.com/codex/install.sh | sh' ;;
opencode) echo 'curl -fsSL https://opencode.ai/install | bash' ;;
copilot) echo 'curl -fsSL https://gh.io/copilot-install | bash' ;;
omp) echo 'curl -fsSL https://omp.sh/install | sh' ;;
pi) echo 'curl -fsSL https://pi.dev/install.sh | sh' ;;
esac
}
if [[ "$(id -u)" == "0" && -n "${AGENT_CLIS:-}" ]]; then
chown paseo:paseo /home/paseo
for agent in ${AGENT_CLIS//,/ }; do
installer="$(agent_installer "$agent")"
if [[ -z "$installer" ]]; then
echo "entrypoint: no such agent CLI: $agent" >&2
continue
fi
if command -v "$agent" >/dev/null 2>&1; then
continue
fi
echo "entrypoint: installing $agent"
gosu paseo bash -c "$installer" \
|| echo "entrypoint: $agent failed to install, continuing" >&2
done
fi
exec /usr/local/bin/paseo-docker-entrypoint "$@"