Skip to content

Instantly share code, notes, and snippets.

@source-c
Created September 18, 2022 16:14
Show Gist options
  • Save source-c/d02773232163b8592fb71539dedce6aa to your computer and use it in GitHub Desktop.
Save source-c/d02773232163b8592fb71539dedce6aa to your computer and use it in GitHub Desktop.
List packages locally installed with brew (on MacOS) in JSON format
#!/usr/bin/env bash
JQ=$(which jq)
[[ -n ${JQ} ]] || exit 1
[[ -x ${JQ} ]] || exit 2
brew info --json=v1 --installed | jq "map({name: .name, desc: .desc, version: .installed[].version})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment