Simple mode using brew bundle
We can list all taps, formulae and casks that were added by the user on stdout:
brew bundle dump --file -
Or we can do it manually, without using brew bundle.
Listing all brew taps
brew tap
Listing all brew formulae installed on request
This ignores any formulae that were added automatically as dependencies, but unlike brew leaves will still show any packages that are dependencies if you installed them manually as well, and avoids listing 'orphaned' packages:
brew info --json=v2 --installed \
| jq -r '.formulae[]|select(any(.installed[]; .installed_on_request)).full_name'
Listing all brew casks installed
At the time of writing (2022-03-20) brew doesn't keep track of which casks were installed on request, but few if any casks are dependencies for other casks/formulae, so we can simply list them all:
brew list --cask -l1
brew infois more correct – Azerum Feb 09 '24 at 01:02brew infodoesn't give any info on this. @orlp's answer,brew bundle dump --file -is the best as it includes things you installed manually even if they are no longer leaves, in addition to taps and casks you installed. I wrote up a whole analysis in my answer on StackOverflow. It's very easy to create an alias so you don't have to remember that long command. – Inigo Feb 09 '24 at 02:15