Skip to content

Instantly share code, notes, and snippets.

@scottwater
Created March 6, 2026 12:31
Show Gist options
  • Select an option

  • Save scottwater/90d14364314c263d3b47e72bd808e754 to your computer and use it in GitHub Desktop.

Select an option

Save scottwater/90d14364314c263d3b47e72bd808e754 to your computer and use it in GitHub Desktop.
Update all the tools
#!/usr/bin/env bash
set -u
run_update() {
local tool_name="$1"
shift
echo ""
echo "=== Updating ${tool_name} ==="
if "$@"; then
echo "✅ ${tool_name} updated"
return 0
else
local status=$?
echo "❌ ${tool_name} update failed (exit ${status})"
return "$status"
fi
}
failures=0
run_update "pi" npm install -g @mariozechner/pi-coding-agent || failures=$((failures + 1))
run_update "amp" amp update || failures=$((failures + 1))
run_update "codex" npm install -g @openai/codex || failures=$((failures + 1))
run_update "claude code" claude update || failures=$((failures + 1))
run_update "opencode" opencode upgrade || failures=$((failures + 1))
echo ""
if [[ "$failures" -eq 0 ]]; then
echo "All update commands completed successfully."
else
echo "Completed with ${failures} failed update(s)."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment