Install Agent Skills into all 3 AI CLIs, and use Bun instead of npm

Adds scripts/install-skills.sh: pulls this repo's extensions/ skill
bundles (SKILL.md-format) at workspace startup and installs them into
Claude Code (~/.claude/skills), GitHub Copilot CLI (~/.copilot/skills),
and Antigravity CLI (~/.gemini/config/skills). Every env gets the common
awesome-skills-plugin bundle; COBOL/3D/TTRPG additionally get their
matching skill(s) from custom-specialty-plugin via a per-template
SPECIALTY_SKILLS value.

Each template also installs Bun via a coder_script and hooks ~/.bun/bin
onto PATH in .bashrc (the bun.sh installer doesn't reliably do this in a
scripted shell). The CLI setup wizard now uses `bun install -g` instead
of `npm install -g` for GitHub Copilot CLI and Claude Code CLI.

All six templates re-validated with terraform init/validate against the
real coder-server container on octo-winsrv.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-15 11:41:09 +02:00
parent 1beaac6e4f
commit f6c432d21d
9 changed files with 393 additions and 23 deletions
+46
View File
@@ -267,3 +267,49 @@ resource "coder_script" "cli_setup_wizard" {
fi
EOT
}
# Installs Bun and uses it (instead of npm) for the CLI installs the wizard
# script runs. The installer doesn't reliably add ~/.bun/bin to PATH in
# non-interactive shells, so that's hooked into .bashrc explicitly here.
resource "coder_script" "install_bun" {
agent_id = coder_agent.main.id
display_name = "Install Bun"
run_on_start = true
script = <<-EOT
#!/bin/bash
set -e
export BUN_INSTALL="$HOME/.bun"
if [ ! -x "$BUN_INSTALL/bin/bun" ]; then
curl -fsSL https://bun.sh/install | bash
fi
MARKER="# >>> coder bun path >>>"
if ! grep -qF "$MARKER" "$HOME/.bashrc" 2>/dev/null; then
{
echo ""
echo "$MARKER"
echo 'export BUN_INSTALL="$HOME/.bun"'
echo 'export PATH="$BUN_INSTALL/bin:$PATH"'
echo "# <<< coder bun path <<<"
} >> "$HOME/.bashrc"
fi
EOT
}
# Installs this repo's Agent Skills into Claude Code, GitHub Copilot CLI, and
# Antigravity CLI's skills directories. See ../../scripts/install-skills.sh.
# Default has no matching entry in extensions/custom-specialty-plugin/skills,
# so it only gets the common awesome-skills-plugin bundle.
resource "coder_script" "install_skills" {
agent_id = coder_agent.main.id
display_name = "Install Agent Skills"
run_on_start = true
script = <<-EOT
#!/bin/bash
set -e
mkdir -p /opt/coder
echo '${base64encode(file("${path.module}/../../scripts/install-skills.sh"))}' | base64 -d > /opt/coder/install-skills.sh
chmod +x /opt/coder/install-skills.sh
SPECIALTY_SKILLS="" /opt/coder/install-skills.sh
EOT
}