# 使用 Homebrew, apk, apt, MacPorts, Nix, pacman, zypper, scoop, winget 安装 shfmt

查看 shfmt 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

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

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install shfmt
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install shfmt
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: 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
```

  证据: openSUSE Tumbleweed package metadata: shfmt from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Scoop (92%):

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

  证据: 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
```

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

## 软件包事实

- **软件包键:** brew:shfmt
- **软件包管理器:** Homebrew
- **版本:** 3.13.1
- **来源摘要:** Autoformat shell script source code
- **主页:** <https://github.com/mvdan/sh>
- **仓库:** <https://github.com/mvdan/sh>
- **最后更新:** 2026-07-26T04:03:39+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- shfmt (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 3.13.1

## 安全说明

generalized runtime or code generation signal.

- **Geiger 风险:** yellow / 中
- generalized runtime or code generation signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: <project-root>/.editorconfig
## 其他软件包管理器记录

- 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-r2: 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-r2: 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.7: normalized package name match | openSUSE Tumbleweed package metadata: shfmt from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-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


## Combined YAML source

View the package source record on GitHub. [combined/shfmt.yml](https://github.com/mxcl/pkgdb/blob/main/combined/shfmt.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
