How to query a particular field of brew cask/ formula info? Homebrew version on my Mac:
Homebrew 2.5.0-84-g9e697bd
Take github (Cask for GitHub Desktop) for example, this is the cask file located in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/github.rb:
cask &quot;github&quot; do
  version &quot;2.5.5-f57dc10d&quot;
  sha256 &quot;fe39c280c746b66d13dbcc5acfeb946f77b680954ecda2bf29a560a98a9d2638&quot;

  # githubusercontent.com/ was verified as official when first introduced to the cask
  url &quot;https://desktop.githubusercontent.com/releases/#{version}/GitHubDesktop.zip&quot;
  appcast &quot;https://github.com/desktop/desktop/releases.atom&quot;
  name &quot;GitHub Desktop&quot;
  desc &quot;Desktop client for GitHub repositories&quot;
  homepage &quot;https://desktop.github.com/&quot;

  auto_updates true

  app &quot;GitHub Desktop.app&quot;
  binary &quot;#{appdir}/GitHub Desktop.app/Contents/Resources/app/static/github.sh&quot;, target: &quot;github&quot;

  zap trash: [
    &quot;~/Library/Application Support/GitHub Desktop&quot;,
    &quot;~/Library/Application Support/com.github.GitHubClient&quot;,
    &quot;~/Library/Application Support/com.github.GitHubClient.ShipIt&quot;,
    &quot;~/Library/Application Support/ShipIt_stderr.log&quot;,
    &quot;~/Library/Application Support/ShipIt_stdout.log&quot;,
    &quot;~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.github.GitHubClient.sfl*&quot;,
    &quot;~/Library/Caches/com.github.GitHubClient&quot;,
    &quot;~/Library/Caches/com.github.GitHubClient.ShipIt&quot;,
    &quot;~/Library/Preferences/com.github.GitHubClient.helper.plist&quot;,
    &quot;~/Library/Preferences/com.github.GitHubClient.plist&quot;,
    &quot;~/Library/Preferences/ByHost/com.github.GitHubClient.ShipIt.*.plist&quot;,
    &quot;~/Library/Logs/GitHub Desktop&quot;,
  ],
      rmdir: &quot;~/.config/git&quot;
end

The Cask file has a desc field, and it's value is Desktop client for GitHub repositories.
However, when I do brew search --desc github or brew search --cask --desc github, I only get github: GitHub Desktop, the desc field isn't included.
Sometimes the desc field provides valuable information about a cask. So I wonder if there's a way to make desc included when doing brew search --desc for casks? Thanks!
https://docs.brew.sh/Manpage#cask-command-options-cask
brew cask info github

should work.
--desc is not listed as a valid option for cask.

To specifically check a field in the JSON file /api/cask/github.json (JSON API), use the info command with --json flag and use jq to get the values of a particular field.
While you may find a better way to do it by reading the manual, here's what will work, at least.
brew info --json=v1 github | jq &quot;map(.|.desc)&quot;


https://stedolan.github.io/jq/manual/#Basicfilters
https://docs.brew.sh/Querying-Brew#brew-info---json