babelfish
brew install babelfish
v1.2.1
MIT
Translate bash scripts to fish
11
30-day installs · #8309
28
90-day · #8835
157
365-day · #7982
244
★ GitHub stars · updated 1y ago
Build dependencies
Links
- https://github.com/bouk/babelfish
- GitHub: bouk/babelfish
- Brew formula source: Formula/b/babelfish.rb
Caveats
The shell hook has been installed, you can use it by running: $ source $HOMEBREW_PREFIX/share/fish/vendor_functions.d/babel.fish
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"go"
],
"categories": [],
"caveats": "The shell hook has been installed, you can use it by running:\n\n $ source $HOMEBREW_PREFIX/share/fish/vendor_functions.d/babel.fish\n",
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Translate bash scripts to fish",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:35:43+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "babelfish",
"github_default_branch": "master",
"github_last_commit_at": "2025-01-27T19:25:11Z",
"github_readme_excerpt": "# babelfish\n\nTranslate bash scripts to [fish](https://fishshell.com).\n\n## Why?\n\nBecause I got annoyed by having to use [fish-foreign-env](https://github.com/oh-my-fish/plugin-foreign-env) or [bass](https://github.com/edc/bass), which are slow, since they create multiple bash processes. With this program I can translate bash scripts to fish, and run them directly in fish.\n\n## But how?\n\n`babelfish` parses the script using [mvdan.cc/sh](https://github.com/mvdan/sh), and then translates bash expressions to the equivalent fish code. That\u0027s it! You can find the code that walks the AST and emits fish code [here](https://github.com/bouk/babelfish/blob/master/translate/translate.go).\n\n## Install\n\nIf you have Homebrew, just run:\n\n```shell\nbrew install babelfish\n```\n\nElse:\n\n```shell\ngo install bou.ke/babelfish@latest\n```\n\n## Example\n\n```sh\n# Pass some code on stdin to translate it\n$ echo \u0027f() { export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket); local cool=yep; }\u0027 | babelfish\nfunction f\n set -gx SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket | string collect; or echo)\n set -l cool \u0027yep\u0027\nend\n# Pass the result to source to load it into fish\n$ echo \u0027echo Nice to meet you user $UID\u0027 | babelfish | source\nNice to meet you user 502\n# Or install the shell hook!\n$ source babel.fish\n$ source chruby.sh\n$ chruby\n ruby-2.5\n ruby-2.6\n ruby-2.7\n```\n\n## To do\n\nProbably still a lot. There\u0027s a couple variables like `$BASH_SOURCE` that aren\u0027t translated, and not all arithmetic expressions are implemented either. Pull requests and issues welcome!\n",
"github_repo": "bouk/babelfish",
"github_stars": 244,
"github_topics": [],
"homepage": "https://github.com/bouk/babelfish",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 11,
"installs_365d": 157,
"installs_90d": 28,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MIT",
"llm_generated_at": null,
"llm_model": null,
"name": "babelfish",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 8309,
"rank_365d": 7982,
"rank_90d": 8835,
"raw_hash": "aaf2102eca632670",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/b/babelfish.rb",
"tap": "homebrew/core",
"test_dependencies": [
"fish"
],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "1.2.1",
"versioned_formulae": [],
"why_use_this": null
}