Apple has a very good, proprietary text recognition API. Evan Hahn wrote and shared a little swift script to use it on the command line.
Result:

This is very useful, to OCR an image fast on the command line and – even better – combine it with other commands or include it in other scripts.
But: His post doesn’t contain a clear installation guide. If adding user-installed command-line programs on a Mac is not your daily business, these steps might help: