brewgen is the hosted script repo for Tanaab based Brewfile generation. It inspects the current
Homebrew state and writes a Brewfile, with options to limit package types, exclude packages, and
choose the output path. Under the hood it uses brew bundle dump and assembles the selected
sections into one output file.
Runtime support: Bash on macOS.
curl -fsSL https://brewgen.tanaab.sh/brewgen.sh | bashbrewgen is designed around the hosted raw script at https://brewgen.tanaab.sh/brewgen.sh.
- The supported runtime is Bash on macOS.
- The hosted URL serves the generated
dist/brewgen.shentrypoint used for release-shaped validation and Netlify publishing.
By default, brewgen.sh writes a Brewfile in the current directory from the local Homebrew
state. The default package types are tap, cask, and brew, and the script will refuse to
overwrite an existing file unless you pass --force.
brewgen.sh
brewgen.sh --help
brewgen.sh --version
brewgen.sh --brewfile ./Brewfile.work --force
brewgen.sh --package-type tap --package-type brew
brewgen.sh --exclude codex --exclude visual-studio-code
TANAAB_DEBUG=1 brewgen.sh --package-type caskIf you are working from a local checkout instead of a hosted URL, replace brewgen.sh with
./brewgen.sh.
brewgen.sh expects a working Homebrew installation and brew bundle support on the current
machine.
The examples/ directory contains Leia-backed usage
scenarios that run on every pull request in CI and are intended for runner validation rather than
local execution.
# write the default Brewfile in the current directory
brewgen.sh
# write to a different file and allow overwrite
brewgen.sh --brewfile ./Brewfile.work --force
# generate only taps and formulae
brewgen.sh --package-type tap --package-type brew
# exclude specific packages from the final output
brewgen.sh --exclude codex --exclude visual-studio-code--brewfile <path>writes the generated Brewfile to the chosen path. Parent directories are created when needed.--package-type <type>limits generation to one or more package types. Supported values aretap,breworformula,cask,mas,vscode,go,cargo,uv, andflatpak. Repeat the flag to include multiple sections.--exclude <name>removes matching package names from the final output. Repeat it to exclude multiple packages. Matching is by exact package name in the generated Brewfile entries.--forceallows overwriting an existing output file.--debugturns on debug logging and enables Homebrew debug mode for the current run.--versionand--helpprint metadata and usage.
CLI options override environment variables, and environment variables override built-in defaults.
TANAAB_BREWFILEsets the output Brewfile path.TANAAB_PACKAGE_TYPESsets a comma-separated default list of package types.TANAAB_EXCLUDEsets a comma-separated default list of package names to exclude.TANAAB_FORCEenables overwrite behavior when set to a truthy value.TANAAB_DEBUGenables debug logging when set to a truthy value.
If you want a reusable local command instead of piping the hosted script every time, install it
into a directory that is already in your PATH or one you manage yourself.
mkdir -p "$HOME/.local/bin"
curl -fsSL https://brewgen.tanaab.sh/brewgen.sh -o "$HOME/.local/bin/brewgen"
chmod +x "$HOME/.local/bin/brewgen"
brewgen --help
brewgen --versionbrewgen uses Bun for repo-local tooling and treats dist/ as a tracked, Netlify-ready release
surface.
bun install
bun run lint
bun run buildThe examples run in CI with Leia against the prepared dist/ artifact.
Use the GitHub issue queue for bugs, regressions, or feature requests.
See CHANGELOG.md for release history and
GitHub releases for published artifacts.
@pirog
Made with contrib.rocks.