# 使用 Homebrew, Nix, apt 安装 babelfish

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

## 安装

```sh
sudo av install brew:babelfish
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install babelfish
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#babelfish
```

  证据: nixpkgs package indexes: babelfish from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- Debian apt (92%):

```sh
sudo apt install python3-babelfish
```

  证据: Debian stable package indexes: python3-babelfish from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

## 软件包事实

- **软件包键:** brew:babelfish
- **软件包管理器:** Homebrew
- **版本:** 1.2.1
- **来源摘要:** Translate bash scripts to fish
- **主页:** <https://github.com/bouk/babelfish>
- **仓库:** <https://github.com/bouk/babelfish>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- babelfish (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.2.1
## 项目历史与用法

babelfish is a small command-line translator that converts bash shell snippets or scripts into fish shell code. Its README frames it as a faster alternative to running bash-backed compatibility layers every time fish needs to source shell setup code.

### 项目历史

The project was created by Bouke Haarsma to avoid relying on fish-foreign-env or bass for repeated bash process execution. Instead, babelfish parses shell code with mvdan.cc/sh and emits equivalent fish code where possible.

The public GitHub releases show a 1.0.0 release in January 2021, a 1.1.0 release shortly after, and a 1.2.0 release in June 2023. The README still describes limitations, including untranslated variables such as BASH_SOURCE and incomplete arithmetic-expression support.

### 采用历史

babelfish's adoption is niche and shell-specific. The README documents Homebrew and Go installation, and the package metadata in this batch shows Homebrew and Nix packaging for this Go-based translator.

Its practical audience is fish users who need to consume bash-oriented environment setup scripts, version-manager hooks, or shell snippets without leaving fish or spawning bash repeatedly.

### 使用方式

Users pipe bash code into babelfish and can then inspect or source the generated fish code. The README demonstrates translating a function, exporting SSH_AUTH_SOCK, setting local variables, and using a shell hook to source bash-oriented setup scripts in fish.

Because its translation coverage is incomplete, babelfish is best treated as a pragmatic bridge for common shell setup patterns rather than a perfect bash interpreter.

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

babelfish is package-nerd interesting in the small-tool sense: it exists to smooth over the mismatch between package ecosystems that ship bash activation scripts and users who prefer fish.

It also shows a common CLI pattern in modern packaging: take a mature parser library, here mvdan.cc/sh, and wrap it in a focused translator that solves one irritating shell integration problem.

### 时间线

- 2021: babelfish 1.0.0 is released on GitHub.
- 2021: babelfish 1.1.0 follows with continued maintenance.
- 2023: babelfish 1.2.0 is released on GitHub.
- 2026: Package metadata in this batch shows babelfish still present in Homebrew and Nix.

### Related projects

- fish is the target shell for generated output.
- bash is the source shell language babelfish translates from.
- fish-foreign-env and bass are named by the README as earlier approaches babelfish was intended to avoid for performance reasons.
- mvdan.cc/sh provides the shell parser used by babelfish.

### 来源

- <https://api.github.com/repos/bouk/babelfish/releases>
- <https://github.com/bouk/babelfish>
- input.json source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

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

- Debian apt - python3-babelfish - 0.6.1-1: normalized package name match | Debian stable package indexes: python3-babelfish from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | library to work with countries and languages (Python 3) | https://github.com/Diaoul/babelfish
- Nix - babelfish: normalized package name match | nixpkgs package indexes: babelfish from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - python3-babelfish - 0.6.0-2: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-babelfish from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | library to work with countries and languages (Python 3) | https://github.com/Diaoul/babelfish


## Combined YAML source

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


## 来源

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