Skip to content
🎂 Who was born today → RO · famouswhy.roEN
Follow

shfmt 3.15.0

by Daniel Martí

Format shell programs.

  • Open source
  • Windows
  • Updated Dec 1, 2026
Download 3.15.0

Official version from Daniel MartíDownloaded from the publisher’s site · Official website

  • No download manager
  • No bundled offers

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

This release brings the interpreter much closer to Bash and hardens it against untrusted scripts, so that it fails gracefully rather than crashing or exhausting memory.
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
#23
Bronze level

in System utilities for Windows

out of 414 programs
Like it here and boost it on the dial to push shfmt up the chart.
How 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

  1. Bronze0–19
  2. Silver20–39
  3. Gold40–59
  4. Platinum60–79
  5. Diamond80–100
  • Downloads0
    counts 20%
  • Visits0
    counts 10%
  • Likes0
    counts 10%
  • Followers0
    counts 10%
  • Boosts0 in 30 days
    counts 25%
  • Visits from widgets and shares0 in 90 days
    counts 10%
  • Editor ratingNot reviewed yet
    counts 5%
  • Up to dateDec 2026
    counts 5%
  • AwardNone yet
    counts 5%

Alternatives to shfmt

  • Desktop tool for managing AI service accounts and usage.

    Open source Windows CloudyWing updated Dec 4, 2026
    37Silver
  • Arq 7.53.0.0

    A backup software for your Mac or Windows PC.

    Paid Windows Haystack Software LLC updated Dec 4, 2026
    17Bronze
  • OFX plugin that removes dirt and dust from film scans, using the neighbouring frames.

    Open source Windows Fabio Color updated Dec 3, 2026
    17Bronze
  • An industry-leading system information tool.

    Free trial Windows FinalWire Ltd. updated Dec 4, 2026
    17Bronze
  • Desktop app to rule your space.

    Paid Windows Ajax Systems Inc. updated Dec 3, 2026
    17Bronze
All system utilities programs for Windows

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.
shfmt Famous Software Rank on FamousWhy
Shape
Size
Paste it in your site’s HTML, where you want the image to appear.

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.

All widgets and share cards · Why it helps your program

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.