shfmt3.12.0
A shell parser, formatter and interpreter (POSIX/Bash/mksh).
v3.12.0
1.0 MBscanned clean
Verify your download
Select the file you downloaded to check it against the hash we published — the check runs in your browser, nothing is uploaded.
About
shfmt parses shell source into syntax trees, allowing developers to inspect scripts and rewrite them in a consistent format. It combines that formatter with an interpreter for POSIX Shell, Bash, Zsh, and mksh code. The result addresses the inconsistent layout and difficult static analysis that often arise as shell scripts grow.
The accompanying syntax package supports parsing and examining scripts programmatically, while shell helpers split command lines into arguments, quote them, expand variables and tildes, and handle globbing with double-star patterns or case-style matching. Its interpreter can execute scripts without a system shell, including on Windows, with handlers that define what scripts may run and access. The project documents the formatter’s default style through canonical.sh and provides a man page in Markdown or scdoc-rendered form.
Canonical publishes shfmt as open-source Developer Tools software on Linux, with version 3.12.0 available for x86_64 (amd64); the package requires snapd. Building its pure-Go source requires Go 1.26 or later. It suits developers maintaining POSIX or Bash-family scripts who want repeatable formatting, syntax inspection, or shell execution embedded in development workflows.
The pure-Go interpreter cannot fork its own process, so subshells use goroutines and cannot directly provide real process IDs or file descriptors. Bash associative-array indexes must be quoted for reliable static parsing, and the parser does not support the ambiguity between $(( and ((. It treats export, let, and declare as keywords for static syntax trees, while formatting cannot be disabled for selected ranges of lines.
Requires Linux + snapd · Architecture: x86_64 (amd64)
Details
SHA-256
Does this still work for you?
Badge for your website
Developers can show that shfmt is available on MirrorNest. Copy the code below: the badge links to this page and updates itself.
<a href="https://mirrornest.com/software/shfmt-9b438ca9"><img src="https://mirrornest.com/badge/shfmt-9b438ca9.svg" alt="shfmt on MirrorNest" height="20"></a>[](https://mirrornest.com/software/shfmt-9b438ca9)Reviews
No reviews yet — be the first.
shfmt alternatives
LM Studio
Run AI models, locally and privately
Freelens
Free IDE for Kubernetes
Pi Coding Agent
Minimal extensible coding agent for the terminal
DIY Layout Creator
Circuit layout design tool supporting PCB, vero-board, point-to-point, perf-board and guitar wiring diagrams
Insomnia
The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
Apache NetBeans
Apache NetBeans IDE