Homebrew

Although not specifically a Keyboard Maestro question it is related so I thought I would ask given the deep knowledge that exists on the forum.

As a result of Keyboard Maestro I have discovered Homebrew and have used it to install all of the CLI Tools I use in my Keyboard Maestro macros.

I have recently learnt that Homebrew has both formulae (CLI Tools) and casks (i.e., GIU applications) and that many applications have both DMG file installation options (the more common approach) as well as Homebrew installation options.

I would appreciate comments / thoughts on the pros / cons of DMG installations versus Homebrew installations given most -- possibly all -- of the applications I use have both options.

While I am new to Homebrew I am thinking -- and want to make sure I am correct -- that Homebrew may be preferred as all its applications can be updated with a simple terminal comments ( actually have this scheduled on Keyboard Maestro), its -zap command supposedly (I have never tried) removes all files, etc.

Would appreciate input and thoughts from those who are knowledgeable on this.

Thank you.

This really is a question about preferences. I prefer the command line and hence I prefer HomeBrew.

I think you meant Homebrew. If Homebrew has a cask then I prefer to use that instead of a disk image (DMG).

It is possible to use the command line to install from a disk image.

No way would I be doing that. Just use brew to upgrade on some schedule.

The downside of using homebrew is that it can't know anything about an update, for updates that might be something other than a simple "older to newer" step. As a real-world example, someone (not us!) wrote a homebrew formula for Moom—to both install it and to update it.

Great, except our app is a paid app, and it has an annual update plan you need to buy after we release a paid update more than 12 months after your particular purchase date. Moom knows all the logic for this work—it knows when you last bought, so it can smartly show you a dialog that says "Hey, if you upgrade, you'll have a demo app and not a real app until you buy an annual update plan." Or if you're within the twelve months, it just updates for you, because it's a free update.

But Homebrew just looks at the server's version, sees that it's newer than your version, and installs it.

The end result, for me in this example, is I had about 100+ really pissed-off users who wanted to know why we replaced their paid app with a demo app. It took a bit of digging to figure out what was going on.

I am a homebrew user myself, and I love all that it can do for me. Just understand that if you use it to update all your apps, including those that have built-in updaters, you may be bypassing a bunch of logic built into the in-app updater. So don't automatically blame the developer if something goes wrong after a homebrew update.

-rob.

1 Like

Appreciate the response, can you please explain why you prefer the command line?

Correct, typo fixed!

Appreciated, will take a close look in the morning!

I should have been clearer.

I use brew update and brew upgrade on the 15th and 30th of each month.

I was thinking that one of the benefits of Homebrew is that when removing an application supposedly -- I have not tested it -- that uninstall combined with the -zap flag will remove all related files and leave no remnants. Is this correct?

Rob, as always, appreciate the insight.

One follow up, the situation with Moom -- which I use everyday and think it is fantastic -- is that Moom does not publish a Homebrew installer so in theory this issue should not arise (as I would be forced to install via DMG). Is this not correct (as my Homebrew search would not produce a Moom published cask).

In the case where a the developer provides a cask is it a bad assumption to conclude that:

  1. The upgrade logic (or other such logic) would be included in the cask and that the brew upgrade command would work?

  2. Would it not be possible to check and get the correct answer / result (even for Moom) by checking the upgrade via the app itself as opposed to or in addition to the brew upgrade command (i.e., Moom → Check for Updates)?

The two main draws for me (where the developer publishes Homebrew casks are):

  1. One step update of all apps (assuming my assumptions are correct); and

  2. On deletion of an app, all remnants are removed (assuming my assumption about the -zap flag is correct).

  3. Are there others that I am missing?

Thanks.

I do a lot of work where a GUI is not available. Once you learn how to use a command line then it's a very easy step to remotely work on servers.

The command line is very powerful. Essentially all the commands are simple but you can take the output from one command as input to another. You can also use pretty much any language you want. HomeBrew's core language is ruby.

And vim, the command line editor with a very challenging interface. Vim (Vi IMproved) is a highly efficient, keyboard-driven text editor based on the original Unix editor vi.

I don't know all the commands for vi, you only need about 8. It's very capable. I use it every day and I know I can open text files with gigabytes upon gigabytes of data and it works.

As far as macOS and GUI apps. I bought Keyboard Maestro!

I avoid using the mouse or the track pad when I can use the keyboard. For example, I have my machine(s) setup so I can tab through all controls on a window, I have all function keys working like they do on a PC. I learn every short cut I can.

I use Keyboard Maestro to plug the gaps.

Based on what Rob said and now seeing the context is HomeBrew installing Keyboard-Maestro I'd use the disk image (DMG). Unless Peter N Lewis created it.

Again, I'd just upgrade. I can't see any benefit in dropping your config files and so on twice a month.

Often, the formulae for GUI applications are not up to date. You don’t see release notes or notices from the developer while updating/upgrading.

We don't, but someone did:

And that's the problem I was pointing out: It can't check what we check.

If the app developer publishes the cask, then yes, I would assume it's fine. I was specifically talking about the fact that anyone can write a cask for any app, and have it accessible via homebrew. If the cask isn't from the developer of the app, then I would assume it's just blindly updating based on version number comparisons.

But the key fact is that don't assume because there is a cask that it came from the app developer; it could have come from anywhere.

-rob.

Makes a lot of sense. Thank you for the explanation.

One point of clarification.

I am not asking about using Homebrew to install Keyboard Maestro over its DMG file.

I am asking about using Homebrew to install all applications (where a Homebrew option exists) when available over the corresponding DMG file.

One point of clarification.

I am not talking about dropping my config file twice monthly when upgrading. I agree, I just upgrade!

I am asking / talking about when I delete an application (i.e., no longer want or need it), whether the -zap flag effectively removes all remnants.

Thank you!

Appreciated.

Appears that the best practice is as follows:

  1. Use Homebrew for CLI Tools; and

  2. Use DMG file for GUI applications.

Is this correct?

Yikes!!! Not good!!

Agreed and understood.

Is there a reliable way of determining whether a cask (or perhaps even a formulae) comes from a developer?

Most developers that I've run into that support homebrew call it out as an installation method on their app's web page. Short of that, though, if I found a cask and I wasn't sure of its origins, I'd probably contact the developer.

-rob.

Rob, as always, appreciated.

I think that it is too much work to consistently be checking with developers.

I think the best and safest approach is:

  1. Use Homebrew for CLI Tools; and
  2. Use DMG file for GUI applications.

Is this correct or does anyone suggest or think otherwise?

Thanks for all the help.

Correct is whatever you feel is best for your setup, but personally, that's exactly how I do it.

-rob.

Appreciate the confirmation that this is what you do!

Correct is indeed what you note (i.e., whatever is best for your setup). I should have been more precise and asked "What is accepted best practice".

  1. Update from the App Store if that's where you got the original -- should be automatic
  2. Update from the developer's website -- should be automatic or at most a "Check for Updates" menu item selection
  3. Update via Homebrew if that's where you got the original

Initial installs are more likely:

  1. Install from the developer's website (usually the best deal), if they have a Homebrew link then use that
  2. Install from the App Store
  3. Install from Homebrew
  4. Install from git repo or similar

"Accepted best practice" should start with "Can you trust the source?", and Homebrew is only slightly above "random web page" on that score...

Appreciated, consistent with previous posts and makes perfect sense!

Too bad, I was hoping to go all Homebrew but clearly not the best idea!

Rob: I would like say (somewhat publicly, and unsolicited) Moom is fantastic. I’ve used it for some years. I currently have Ver. 4.

I recently, for the first time, purchased a second monitor. Now I think Moom is even fantasticier. :grin:

Combining Keyboard Maestro and Moom has allowed me to become a window management guru.

Thanks

2 Likes

Thanks! I'll pass your kind words on to Peter, Many Tricks' founder and programmer extraordinaire. We're quite happy with how version 4 turned out.

-rob.

2 Likes