YKYH Picks
☰ Menu
CLI Open source 11,039 installs/mo Trending 1.86×

shfmt for Mac

Autoformat shell script source code

Quick answer: shfmt is a terminal emulator for macOS. Install it with brew install shfmt. It is distributed under the BSD-3-Clause licence. It has 11,039 Homebrew installs in the last 30 days.

What shfmt is

shfmt is a terminal emulator for macOS: autoformat shell script source code.

It is distributed as a Homebrew formula, which builds or pours a binary and puts it on your PATH. The project is open source and lives at https://github.com/mvdan/sh.

How to install shfmt

  1. Open Terminal (press ⌘ + Space and type “Terminal”).
  2. If Homebrew is not installed yet, run the installer below once.
  3. Run brew install shfmt.

Homebrew installer, if you need it:

Prefer a graphical installer? Download it from the official site. MacPicks never hosts or mirrors binaries — the Homebrew command always pulls from the vendor's own release.

Similar apps in Terminal & Shell

Closest apps in the same category, ordered by description similarity and install base. These are related tools, not confirmed substitutes; the comparison pages cover hand-picked head-to-head matchups.

Frequently asked questions

How do I install shfmt on Mac?

Run brew install shfmt in Terminal. This requires Homebrew; if you do not have it, install it first with the command below.

Is shfmt open source?

Yes — Homebrew distributes it under the BSD-3-Clause licence.

Does shfmt run on Apple silicon?

Homebrew publishes this formula for macOS. If upstream does not ship an Apple silicon build, Rosetta 2 handles the Intel binary.

How popular is shfmt?

It was installed 11,039 times in the last 30 days according to Homebrew analytics, ranking #182 in this catalogue.

What version of shfmt is current?

The latest packaged version is 3.14.1.