shfmt 3.15.0
by Daniel Martí
Format shell programs.
- Open source
- Windows
- Updated Dec 1, 2026
Official version from Daniel MartíDownloaded from the publisher’s site · Official website
- No download manager
- No bundled offers
- 0Views
- 0Downloads
- 0Likes
- Software Rank#23in System utilities
About shfmt
A shell parser, formatter, and interpreter. Supports [POSIX Shell], [Bash], [Zsh], and [mksh]. Requires Go 1.26 or later.
To parse shell scripts into a syntax tree, inspect them, and format them like shfmt does, see the syntax package.
For one-call helpers, see the shell package: split a command line into arguments and quote them back, expand $VAR and ~ in strings, globbing with , pattern matching, etc.
To run shell scripts without a system shell, see the shell interpreter section.
shfmt formats shell programs. See canonical.sh for a quick look at its default style. For example:
What’s new in 3.15.0
Some of these interpreter fixes may break existing scripts run with interp or gosh, as they now behave like Bash:
- The last command of a pipeline runs in a subshell, so cmd | read x no longer sets x unless the lastpipe option is set.
- Unquoted backslashes are removed from assignment values, redirection targets, case words, and here-strings, as they already were from command arguments. For example, x=C:\dir now assigns C:dir. Quote Windows paths, as in x='C:\dir', or use forward slashes.
- cmd/shfmt
- Add -bl, --block-next-line and block_next_line to place {, then, and do on their own lines - #721
- Support a fallback EditorConfig file at $XDG_CONFIG_HOME/shfmt/editorconfig, and accept case_indent and language_dialect as properties - #1402
- syntax
- Add BlockNextLine, deprecating FunctionNextLine - #721
- Add Redirect.ClosePos, and end heredocs at EOF like Bash, dash, and Zsh - #1428
- Support prefix assignments on declaration builtins via DeclClause.Assigns - #1327
- Keep optional case pattern parentheses if all items use them, via CaseItem.Lparen - #1194
- Follow Bash's algorithm in SplitBraces, and track positions via BraceExp.Lbrace and BraceExp.Rbrace - #1435
- Apply BinaryNextLine to binary test and arithmetic expressions - #813
- Keep then and do on their own line after multi-line conditions - #1210
- Keep trailing control-flow commands like main "$@"; exit $? on the same line - #564, #679
- Don't escape newlines within arithmetic commands and expansions - #1169
- Fix several bugs with comments, such as within [[ ]] or after escaped newlines - #619, #844, #1290, #1447, #1449
- Fix several bugs with heredocs, such as within substitutions or with quoted delimiters - #1131, #1282, #1446
- Fix several bugs with indentation, spacing, and semicolons - #811, #953, #1015, #1148, #1445, #1457
- Allow function and command names like a[i] - #1013
- Reject [[, select, and function with LangPOSIX - #1092
- Fix panics in StmtsSeq, InteractiveSeq, Walk, and with heredocs in backquotes, and limit nesting to 10000 levels to avoid stack overflows - #1448, #1458, #1459
- Zsh: add TryClause, RepeatClause, CallArithm, WordIter.Names, FuncDecl.Args, and ParamExp.Subscripts - #1211, #1294, #1297, #1335, #1361, #1438
- Zsh: support alternate loop forms, blocks like {echo foo}, glob groups in case patterns, and subscripts as words - #1203, #1233, #1295, #1342, #1441
- syntax/typedjson
- Add a JSON Schema for the format, also published as a CUE module - #967
- shell
- Add Split to split a command line into words without expanding them, and Join to quote words back into one
- Add Match to match a string against a pattern like case and [[ ]] do
- Add Glob to expand patterns over an fs.FS like Bash, with ** and brace expansion
- interp
- Add Runner.Wait
Specifications
- Name
- shfmt
- Version
- 3.15.0
- Released
- December 1, 2026
- Publisher
- Daniel Martí
- Platform
- Windows
- Price
- Open source
- Category
- System utilities
- On FamousWhy since
- December 2026
- Download from
- The publisher’s site
in System utilities for Windows
out of 414 programsHow the score is made
Famous Software Rank compares shfmt with every program on FamousWhy, from 0 to 100. Most of it comes from visitors: downloads, visits, likes, followers and boosts. It is recalculated every night. How Famous Software Rank works
- Bronze0–19
- Silver20–39
- Gold40–59
- Platinum60–79
- Diamond80–100
Alternatives to shfmt
-
37SilverAI Account Manager 0.4.1
Desktop tool for managing AI service accounts and usage.
-
17BronzeArq 7.53.0.0
A backup software for your Mac or Windows PC.
-
17BronzeAdvanced Dirt Removal 2.1.1
OFX plugin that removes dirt and dust from film scans, using the neighbouring frames.
-
17BronzeAIDA64 Extreme 8.50
An industry-leading system information tool.
-
17BronzeAjax Desktop 5.61
Desktop app to rule your space.
Get more downloads for shfmt
Free badges, a live rank widget and share links, for the publisher and for everyone who likes the program. Each one links back here, and every visitor it brings counts towards the Famous Software Rank.
Show the live Famous Software Rank
- 👀More exposureEvery visitor the widget sends to your FamousWhy page raises the Famous Software Rank and moves the program up the category lists and the top 10.
- ⬇️More downloads and installsA higher place puts the program in front of more people who came to install something, every day.
- 👥Your visitors bring new usersFans who click the widget can like and boost the program, and every boost lifts it in front of new people.
Share shfmt
Post the page on your social accounts or in your newsletter. Visitors who arrive through these links count towards the Famous Software Rank too.
Questions about shfmt
Is shfmt free?
Yes. shfmt is open source and free to use.
Is it safe to download shfmt?
You get the official version released by Daniel Martí. FamousWhy doesn’t repackage it or add download managers, toolbars or other offers.
What is the latest version of shfmt?
The latest version we know of is 3.15.0, released on December 1, 2026.