Skip to content

Instantly share code, notes, and snippets.

@douglascayers
Last active March 25, 2025 12:57
Show Gist options
  • Save douglascayers/c1c77a69823534d31acc0f9ccabca97b to your computer and use it in GitHub Desktop.
Save douglascayers/c1c77a69823534d31acc0f9ccabca97b to your computer and use it in GitHub Desktop.
⚡️ Update various CLI tools
#!/usr/bin/env zsh
source ~/.bashrc
# Update brew
# https://brew.sh
echo "Updating brew..."
brew update
brew upgrade
brew cleanup
# Update GitHub Copilot
gh extension upgrade gh-copilot
# Update global node modules
versions=($(nvm list --no-colors | grep -E "^(->)?(\s*)(v\d+)" | sed 's/->/ /g' | awk '{ print $1 }'))
for version in "${versions[@]}"; do
echo "Updating global node modules..."
nvm use ${version}
npm update --global --no-audit --no-fund
npm list --global --depth 0
done
nvm use default
# Update python pip
versions=($(pyenv versions --bare))
for version in "${versions[@]}"; do
echo "Updating python..."
pyenv shell ${version}
pip install --upgrade pip
done
pyenv shell system
# Update ruby aliases
rbenv alias --auto
# Update oh-my-zsh
# https://ohmyz.sh
echo "Updating oh-my-zsh"
$ZSH/tools/upgrade.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment