Command-line tool
shfmt
brew/shfmt
Checked 25 Oct 2026, 21:09 UTC · Listing refreshed from Homebrew, winget, npm, Scoop and cargo; npm packages checked against OSV.dev
Autoformat shell script source code shell bash format 格式化 formatter 美化 beautify
At a glance
- Type
- Command-line tool
- Install on
- Windows, macOS, Linux
- Last checked
- 25 Oct 2026, 21:09 UTC
Install it
Windows
winget install --id mvdan.shfmt -e scoop install shfmt
macOS
brew install shfmt
Linux
brew install shfmt
Print a formatted version of a shell script
shfmt path/to/file
List unformatted files
shfmt -l path/to/directory
Write the result to the file instead of printing it to the terminal
shfmt -w path/to/file
Related command-line tools
- bats
Bash Automated Testing System bats bash shell test unit - bash
Bourne-Again SHell, a UNIX command interpreter - dropbox-uploader
Bash script for interacting with Dropbox - shellcheck
Static analysis and lint tool, for (ba)sh scripts bash sh shell shellcheck developer-tools cli portable… - murex
Bash-like shell designed for greater command-line productivity and safer scripts - gum
Tool for glamorous shell scripts shell bash - format-udf
Bash script to format a block device to UDF - zsh
UNIX shell (command interpreter)
Listing text is written by the maker; AptLynx lists tools and does not vouch for them. Find another tool · Browse by topic · For agents