My Top 10 homebrew packages
My son Felix recently switched to a Mac and asked me about my Top 10 homebrew packages.
But what is homebrew?
The Missing Package Manager for macOS
Installing software (both Open Source and commercial) mostly becomes a single command-line invocation, like brew install jq
.
Command-Line Tools
My Top 10
#10: qsv
Ultra-fast CSV data-wrangling toolkit
CSV is a popular data format. Often I need to manipulate, extract or simply view a CSV file, and qsv
("quicksilver") makes it easy to process even very large files.
Example: FragDenStaat.de has published a list of some Resident Registration Offices in CSV format. The file has some problems (not in UTF-8 format, semicolon instead of comma, no headers), but we can use qsv
to fix all of that and then display the last 10 addresses:
$ curl --location --silent 'https://fragdenstaat.de/files/foi/6128/Anschriften_Meldebehrden.csv.csv?download' \
| iconv --from ISO-8859-1 --to UTF-8 \
| qsv input --delimiter ';' \
| qsv sort --select 3 --numeric --no-headers \
| qsv table \
| tail --lines 10
#9: jq
Lightweight and flexible command-line JSON processor
JSON has been invented for the web, but it became very popular as a general data exchange format; even for command-line tools.
Let's say we want to get some structured information about the jq
package in homebrew:
$ brew info jq --json
If we only want the description, we can use jq to extract just that field:
$ brew info jq --json | jq '.[].desc'
#8: gh
GitHub command-line tool
I work with GitHub a lot, and this tool lets me perform most of the daily tasks from the command-line, for example listing the pull requests for a repo:
$ gh pr list --repo suhlig/httpspell
#7: direnv
Load/unload environment variables based on $PWD
I organize most non-trivial projects in separate directories. All the project-specific environment variables can go into a .envrc
file, and when you enter the directory the variables in that file will be added to your current shell. Leaving the directory unloads them.
Example: I have multiple projects that connect to different MQTT brokers (using separate users and passwords). In each project directory, I have a .envrc
file that keeps the URL to the broker. cd
from one project to another activates the right environment variable for the project:
$ cat project-A/.envrc
export MQTT_URL=mqtts://alice:s3cret@mqtt.example.com/some-topic
$ cat project-B/.envrc
export MQTT_URL=mqtts://bob:geh3im@mqtt.example.com/other-topic
Now direnv will set the content of $MQTT_URL
to the respective value when changing directories:
$ cd project-A
$ cd ../project-B
#6: shellcheck
Static analysis and lint tool, for (ba)sh scripts
Shell scripting in bash
is full of footguns. I try to standardize on zsh
, which has way fewer quirks, but bash
is still the queen of compatibility. shellcheck
prevents the larger disasters from happening.
#5: shfmt
Autoformat shell script source code
Similar to shellcheck, this tool keeps me honest about style and formatting of shellscripts I write.
#4: pandoc
Swiss-army knife of markup format conversion
All text I write starts in Markdown format. The desired output format is generated using pandoc. It can convert from and to many formats; I most often use
- Markdown => HTML
- Markdown => PDF
- Microsoft Word => Markdown
Markdown to reveal.js slides is also great; I wrote all the slides of my Web Services lecture in Markdown and publish them as HTML.
#3: ripgrep
Search tool like grep and The Silver Searcher
This is one of the tools that convinced me that performance is a feature, even more so on the command-line. ripgrep
is so fast that I never hesitate trying to find a piece of code on my computer.
Example: Searching for the term ansible_managed
in 72 GiB of source code took less than three seconds:
$ rg ansible_managed ~/workspace
There is also ripgrep-all, which understands PDF and other formats.
#2: tmux
Terminal multiplexer
tmux
is probably best known for its capability to split a terminal window into separate panels, so that you get two independent "windows" to work in.
In this example, I have jekyll serve
running in the upper pane, and an interactive shell running in the lower pane, so that I can commit using git
while still seeing the output of jekyll
in the upper:
I also came to appreciate the fast change between different projects in separate terminal windows, jumping back to the recently used session with Ctrl-A, L
or to the previously active pane with Ctrl-A, p
.
#1: atuin
Improved shell history for zsh, bash, fish and nushell
Shell history is my #2 asset and productivity tool. All commands I execute, together with all arguments, pipelines, indirections, etc. are saved to a local SQLite database. This makes for a great searchable journal of commands. It is not uncommon for me to re-use a command from years ago that I found in my history.
Some random bits:
- My oldest history entry is from June 2020, but that was recorded at the time by zsh_histdb and later imported into
atuin
. - I don't use the
sync
featureatuin
provides, because I mostly work off the same computer. - I find
atuin
so precious that I became a (minor) sponsor for the project.
Honorable Mentions
bat
Clone of cat(1) with syntax highlighting and Git integration
Adds syntax highlighting, line numbers, etc. to files viewed in the terminal. I have it aliased as less
.
Compare:
fx
Terminal JSON viewer
As mentioned above, JSON has become a common output format of command-line tools. But the output of a tool can be overwhelming when trying to understand which keys to extract. This is where fx
shines: it provides an TUI where you can browse and search through the JSON, fold some parts, and also copy keys, values, and paths to them.
Example: I wanted to get the list of assets published for a particular Tasmota release. I used gh
to list the assets of the release, and then dive into the various JSON parts interactively:
$ gh release view 2023-12-12.r.e6515883f0ee5451931b6280ff847b117de5a231 \
--repo tasmota/install \
--json assets \
| fx
I only wish there was a way to copy a jq
-compatible expression to the clipboard.
helix
Post-modern modal text editor
Since I have been using computers I tried switching to vim
multiple times. The most recent attempt using Neovim felt pretty successful for a while, but ultimately failed because I became tired of configuring and managing the various plugins that I thought I needed.
Helix comes with batteries included - there is language-server support (syntax highlighting), a file browser, surround support, etc. It's been a few weeks since I started using it for real, and today was the first time I felt the need to configure something.
jo
JSON output from a shell
Creating JSON on the command-line can become ugly pretty quickly. The fact that strings need to be wrapped in double quotes makes you type really awkward strings, and it becomes worse once you start nesting or even using environment variables. jo
is a small tool that solves this problem elegantly:
$ jo -d . \
blink.interval_ms=50 \
blink.count=9 \
blink.color.r=0 \
blink.color.g=0 \
blink.color.b=255 \
value=$RANDOM \
| jq
macOS Applications
My Top 10
#10: vanilla €
Tool to hide menu bar icons
You can choose which icons of the menu bar are always visible, and which only after clicking the little <
symbol.
Expanded (same as without Vanilla):
Collapsed:
#9: stats
System monitor for the menu bar
Draws tiny graphs in the menu bar. I have battery, RAM, CPU and SSD enabled, but there are more. You can click the graphs to get many more details.
#8: drawio
Online diagram software
Good-enough software to draw boxes and lines. It can save as SVG and embed the source, so that you have to store just one file that is both visible in a web browser, and can still be edited natively (for an example, see this state transition diagram of my Rustomato project).
#7: bitwarden
Desktop password and login vault
I converted the whole family to store passwords in Bitwarden, and this formula installs the client.
#6: arq €
Multi-cloud backup application
I backup my workstation to an S3-compatible bucket, and ARQ encrypts everything before it leaves my computer. While this is commercial software, the vendor documents the storage layout and even provides an open-source command-line utility for restoring.
#5: espanso
Cross-platform Text Expander written in Rust
Manages my most-used snippets and allows me the enter e.g. my IBAN by just typing iban#
.
The key difference to the "Text Replacements" built into macOS are Dynamic Matches. One of my most often used replacements inserts the current timestamp in ISO 8601 format:
- trigger: ts#
replace: ""
vars:
- name: mydate
type: date
params:
format: "%Y-%m-%dT%H:%M:%S"
I only wish there was an iOS client.
#4: alt-tab
Enable Windows-like alt-tab
macOS does not make it very easy to cycle through all windows of all applications. Alt-tab fixes that.
#3: alfred €
Application launcher and productivity software
Can launch many more things than just applications. I use it most often to
- Find a word in the system dictionary,
- Access deeply nested preferences,
- Do a quick calculation,
all from one place.
The Powerpack is a paid upgrade, and I bought it for one critical feature: Clipboard history.
Stats are saying:
Since 26. Nov 2015, Alfred has been used 12.663 times. Average 4.1 times per day.
#2: divvy €
Application window manager focusing on simplicity
Window placement is one of these things where, for my taste, Apple does not provide enough. Divvy hits the right balance between customizability and simplicity. I use these arrangements:
#1: alacritty
GPU-accelerated terminal emulator
It's fast and has almost no features, which I like.
Honorable Mentions
moneymoney €
German banking and financial management software
Deals with all the horrible idiosyncrasies of German banks. Also understands PayPal. There is even an extension that shows your Amazon account.
cyberduck
Server and cloud storage browser
Native macOS Client for (S)FTP, WebDAV, S3, Google Cloud Storage, Windows Azure Blob Storage, Backblaze B2, Dropbox, Google Drive, Microsoft OneDrive, Nextcloud, ownCloud, Box, and some more.
In Cyberduck we trust.
Credits
Most of the screenshots in this article were created using termshot.