An open API service indexing awesome lists of open source software.

https://github.com/revett/hops

Manage Homebrew packages across machines using a single YAML file.
https://github.com/revett/hops

automation brewfile cli devtools dotfiles homebrew macos

Last synced: 4 months ago
JSON representation

Manage Homebrew packages across machines using a single YAML file.

Awesome Lists containing this project

README

          



# hops

Manage [Homebrew](https://brew.sh) packages across multiple machines with a single YAML file.

![hops-v0 3 1-demo](https://github.com/user-attachments/assets/253624a3-270a-4f17-b92f-825593b426f7)

## Why?

Managing Homebrew packages with `Brewfile` is great, until you're juggling multiple machines.
Hops replaces scattered, duplicated configurations with a single declarative YAML config.

- โœ… One `hops.yml` config for all machines
- ๐Ÿ“ฆ Generates a specific `Brewfile` for each machine
- ๐Ÿงน Prune unused floating packages
- โšก Installs, upgrades, and verifies with one command
- ๐Ÿ’ป Designed for dotfiles

```yaml
brewfile: /Users/snape/Brewfile
machines:
shared:
taps:
- homebrew/bundle
formulae:
- coreutils
casks:
- 1password
- raycast
- spotify
personal:
casks:
- adobe-creative-cloud
work:
casks:
- cursor
- loom
- slack
cursor:
- dbaeumer.vscode-eslint
- github.github-vscode-theme
```

## Install

### GitHub Release

```bash
# Download the latest release
# Visit โ†’ https://github.com/revett/hops/releases

# Extract binary from archive
tar -xzf hops_X.Y.Z_darwin_arm64.tar.gz

# Stop macOS' Gatekeeper from blocking the binary
xattr -c ./hops

# Move binary
sudo mv hops /usr/local/bin

# Verify install
hops -h
```

### Build from Source

```bash
# Clone repo locally
git clone https://github.com/revett/hops.git

# Build binary
cd hops
make build

# Move binary
sudo mv hops /usr/local/bin

# Verify install
hops -h
```

## Usage

Optionally set the `HOPS_CONFIG` environment variable within your terminal profile:

```bash
# Defaults to ~/hops.yml if not set
export HOPS_CONFIG=/path/to/hops.yml
```

Initialise the configuration file:

```bash
hops init
```

This will create a `hops.yml` with a set of example packages; update these with your desired set of
machines and packages. This config file is designed to sit in your dotfiles and sync across all your
machines.

Apply the configuration for a specific machine:

```bash
hops generate --machine work
hops apply --machine work
```

Hops will take care of:

- Creating a local `Brewfile` made up of the correct shared and machine specific packages
- Install any missing packages
- Update any outdated packages
- Remove any floating packages that are not outlined in the `Brewfile`

## Commands

```bash
# Initialize a new hops.yml configuration file with examples
hops init

# Generate a local Brewfile for a specific machine without installing anything
hops generate --machine work

# Generate Brewfile and apply changes via Homebrew commands (install, upgrade, cleanup)
hops apply --machine personal

# Format hops.yml (sort packages A-Z, order sections, 2-space indent)
hops format

# Add to .zshrc to remind every week to run apply command
hops reminder
```

## Examples

See [hops.yml](https://github.com/revett/dotfiles/blob/main/hops.yml) in
[revett/dotfiles](https://github.com/revett/dotfiles).

## FAQ

**Does it support Cursor extensions?**

Yes, as part of the [v4.5.0](https://brew.sh/2025/04/29/homebrew-4.5.0/) release of Homebrew on 29th
April 2025, the `brew bundle` command looks for VS Code variants, see
[#19545](https://github.com/Homebrew/brew/pull/19545).

## Project

### Releases

1. Ensure that version in `package.json` is bumped
1. `git tag -a vX.Y.Z -m "Release vX.Y.Z"`
1. `git push origin vX.Y.Z`
1. `make release VERSION=vX.Y.Z`
1. Create release in GitHub

### Local Development

See [CLAUDE.md](./CLAUDE.md).