# Install shfmt

Autoformat shell script source code. Version 3.13.1 via Homebrew; verified 2026-04-07.

## Install

```sh
sudo av install brew:shfmt
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install shfmt
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install shfmt
```

  Evidence: MacPorts ports tree: devel/shfmt/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add shfmt
```

  Evidence: Alpine Linux edge package indexes: shfmt from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install shfmt
```

  Evidence: Debian stable package indexes: shfmt from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#shfmt
```

  Evidence: nixpkgs package indexes: pkgs/by-name/sh/shfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S shfmt
```

  Evidence: Arch Linux sync databases: shfmt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install shfmt
```

  Evidence: openSUSE Tumbleweed package metadata: shfmt from https://download.opensuse.org/tumbleweed/repo/oss/repodata/155b97171d05e27afd950b6fe0d55513ff38f4597110664535bceedc680bbe6fd459f0733718dcc21dcf0efc7c8250fd1390c73d4790b42e62fb2c16a87242e5-primary.xml.zst

### Windows

- Scoop (92%):

```sh
scoop install main/shfmt
```

  Evidence: Scoop official bucket manifest trees: bucket/shfmt.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id mvdan.shfmt -e
```

  Evidence: Windows Package Manager source index: mvdan.shfmt from https://cdn.winget.microsoft.com/cache/source.msix

## Package Facts

- **Package key:** brew:shfmt
- **Package manager:** Homebrew
- **Package manager URL:** <https://formulae.brew.sh/formula/shfmt>
- **Version:** 3.13.1
- **Source summary:** Autoformat shell script source code
- **Homepage:** <https://github.com/mvdan/sh>
- **Repository:** <https://github.com/mvdan/sh>
- **Upstream docs:** <https://github.com/mvdan/sh>
- **License:** BSD-3-Clause
- **Source archive:** <https://github.com/mvdan/sh/archive/refs/tags/v3.13.1.tar.gz>
- **Last updated:** 2026-04-07T00:28:41Z
- **Generated:** 2026-06-10T07:18:26+00:00

## Executables

- shfmt (cli)
- shfmt (alias)

## Build Dependencies

- go
- scdoc

## Install Behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-06-10
- Package-manager version: 3.13.1
- Package-manager updated: 2026-04-07
- Local data status: ok
- Upstream repository: https://github.com/mvdan/sh
- Upstream latest detected: v3.13.1 (current)

## 安全说明

generalized runtime or code generation signal.

- **Geiger risk:** yellow / medium
- generalized runtime or code generation signal

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** shfmt
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - shfmt - 3.8.0-1+b8: normalized package name match | Debian stable package indexes: shfmt from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | format shell programs | https://github.com/mvdan/sh
- Nix - shfmt: normalized package name match | nixpkgs package indexes: pkgs/by-name/sh/shfmt/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - shfmt - 3.8.0-1: normalized package name match | Ubuntu 24.04 LTS package indexes: shfmt from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | format shell programs | https://github.com/mvdan/sh
- apk - shfmt - 3.13.1-r1: normalized package name match | Alpine Linux edge package indexes: shfmt from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A shell parser, formatter, and interpreter (sh/bash/mksh) | https://mvdan.cc/sh
- apk - shfmt-doc - 3.13.1-r1: normalized package name match | Alpine Linux edge package indexes: shfmt-doc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | A shell parser, formatter, and interpreter (sh/bash/mksh) (documentation) | https://mvdan.cc/sh
- pacman - shfmt - 3.13.1-1: normalized package name match | Arch Linux sync databases: shfmt from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Format shell programs | https://github.com/mvdan/sh
- zypper - shfmt - 3.12.0-1.4: normalized package name match | openSUSE Tumbleweed package metadata: shfmt from https://download.opensuse.org/tumbleweed/repo/oss/repodata/155b97171d05e27afd950b6fe0d55513ff38f4597110664535bceedc680bbe6fd459f0733718dcc21dcf0efc7c8250fd1390c73d4790b42e62fb2c16a87242e5-primary.xml.zst | A shell formatter with bash support | https://github.com/mvdan/sh
- MacPorts - shfmt: normalized package name match | MacPorts ports tree: devel/shfmt/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/shfmt: normalized package name match | Scoop official bucket manifest trees: bucket/shfmt.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - mvdan.shfmt: normalized package name match | Windows Package Manager source index: mvdan.shfmt from https://cdn.winget.microsoft.com/cache/source.msix


## Related Links

- [Source-control packages](https://www.automicvault.com/zh-hans/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://www.automicvault.com/zh-hans/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/zh-hans/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/zh-hans/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [go](https://www.automicvault.com/zh-hans/pkg/brew/go/) - Build dependency declared by Homebrew.
- [scdoc](https://www.automicvault.com/zh-hans/pkg/brew/scdoc/) - Build dependency declared by Homebrew.
- [beautysh](https://www.automicvault.com/zh-hans/pkg/brew/beautysh/) - Shares av.db curated category or tags: bash, cli, developer-tools, formatter, formatters.
- [shellcheck](https://www.automicvault.com/zh-hans/pkg/brew/shellcheck/) - Shares av.db curated category or tags: bash, cli, developer-tools, shell.
- [sheldon](https://www.automicvault.com/zh-hans/pkg/brew/sheldon/) - Shares av.db curated category or tags: bash, cli, developer-tools, shell.
- [mcfly](https://www.automicvault.com/zh-hans/pkg/brew/mcfly/) - Shares av.db curated category or tags: bash, cli, developer-tools, shell.
- [checkbashisms](https://www.automicvault.com/zh-hans/pkg/brew/checkbashisms/) - Shares av.db curated category or tags: cli, developer-tools, posix, shell.
- [shellspec](https://www.automicvault.com/zh-hans/pkg/brew/shellspec/) - Shares av.db curated category or tags: cli, developer-tools, posix, shell.
- [gci](https://www.automicvault.com/zh-hans/pkg/brew/gci/) - Shares av.db curated category or tags: cli, developer-tools, formatter, formatters, go.
- [powerline-go](https://www.automicvault.com/zh-hans/pkg/brew/powerline-go/) - Shares av.db curated category or tags: bash, cli, developer-tools, go, shell.
- [dfmt](https://www.automicvault.com/zh-hans/pkg/brew/dfmt/) - Local package facts share a topical domain. Shared terms: cli, code, developer, developer-tools, formatter.

## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
