mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
Plugin installs could only be checked against real Agents on the host. The CLIs are installed on the dev-home volume so image rebuilds keep them, and relinked into /usr/local/bin on every start so non-login docker exec finds them. A failed install warns without blocking start.
26 lines
936 B
Bash
Executable File
26 lines
936 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Ensure the Agent CLIs that plugin work drives (claude, codex, pi) exist in the
|
|
# devcontainer, so installs can be verified against the real clients.
|
|
# Packages live on the dev-home volume and survive image rebuilds; only the
|
|
# /usr/local/bin links are container-local, so they are re-made every start.
|
|
set -euo pipefail
|
|
|
|
PREFIX="$HOME/.local/agent-clis"
|
|
# bin → npm package
|
|
declare -A PACKAGES=(
|
|
[claude]="@anthropic-ai/claude-code"
|
|
[codex]="@openai/codex"
|
|
[pi]="@mariozechner/pi-coding-agent"
|
|
)
|
|
|
|
for bin in "${!PACKAGES[@]}"; do
|
|
if [ ! -x "$PREFIX/bin/$bin" ]; then
|
|
echo "▸ Installing $bin (${PACKAGES[$bin]}) …"
|
|
if ! npm install -g --prefix "$PREFIX" --no-fund --no-audit "${PACKAGES[$bin]}" >/dev/null 2>&1; then
|
|
echo "⚠ Could not install $bin; plugin checks against it will report it missing." >&2
|
|
continue
|
|
fi
|
|
fi
|
|
ln -sf "$PREFIX/bin/$bin" "/usr/local/bin/$bin"
|
|
done
|