One command to keep a developer machine current: Homebrew, container images (Colima, OrbStack, Docker Desktop, Rancher Desktop, Podman or native Docker Engine), uv tools, mise (Node & friends), Mac App Store apps and macOS system updates — in the right order, without babysitting.
freshenWatch a short terminal recording of freshen running a dry run and a --check query:
Download the cast and play it locally with asciinema:
asciinema play docs/assets/freshen-demo.castThe implementation is the Rust workspace under crates/: freshen-lib holds all logic and the freshen binary is a thin CLI wrapper. It runs on macOS, Linux and Windows. The roadmap (PLAN.md) covers the remaining steps, a config file, rollback snapshots and scheduling. Every step is optional: if a tool is not installed, its section is skipped.
| Step | Commands |
|---|---|
| Homebrew | brew update → brew upgrade --formula → quit running apps → brew upgrade --cask (with --greedy only for casks that need it) → reopen the apps it quit. With --cleanup: brew autoremove → brew cleanup --prune=all before reopening. brew doctor and brew bundle cleanup report what they found and change nothing |
| Containers | Detects the active runtime (Colima, OrbStack, Docker Desktop, Rancher Desktop, Podman or native Docker Engine) from DOCKER_HOST, docker context show or well-known sockets; stops it before upgrading its package and restarts it afterwards, bringing compose projects and standalone containers back. With --cleanup: docker image prune -f. Override with --container-runtime |
| uv | uv tool upgrade --all. With --cleanup: uv cache prune |
| mise | mise self-update (only if mise was not installed via brew) → mise upgrade, plus a warning for processes still running on an old Node, Python, Java or Go version, naming the app that started them. With --cleanup: mise prune -y |
| Mac App Store | mas outdated to list the App Store apps with a pending update → mas upgrade to install them. macOS only, and skipped when no Apple Account is signed in |
| macOS system updates | softwareupdate --list to list the macOS updates that are available. They are only reported, never installed; --install-macos-updates installs them with softwareupdate --install --all. The Xcode Command Line Tools are the exception: they are installed when the listing names them, because Homebrew needs them. macOS only |
A failing step never aborts the run. Failures are collected and listed at the end (exit code 1).
- Both Homebrew architectures are updated. On an Apple Silicon Mac the native Homebrew lives at
/opt/homebrewand an Intel Homebrew installed for Rosetta lives at/usr/local. freshen discovers both (and thebrewonPATH) and runs every Homebrew step for each installation, so packages in the other architecture are not silently left behind. With a single installation the commands are exactlybrew ...as before; with two, the output names the prefix and the pre-upgrade snapshot and rollback hints cover both. - Formulae are upgraded before apps are closed, so apps stay open during the slow part.
- Apps are only quit when a cask upgrade will replace them. Quit is graceful (AppleScript, 3 s timeout so a "Save changes?" dialog cannot hang the run). Apps that do not quit within
QUIT_TIMEOUTare left alone unless--force-killis given. - An app that updates itself is waited for, not quit. Apps that update themselves (Sparkle, or the auto-updater of an Electron app) replace their own bundle while they run, so quitting them mid-update would leave a broken app behind. freshen detects the running updater, waits up to
UPDATE_TIMEOUTseconds for the update to finish and only then quits the app. An app whose update does not finish in time is left running and is not reopened. - A denied Automation permission is explained, not ignored. When macOS refuses to send Apple events (error -1743), freshen names the System Settings pane to allow: System Settings > Privacy & Security > Automation.
- A cask that needs an administrator password is skipped when there is no terminal. Homebrew installs a macOS installer package (
pkg) or asudoscript withsudo, which asks for the password on the terminal. A run without a terminal (a cron job, a CI job) skips those casks and names the reason instead of waiting for a password that never comes, and the message tells you whichbrew upgrade --caskcommand to run by hand. - The terminal running freshen is never quit. Detection uses
__CFBundleIdentifier,TERM_PROGRAM, environment markers and, on Linux and Windows, the parent process chain. See supported terminals. - Reopening uses
open -g, so apps do not steal focus. - Apps without a Dock icon are handled too. A menu-bar app (an agent that sets
LSUIElement) and a login item (a helper inContents/Library/LoginItems) run without an icon in the Dock, so macOS does not address them with an Apple event. freshen ends their process instead (kill -TERM,kill -9with--force-kill), which needs no Automation permission, and starts them again in the background: a menu-bar app withopen -g -j -b, a login item by its path (open -g -j -a), the way macOS starts it at login. A login item that the app started again by itself is left alone. - Reopening keeps the apps the way they were. Before an app is quit, freshen asks macOS whether the app is hidden and where its window is. A hidden app is reopened hidden (
open -g -j), and the window of a visible app is put back where it was, so the app comes back on the display it was on (macOS decides which Space the window joins). The state is read through System Events, so macOS asks once for the permission to control it; without that permission the apps are simply reopened in the background as before. mise upgradeis used without--bumpon purpose: withnode@ltsin your config,--bumpwould pinltsto a fixed version.- The Mac App Store is only updated when an account is signed in. Installing an App Store app needs an Apple Account that is signed in to the App Store. When none is signed in, freshen skips the step (
not signed in) instead of failing the run, and tells you to sign in with the App Store app and runmas upgradeby hand. The step needsmasonPATH;mas5 and newer have noaccountcommand, so on those versions freshen cannot ask and simply tries the upgrade.mas5 and newer also install App Store apps with administrator rights, so the upgrade needs cachedsudocredentials; without them freshen says so and points atsudo mas upgrade. - macOS system updates are only reported, never installed.
softwareupdate --listshows the updates macOS offers, and freshen prints them; it installs nothing, because a macOS update is the biggest change it can make: it needs administrator rights, it takes a long time and the machine may have to restart afterwards.--install-macos-updatesasks for the installation (sudo -n softwareupdate --install --all, so a missing password fails right away instead of waiting for one). freshen also reports the updates that need a restart (Action: restart) and says when the machine has to restart to finish an update. - The Xcode Command Line Tools are updated when macOS offers them. They are developer tools that Homebrew needs, and right after a macOS update the installed ones are too old: Homebrew then refuses to work with
Error: Your Command Line Tools are too outdated.freshen installs them whensoftwareupdate --listnames them (sudo -n softwareupdate --install "Command Line Tools for Xcode"), without waiting for a password: a missing one is reported with the command to run by hand. When Homebrew runs into that error, freshen names the fix instead of showing the raw output of the command. - Long-running sessions are never broken silently. If an upgrade would break a session or interrupt a running Docker build, freshen prints a warning naming what will be interrupted. See supported session managers.
- Every run starts with preflight checks: the network must be reachable, at least 1 GiB must be free, the battery must be at or above 20% while discharging, and the connection must not be metered or a hotspot. A failed check stops before any step runs (exit code 3) and lists every problem. Each check can be disabled with
--skip-network-check,--skip-disk-check,--skip-battery-checkor--skip-metered-check;--min-free-disk-giband--battery-thresholdchange the thresholds.--dry-runand--checkskip preflight because they change nothing. - Another package manager must not be running. Before changing anything, freshen checks for Homebrew, apt/dpkg (including a held dpkg or apt lock) and winget. It waits up to 30 seconds for the other process to finish, then stops with exit code 3 and names the process and its PID. Use
--package-manager-wait <SECONDS>to change the wait (0 aborts immediately) or--skip-package-manager-checkto bypass the check.--dry-runand--checkskip it because they change nothing. - Every run records a pre-upgrade snapshot of installed versions (
brew list --versions,brew list --cask --versions,brew bundle dump,uv tool list,mise ls, Docker images) in a timestamped file under the platform state directory (~/.local/state/freshen/snapshotson Linux,~/Library/Application Support/freshen/snapshotson macOS,%LOCALAPPDATA%\freshen\snapshotson Windows). SetFRESHEN_SNAPSHOT_DIRto override the location. The summary prints the commands that reinstall the recorded versions. Only the most recent snapshots are kept;--snapshot-retentionchanges the window (the default is 10, and0keeps every snapshot). - Destructive cleanup is opt-in. Cache pruning, old-version pruning,
brew autoremove,brew cleanup --prune=allanddocker image pruneonly run with--cleanup. Without it freshen prints why each one was skipped. When enabled, every item a cleanup removes is echoed and the reclaimed space is reported when the tool provides it. - The Homebrew health checks only report.
brew doctorshows what it found about the installation (an outdated Homebrew, a directory that is not inPATH, unbrewed libraries), andbrew bundle cleanuplists the packages that are installed but are not in yourBrewfile. Neither removes or changes anything: the packages are only removed when you runbrew bundle cleanup --forceyourself. The bundle check is skipped when there is noBrewfilein the working directory (or whereHOMEBREW_BUNDLE_FILEpoints). - A hung step cannot hang the whole run.
--step-timeout <SECONDS>bounds each step (detection, check, upgrade and cleanup) and--timeout <SECONDS>bounds the whole run. A step that runs out of time is stopped, reported astimed outrather thanfailed, and anything it stopped is restored;0disables a timeout.--checkhas its own performance budget (--check-timeout <SECONDS>, default 30) so a read-only check completes within a documented time on a typical machine. --checkqueries independent steps concurrently. Up to--jobs Nread-only queries run at the same time (the default is 4, and0is treated as 1). The report keeps the run order and the summary counts are deterministic regardless of which query finishes first.- Transient download errors are retried with exponential backoff. A connection reset, timeout or temporary HTTP 5xx/429 response is retried up to twice before the step gives up. If the package registry is permanently unreachable (DNS failure, refused connection or no route), the step is reported as
skippedwith the reasonregistry unreachableinstead of failing the run. - Only one update runs at a time. A second run stops with an error naming the PID that holds the lock. The lock lives under the platform state directory (
FRESHEN_LOCK_DIRoverrides it), and--dry-run/--checkdo not take it. - Tools are asked for their output in a neutral locale. Every command whose output freshen parses runs with
LC_ALL=CandLANG=C(and, on Windows, with a UTF-8 console and without interactivity), so a machine set to another language cannot change the columns of a table or the words freshen looks for. The commands whose output is only shown to you keep the language of your machine.
Supported terminal emulators: Apple Terminal, iTerm2, Ghostty, kitty, WezTerm, Alacritty, Hyper, Warp, Tabby, Rio, Termius, Visual Studio Code, Zed, Zed Preview, Cursor, Windsurf, JetBrains, IntelliJ IDEA, IntelliJ IDEA CE, PyCharm, PyCharm CE, WebStorm, CLion, GoLand, RubyMine, PhpStorm, DataGrip, Rider, AppCode, RustRover, Fleet, Android Studio, GNOME Terminal, Konsole, Windows Terminal, Windows Console, xterm, Xfce Terminal, LXTerminal, MATE Terminal, Terminator, Tilix, urxvt, foot, GNOME Console, st.
Session managers checked before an upgrade: zellij, tmux, OpenSSH, GNU screen, byobu, dtach, abduco, mosh.
freshen is distributed as prebuilt binaries for macOS, Linux and Windows, with a SHA-256 checksums file attached to every GitHub Release. The quickest way to install is the one-line installer: it detects your operating system and architecture, downloads the matching prebuilt binary, verifies its SHA-256 checksum against the release's checksums.txt before installing anything, and installs freshen to /usr/local/bin (override with FRESHEN_BIN_DIR):
curl -fsSL https://raw.githubusercontent.com/yildirimarda/freshen/main/install.sh | shInstall a specific release with FRESHEN_VERSION (defaults to latest):
FRESHEN_VERSION=0.1.0 sh install.shYou can also install with Homebrew (brew install yildirimarda/homebrew-tap/freshen), Scoop, winget, Chocolatey, the AUR PKGBUILD, the Nix flake, or cargo binstall freshen.
- macOS, Linux or Windows; a prebuilt
freshenbinary or Rust 1.81+ to build from source - Homebrew — required for the Homebrew section
- Optional: any supported container runtime (
colima/lima,orbstack,docker-desktop,rancher-desktop,podman, nativedocker),uv,mise,mas(Mac App Store, macOS only); the macOS system updates need no extra tool,softwareupdateis part of macOS
freshen # interactive: asks before quitting apps
freshen --yes # no prompt
freshen --force-kill # kill apps that refuse to quit (unsaved data may be lost)
freshen --cleanup # also prune caches, old versions and dangling images
QUIT_TIMEOUT=40 freshen # wait longer for apps to quit
UPDATE_TIMEOUT=120 freshen # wait longer for an app that updates itself
freshen --dry-run # detect and plan, change nothing
freshen --check # report outdated items, change nothing (exit 2 if updates are pending)
freshen --check --jobs 8 # query up to eight steps at the same time
freshen --check --check-timeout 30 # enforce the 30 second performance budget
freshen --json # print the report as JSON (before/after versions per step)
freshen --markdown # print the report as Markdown
freshen --list-steps # show every step, its detection and skip reason
freshen --only brew,uv --skip brew-casks # select steps
freshen --snapshot-retention 5 # keep only the five newest snapshots
freshen --step-timeout 600 --timeout 3600 # stop hung steps or a long run
freshen --skip-metered-check # run even on a phone hotspot
freshen --skip-self-update # do not check whether freshen itself has an update available
freshen --min-free-disk-gib 5 --battery-threshold 30 # custom preflight thresholds
freshen --package-manager-wait 0 # abort instead of waiting for another package manager
freshen --install-macos-updates # install the macOS system updates (macOS only)| Variable | Default | Meaning |
|---|---|---|
QUIT_TIMEOUT |
20 |
Seconds to wait for an app to quit |
UPDATE_TIMEOUT |
60 |
Seconds to wait for an app that is updating itself to finish its update |
FRESHEN_SKIP_PREFLIGHT |
unset | Set to 1 to disable every preflight and package-manager check |
FRESHEN_SKIP_UPDATE_CHECK |
unset | Set to 1 to skip the self-update check that asks whether a newer version of freshen is available |
FRESHEN_LOCK_DIR |
platform state directory | Override where the single-run lock file lives |
NO_COLOR |
unset | Set to any non-empty value to disable ANSI colour in the spinner and other styled output (see https://no-color.org/) |
--yes and --force-kill replace the old ASSUME_YES/FORCE_KILL environment variables.
The network preflight and every update step use the same environment, so one configuration covers the whole run:
| Variable | Meaning |
|---|---|
HTTPS_PROXY / https_proxy |
Proxy for the HTTPS preflight. Takes precedence over HTTP_PROXY. |
HTTP_PROXY / http_proxy |
Fallback proxy when HTTPS_PROXY is unset. |
NO_PROXY / no_proxy |
Comma- or space-separated hosts, domains (.example.com), wildcards (*.example.com) and optional :port values that bypass the proxy. * disables proxying. |
SSL_CERT_FILE, SSL_CERT_DIR |
Custom CA file or OpenSSL-style directory trusted by the preflight and by tools that use the platform TLS stack. |
CURL_CA_BUNDLE, REQUESTS_CA_BUNDLE, NIX_SSL_CERT_FILE, NODE_EXTRA_CA_CERTS |
Additional CA bundles trusted by the preflight. |
The preflight opens a CONNECT tunnel through an http:// or https://
proxy and validates the target's TLS certificate; credentials in the proxy URL
are sent as Proxy-Authorization. A configured CA bundle that cannot be read
or parsed fails the network check instead of being ignored. Without a proxy,
or when NO_PROXY matches the target, the check connects directly.
Every step inherits the process environment. freshen never clears it: it only
adds the variables a tool needs (for example HOMEBREW_NO_AUTO_UPDATE) and
removes the few it must override, so brew, uv, mise, docker, colima,
orbstack, rdctl, podman and the curl/git processes they start see the
same proxy and certificate variables. Export them in your shell or service manager before running
freshen.
The commands whose output freshen parses are the one exception: they run with
LC_ALL=C and LANG=C so that a translated table cannot break a parser (see
Details worth knowing).
freshen collects no telemetry and sends no data about you or your machine to anyone. The only things that use the network are:
- the tools freshen runs on your behalf —
brew,uv,mise,docker,wingetand the rest contact their own package registries, and - the optional self-update check: once per run freshen asks
brew outdated --formula freshenwhether a newer version of freshen is available and prints a hint when there is one. The check is best effort and never blocks the run.
Disable the self-update check with --skip-self-update or with
FRESHEN_SKIP_UPDATE_CHECK=1:
freshen --skip-self-update
FRESHEN_SKIP_UPDATE_CHECK=1 freshenThe preflight check and every update step honour HTTP_PROXY,
HTTPS_PROXY, NO_PROXY and custom CA bundles — see
Proxies and custom certificates.
freshen reads an optional TOML file from ~/.config/freshen/config.toml
(macOS, Linux) or %APPDATA%\freshen\config.toml (Windows). Every key is
optional, and a key that is wrong is refused with an error that points at the
offending line:
# ~/.config/freshen/config.toml
[preflight]
network = false
min_free_disk_gib = 5
[run]
jobs = 8
[steps]
brew-casks = false
[exclude]
casks = ["dropbox"]
[apps]
never_quit = ["com.docker"]The [steps] section enables or disables single steps, the [include] and
[exclude] sections choose the casks, packages, containers and compose
projects a run may touch, and the [apps] section names the applications that
are never quit (never_quit) or always quit without asking (always_quit).
The NEVER_QUIT and ALWAYS_QUIT environment variables hold the same app
lists.
A flag given on the command line wins over the same key in the file, and the
file wins over the built-in default. freshen --config /path/to/config.toml
reads a different file. The full schema is documented in
docs/config.md.
The exit codes are part of the command-line contract and are stable across releases:
| Code | Meaning |
|---|---|
0 |
Success: every step that ran completed, or --check found no updates |
1 |
A step failed or timed out; also used for startup errors (invalid arguments, a held lock, an unsupported platform) |
2 |
--check found updates pending |
3 |
A preflight check or the other-package-manager check failed, so no step ran |
130 |
The run was interrupted by SIGINT or SIGTERM |
--help prints the same table. Scripts can rely on these values, for example freshen --check || [ "$?" -eq 2 ] to detect pending updates.
The zsh implementation and its deprecated POSIX sh compatibility wrapper have been removed now that the Rust port reached parity, and freshen is the implementation. Existing aliases and scripts should call freshen directly; install it with cargo install --path crates/freshen, nix run github:yildirimarda/freshen#freshen (the flake lives in flake.nix), brew install yildirimarda/homebrew-tap/freshen (the formula lives in Formula/freshen.rb and is published to the homebrew-tap tap on the first release) or use a release binary.
| Old | New |
|---|---|
./update-all.sh |
freshen |
ASSUME_YES=1 ./update-all.sh |
freshen --yes |
FORCE_KILL=1 ./update-all.sh |
freshen --force-kill |
QUIT_TIMEOUT=40 ./update-all.sh |
QUIT_TIMEOUT=40 freshen |
alias update-all=.../update-all.sh |
alias update-all=freshen |
- Run it while you are at the machine: it closes and reopens GUI apps.
--greedyis only used for the casks that need it. Casks withauto_updates trueorversion :latestare the ones Homebrew hides without it;--checknames the reason next to the cask. Casks withversion :lateststill show up as outdated every time — that is Homebrew behaviour, not a bug here.- Global npm packages do not follow a Node upgrade. List them in
~/.default-npm-packagesand mise reinstalls them for every new Node version.
The project is plan-driven: see PLAN.md for what exists and what is next, CONTRIBUTING.md for how to contribute, and AGENTS.md if you use an autonomous coding agent (agentloop).
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features # Rust workspace tests
bash tests/run-tests.sh # repository-level checksThe Rust binary accepts the same options on macOS, Linux and Windows:
cargo run -p freshen -- --dry-run # detect, change nothing
cargo run -p freshen -- --check # report outdated items, exit 2 when pending
cargo run -p freshen -- --check --jobs 8 # query up to eight steps at the same time
cargo run -p freshen -- --json # machine-readable report with version changes
cargo run -p freshen -- --markdown # Markdown report with version changes
cargo run -p freshen -- --list-steps # detect every step and explain skips
cargo run -p freshen -- --only brew,uv --skip casks # select steps
cargo run -p freshen -- --yes --force-kill # no prompts, kill stubborn apps
cargo run -p freshen -- --cleanup # opt in to destructive cleanup
cargo run -p freshen -- --step-timeout 600 --timeout 3600 # bound each step and the whole run
cargo run -p freshen -- --skip-network-check # bypass one preflight check
cargo run -p freshen -- --package-manager-wait 0 # do not wait for another package managerMIT — see LICENSE.