Firefox and Chrome, and most major browsers can indeed take screenshots from the browser _console_, but taking screenshots from the command line is a separate, interesting concept.
google-chrome --headless --screenshot http://site.com
It's a one line command.
My version is less configurable but wraps the screenshots in some beautiful mockups :)
screenshoteer --url https://news.ycombinator.com/item?id=18598672 --el ".fatitem"
Also, you have included a .DS_Store file in your repository.
Command line options: https://a9t9.com/kantu/docs#cmd
(... and it works in Chrome and Firefox.)
Funnily enough, I called mine: Screenshotr