zb reset command completely removes all zerobrew data directories and reinitializes a fresh installation.
Usage
Options
Skip the confirmation prompt and proceed with reset immediately. Use with caution.
Short form of
--yes.Description
The reset command performs a complete cleanup and reinitialization of zerobrew:- Removes all content from
ZEROBREW_ROOTdirectory (store, cache, metadata) - Removes all content from
ZEROBREW_PREFIXdirectory (symlinks, binaries) - Reinitializes the directory structure
- Leaves you with a clean installation ready for fresh package installs
If the directories don’t exist, the command will report “Nothing to reset” and exit successfully.
Permission Handling
The reset command intelligently handles permission issues:- First attempts to remove directory contents without elevated privileges
- If permission denied and running interactively, falls back to
sudo rm -rf - If permission denied in non-interactive mode, exits with an error
- Does not require sudo to recreate the directory structure after cleanup
Interactive Mode (Default)
By default, the command prompts for confirmation before proceeding:y and press Enter to proceed, or n (or anything else) to abort.
Non-Interactive Mode
For scripts or automation, use the--yes flag to skip the confirmation:
Examples
Reset with confirmation prompt:Output
During reset:Use Cases
Reset zerobrew when you need to:- Fix a corrupted installation
- Start completely fresh after testing
- Clear all packages and cached data
- Troubleshoot persistent issues
- Free up all disk space used by zerobrew
What Gets Removed
The reset command removes:- All installed packages
- Content-addressed store entries
- Formula cache and API cache
- Package metadata and lock files
- Binary symlinks in prefix directory
- Installation manifests
What Gets Preserved
The reset command does NOT modify:- Shell configuration files (e.g.,
.bashrc,.zshrc) - PATH modifications made during
zb init - User files outside zerobrew directories
Recovery
There is no built-in recovery mechanism for reset. If you need to preserve your package list:Related Commands
- zb init - Initialize zerobrew (automatically run by reset)
- zb gc - Remove unreferenced store entries without full reset
- zb uninstall - Remove specific packages
- zb bundle dump - Save package list to Brewfile