# 使用 Homebrew, MacPorts, Nix 安装 bashunit

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

## 安装

```sh
sudo av install brew:bashunit
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install bashunit
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install bashunit
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#bashunit
```

  证据: nixpkgs package indexes: pkgs/by-name/ba/bashunit/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:bashunit
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/bashunit>
- **版本:** 0.44.0
- **来源摘要:** Simple testing library for bash scripts
- **主页:** <https://bashunit.typeddevs.com>
- **仓库:** <https://github.com/TypedDevs/bashunit>
- **上游文档:** <https://bashunit.typeddevs.com>
- **许可证:** MIT
- **源码归档:** <https://github.com/TypedDevs/bashunit/releases/download/0.44.0/bashunit>
- **最后更新:** 2026-07-29T09:03:53Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- bashunit (cli)
- bashunit (别名)

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 0.44.0
- 管理器更新时间: 2026-07-29
- 本地数据: OK
- 上游仓库: https://github.com/TypedDevs/bashunit
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

bashunit is a modern Bash testing framework by TypedDevs. Its README describes it as a lightweight, fast framework for Bash 3.0+ with assertions, spies, mocks, data providers, snapshots, and other developer-experience features.

### 项目历史

The project began publicly with version 0.1.0 on 2023-09-04, according to its official CHANGELOG. It developed rapidly through 2023 and 2024, adding documentation, examples, new assertions, configuration, snapshots, data providers, output formats, and CI-oriented reporting.

By late 2025 and 2026, bashunit had expanded beyond basic assertions into coverage, profiling, watch mode, parallel execution improvements, TAP/JUnit/GitHub Actions reporting, checksum-verified installer behavior, and an official composite GitHub Action.

### 采用历史

The project is distributed as a project-local installer from bashunit.com, an npm package, a Homebrew formula, and package-manager entries in MacPorts and Nix according to the supplied package facts. The docs site metadata identifies the current public site as bashunit.com and lists v0.40.0 on 2026-06-16.

bashunit's adoption story is tied to shell-heavy repositories wanting tests without moving logic into another language. The README explicitly frames it as a fast, simple way to test Bash scripts and includes a one-file quickstart.

### 使用方式

The README quickstart installs the runner into a project with `curl -s https://bashunit.com/install.sh | bash`, writes test functions in shell files under `tests/`, and runs them with `./lib/bashunit tests/`.

The official docs describe configuration through `.env` and, since 0.37.0, `.bashunitrc`. Recent releases add workflow-friendly features such as JUnit, TAP, GitHub Actions annotations, coverage reports, test timeouts, and a composite GitHub Action.

### 为什么软件包爱好者会关心

bashunit matters to package nerds because it is part of the small ecosystem that tests shell as shell. It keeps the runtime requirement low, uses Bash 3.0+ for broad compatibility, and packages itself for project-local use, npm, Homebrew, MacPorts, and Nix.

Its changelog is also an example of a modern CLI project optimizing for CI ergonomics: pinned GitHub Actions, checksum verification, inline annotations, coverage formats, and failure output tuned for automated logs.

### 时间线

- 2023-09-04: Version 0.1.0 appears in the official CHANGELOG.
- 2023-10-15: Version 0.9.0 adds early blog/docs-era features.
- 2024-07-14: Version 0.14.0 continues the pre-1.0 feature cadence.
- 2025-12-19: Version 0.31.0 adds code coverage tracking.
- 2026-02-15: Version 0.33.0 lowers the minimum Bash version to 3.0 and improves parallel execution.
- 2026-06-07: Version 0.38.0 adds the official `TypedDevs/bashunit` GitHub Action.
- 2026-06-16: Version 0.40.0 adds per-test timeouts and moves URLs to bashunit.com.

### Related projects

- The project includes its own installer, npm distribution, docs site, and official GitHub Action. It is adjacent to other shell test runners, but the official sources emphasize bashunit's own Bash 3.0+ compatibility and CI/reporting features.

### 来源

- <https://bashunit.com/>
- <https://github.com/TypedDevs/bashunit/blob/main/CHANGELOG.md>
- <https://github.com/TypedDevs/bashunit/blob/main/README.md>
- source_facts.package-manager


## 安全说明

没有找到 bashunit 的匹配本地密钥处理 manifest。软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## 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: ./.env, ./.bashunitrc
## 源数据库详情

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

## 其他软件包管理器记录

- Nix - bashunit: normalized package name match | nixpkgs package indexes: pkgs/by-name/ba/bashunit/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - bashunit: normalized package name match | MacPorts ports tree: devel/bashunit/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [Networking and protocol packages](https://pkg.so/zh-hans/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [bash_unit](https://pkg.so/zh-hans/brew/bash-unit/) - Shares pkgdb curated category or tags: bash, cli, developer-tools, testing, unit-testing.
- [bats-core](https://pkg.so/zh-hans/brew/bats-core/) - Shares pkgdb curated category or tags: bash, cli, developer-tools, testing.
- [pytest](https://pkg.so/zh-hans/brew/pytest/) - Shares pkgdb curated category or tags: cli, developer-tools, testing, unit-testing.
- [phpunit](https://pkg.so/zh-hans/brew/phpunit/) - Shares pkgdb curated category or tags: cli, developer-tools, testing, unit-testing.
- [busted](https://pkg.so/zh-hans/brew/busted/) - Shares pkgdb curated category or tags: cli, developer-tools, testing, unit-testing.
- [lcov](https://pkg.so/zh-hans/brew/lcov/) - Shares pkgdb curated category or tags: cli, developer-tools, testing.
- [allure](https://pkg.so/zh-hans/brew/allure/) - Shares pkgdb curated category or tags: cli, developer-tools, testing.
- [kcov](https://pkg.so/zh-hans/brew/kcov/) - Shares pkgdb curated category or tags: cli, developer-tools, testing.
- [shunit2](https://pkg.so/zh-hans/brew/shunit2/) - Local package facts share a topical domain. Shared terms: cli, developer, developer-tools, scripts, testing.

## Combined YAML source

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


## 来源

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