Skip to main content
Ellane learns the command line

Install some (Homebrew) packages


Done. I was held up briefly because there was no visual feedback when typing my password; got it on the second try.

It seems to have worked, as brew help is showing me a list of ways to get started. I'll be (wisely) leaving those alone until you help me learn what they're all about.

So the purpose of Homebrew is just to install hledger. How might we do that?

Homebrew's web site is amazing so we might as well double-check. Head over there and search for hledger using the box at the top. You should find yourself on the formulae page for the app.

We don't really need to know how Homebrew works. Just like we don't really know what's happening when we launch an installer and next, next, next. But, just briefly, it has what it calls 'formulae', which are just installation scripts. And sometimes you have to add a 'cask' (they really push this metaphor) so that you can access these formulae.

But in this case, the page tells us exactly what we need to do:

brew install hledger

Which is a familiar pattern by now: some command, brew, followed by some options. Let's keep reinforcing this with a quick trip to man brew, which tells us that the syntax for brew is:

brew command [--verbose|-v] [options] [formula]

Let's drop our command in below that.

brew command [--verbose|-v] [options] [formula] # man brew
brew install                           hledger  # our command

So that's:

All of this is just to get these patterns deeper in your brain. The more familiar they are the more comfortable you'll be.

hledger #

Assuming there were no errors -- and you should always read the last few lines of the installation output just to be sure -- you've now got hledger installed. Run it!


So when I ran it I thought two things:

  1. Oh that looks cool!
  2. It's flashing a cursor ... does it want me to run a command?

hledger's welcome/help screen

Homework #

Now that this is installed, see what you can do with it. I've played myself and it is pretty arcane! So don't worry if you don't get too far.

(You can't mess this up. If the worst happens, we just remove it and add it again.)