An oh-my-zsh plugin that shows you how many outdated Homebrew packages you have β right in your terminal MOTD.
Uses a stale-while-revalidate cache so your prompt is never blocked β‘ The heavy brew update && brew outdated runs in the background; the display is an instant file read.
- π Zero-delay login β reads from cache, refreshes in background
- π Stale-while-revalidate β always shows something, updates behind the scenes
- π¦ First-run sync β no cache yet? Fetches synchronously so you always get output
- β±οΈ Configurable TTL β default 3 hours, set whatever you like
- π₯οΈ Cross-platform β works on macOS and Linux
- π Verbose mode β optionally list the outdated package names
Clone into your custom plugins directory:
git clone https://github.com/xalior/zsh-brew-outdated.git \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/brew-outdatedThen add brew-outdated to your plugin list in ~/.zshrc:
plugins=(... brew-outdated)zinit light xalior/zsh-brew-outdatedantigen bundle xalior/zsh-brew-outdatedSet these before oh-my-zsh is loaded in your ~/.zshrc:
| Variable | Default | Description |
|---|---|---|
BREW_OUTDATED_CACHE_TTL |
10800 |
Max cache age in seconds (default: 3 hours) |
BREW_OUTDATED_CACHE_FILE |
~/.cache/brew-outdated |
Path to the cache file |
BREW_OUTDATED_VERBOSE |
false |
If true, list outdated package names |
Example:
BREW_OUTDATED_CACHE_TTL=7200 # refresh every 2 hours
BREW_OUTDATED_VERBOSE=true # show package names
plugins=(... brew-outdated)
source $ZSH/oh-my-zsh.shDefault:
7 outdated Homebrew package(s)
Verbose (BREW_OUTDATED_VERBOSE=true):
7 outdated Homebrew package(s)
ffmpeg
git
node
[email protected]
ripgrep
sqlite
wget
- Plugin registers a
precmdhook so output appears after your other MOTD (neofetch, fastfetch, etc.) - Checks the cache file's age against the TTL
- If stale, spawns a background job to run
brew update && brew outdatedπ - If no cache exists at all, fetches synchronously so you always see output on first run
- Displays from cache instantly β zero prompt delay β‘
The plugin refreshes its cache when you open a shell, but Homebrew's own autoupdate tap can keep your formulae database fresh in the background via launchd β even when you haven't opened a terminal in a while.
brew tap homebrew/autoupdate
brew autoupdate start 43200 --cleanup # every 12 hoursThis pairs nicely with the plugin: brew autoupdate keeps brew update running on a schedule, so when the plugin checks brew outdated the results are already up to date β making the background refresh even faster. β‘
Without brew autoupdate, the plugin handles everything on its own β it just means the background refresh includes a brew update which takes a few seconds longer.
zsh+brew- Works with oh-my-zsh, zinit, antigen, or manual sourcing
MIT β go wild π€