Homebrew packages with description 11 August 2023

The package manager homebrew lets us print a list of installed packages along with a description of each package.

A StackExchange post hints to query the list of explicitly installed packages using the JSON processor jq. Dependent packages are explicitly excluded from that list.

brew info --json=v2 --installed \
    | jq -r '.formulae[]
        | select(any(.installed[]; .installed_on_request)).full_name'

Then, the meaning of each package is easily observed by extracting the package description. It is pretty printed as a table using columns:

brew info --json=v2 --installed \
    | jq -r '.formulae[]
        | select(any(.installed[]; .installed_on_request)) 
        | [.full_name, "#", .desc]
        | add' \
    | column -t -s "#"

For Casks, such a table can generated analogously. There seems to exist no record whether a Cask package was manually installed or as a dependent package. Hence, a full list of all Casks is shown:

brew info --json=v2 --installed --casks \
    | jq -r '.casks[] 
        | [.full_token, "#", .name[0], "#", .desc]
        | add' \
    | column -t -s "#"