Homebrew Bundle
Homebrew Bundle is a powerful tool designed to manage non-Ruby dependencies seamlessly from sources like Homebrew, Homebrew Cask, the Mac App Store, Whalebrew, and Visual Studio Code. Its primary function is to consolidate various installation methods into a unified command, making the setup of development environments incredibly straightforward.
Requirements
To get started with Homebrew Bundle, users must have Homebrew installed on either macOS or Linux. While Homebrew Cask, mas-cli, Whalebrew, and Visual Studio Code are optional, they enable the installation of applications from their respective repositories:
- Homebrew Cask: For Mac applications.
- mas-cli: For apps from the Mac App Store.
- Whalebrew: For Whalebrew images.
- Visual Studio Code: To install extensions for VS Code.
Installation
Homebrew Bundle requires no initial setup—simply run brew bundle
for the first time, and it installs itself automatically.
Usage
Users can learn how to apply Homebrew Bundle by examining the brew bundle section of the brew generate-man-completions output or by using brew bundle --help
in the terminal. The key to using Homebrew Bundle effectively is the Brewfile
. This file details all of the required installations, and here’s a snippet example:
# Specify sources
tap "homebrew/cask"
tap "user/tap-repo", "https://[email protected]/user/homebrew-tap-repo.git"
# Set cask arguments
cask_args appdir: "~/Applications", require_sha: true
# Homebrew installations
brew "imagemagick"
brew "[email protected]", restart_service: true, link: true
# Homebrew Cask installations
cask "google-chrome"
cask "firefox", args: { appdir: "~/my-apps/Applications" }
# Mac App Store installations
mas "1Password", id: 443_987_910
# Whalebrew installations
whalebrew "whalebrew/wget"
# Visual Studio Code installations
vscode "GitHub.codespaces"
Versions and Lockfiles
Homebrew operates as a rolling release, meaning it doesn't support the installation of older software versions. For projects needing specific versions, integrating Whalebrew entries in the Brewfile
helps install Docker containers tailored for consistent environments.
After executing a successful brew bundle
command, a Brewfile.lock.json
file is generated. This file logs the environment setup, aiding in troubleshooting should future executions encounter issues. Users should note that because this file might contain system-specific data, it’s not recommended to commit it to version control in repositories used by multiple people. To prevent its creation, one can export the environment variable HOMEBREW_BUNDLE_NO_LOCK=1
or use the command-line option brew bundle --no-lock
.
Extending Functionality
Homebrew Bundle welcomes contributions to enhance its support for additional installers, provided they meet specific criteria: such installers should automate software installation, verify existing installations, export data into a Brewfile
format, and avoid needing sudo
access. Importantly, they should enjoy broad usage across the larger community.
Testing
Developers can test Homebrew Bundle using the command bundle install && bundle exec rspec
and check syntax with brew style homebrew/bundle
.
Copyright
The Homebrew Bundle project is maintained by the Homebrew maintainers and Andrew Nesbitt. Users interested in further details on permissions should refer to the LICENSE.
Homebrew Bundle simplifies package management by integrating diverse package sources, creating an efficient workflow for developers setting up or maintaining a Mac or Linux environment.