The question is quite old, but actually only this answer resolves the issue. However, it's more like a workaround. But there's one more solution available out-of-the-box in brew
:
brew bundle dump --file -
From docs:
brew bundle dump:
Write all installed casks/formulae/images/taps into a Brewfile in the
current directory.
and the flag:
--file
Read the Brewfile from this location.
Use --file=- to pipe to stdin/stdout.
As a result we get e.g.:
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "homebrew/services"
tap "jesseduffield/lazydocker"
tap "jesseduffield/lazygit"
brew "lazydocker"
brew "lazygit"
cask "font-sauce-code-pro-nerd-font"
If you e.g. need a pure list of formulae and casks, without taps, you can just run:
brew bundle dump --file - | grep '^brew\|^cask' | sed 's/.* "\(.*\)".*$/\1/'
and get:
lazydocker
lazygit
font-sauce-code-pro-nerd-font
P.S. If you actually save the output to the file (with brew bundle dump
or brew bundle dump --file PATH_TO_FILE
), you can easily install all the dependencies from it with brew bundle install
:
brew bundle [install]:
Install and upgrade (by default) all dependencies from the Brewfile.
You can specify the Brewfile location using --file or by setting the
HOMEBREW_BUNDLE_FILE environment variable.
brew graph
??? I getError: Unknown command: graph
. No such command. – iconoclastbrew graph
appears to be a package you can install for this github.com/martido/brew-graph, see also blog.jpalardy.com/posts/untangling-your-homebrew-dependencies – netweb