Homebrew command-line to display a formula's homepage
The homepage URL is a part of the output of brew info FORMULA, so you can run:

brew info FORMULA | grep -E '^https?:'


to extract just the link to the homepage. This also allows to run:

open -a Firefox.app "$(brew info FORMULA | grep -E '^https?:')"


to open the link in Firefox.app.

The respective command-lines for Homebrew Cask are:

brew cask info CASK | grep -E '^https?:'


and

open -a Firefox.app "$(brew cask info CASK | grep -E '^https?:')"