# Install nsh with Homebrew, apk, MacPorts, Nix

Fish-like, POSIX-compatible shell. Version 0.4.2 via Homebrew; verified from local package data.

## Install

```sh
sudo av install brew:nsh
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install nsh
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nsh
```

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

### Linux

- apk (92%):

```sh
sudo apk add nsh
```

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

- Nix (92%):

```sh
nix profile install nixpkgs#nsh
```

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

## Package facts

- **Package key:** brew:nsh
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/nsh>
- **Version:** 0.4.2
- **Source summary:** Fish-like, POSIX-compatible shell
- **Homepage:** <https://github.com/nuta/nsh>
- **Repository:** <https://github.com/nuta/nsh>
- **Upstream docs:** <https://github.com/nuta/nsh#readme>
- **License:** CC0-1.0 OR MIT
- **Source archive:** <https://github.com/nuta/nsh/archive/refs/tags/v0.4.2.tar.gz>
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- nsh (cli)
- nsh (alias)

## Build dependencies

- rust

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 0.4.2
- Local data: ok
- Upstream repository: https://github.com/nuta/nsh
- Upstream latest detected: v0.4.2 (current)
- info: No package-manager update timestamp was available.
## Project history and usage

nsh is a Rust command-line shell that aims to combine fish-like interactive convenience with POSIX-compatible shell syntax and some Bash extensions. Its README lists tab completion, syntax highlighting, Bash completion support by invoking Bash internally, and zero-configuration interactive features.

### Project history

The GitHub repository was created on October 5, 2018, and the crates.io package was created on December 19, 2018. A Rust users forum announcement from December 17, 2018 framed the motivation as wanting fish-like out-of-the-box features while keeping traditional shell syntax and Bash scripting features.

### Adoption history

nsh is an experimental/alpha shell rather than a mainstream login shell. The README explicitly asks for help to make it practical for daily use and notes missing Bash features and likely bugs. Still, it drew developer interest: the GitHub repository had about 963 stars when queried on 2026-07-01, crates.io reported 33,186 total downloads and 20 versions, and Homebrew, MacPorts, Nix, and Alpine package it.

### How it is used

Package users try it as an interactive shell with `nsh`, often via `cargo install nsh` or `brew install nsh`, to get completions and highlighting without adopting fish's non-POSIX language. The realistic usage is experimentation or personal shell sessions, not relying on it as `/bin/sh` for production scripts.

### Why package nerds care

nsh sits in the recurring shell-design niche: keep Bourne/POSIX familiarity, borrow fish's interactive ergonomics, and implement it in Rust. For package catalogs it is best described as an interesting alternative shell with modest packaging footprint and alpha-stage caveats.

### Timeline

- 2018-10-05: GitHub repository created.
- 2018-12-17: author announced nsh on users.rust-lang.org.
- 2018-12-19: crates.io package created.
- 2021-07-21: crates.io metadata updated to version 0.4.2.
- 2023-02-11: GitHub repository pushed timestamp observed by API query.

### Sources

- <https://crates.io/crates/nsh>
- <https://formulae.brew.sh/api/formula/nsh.json>
- <https://github.com/macports/macports-ports/blob/master/shells/nsh/Portfile>
- <https://github.com/nuta/nsh>
- <https://users.rust-lang.org/t/nsh-a-command-line-shell-like-fish-but-aims-to-be-compatible-with-bash/23312>


## Security Notes

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:** nsh
- **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

- Nix - nsh: normalized package name match | nixpkgs package indexes: pkgs/by-name/ns/nsh/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - nsh - 0.4.2-r1: normalized package name match | Alpine Linux edge package indexes: nsh from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | A command-line shell like fish, but POSIX compatible | https://github.com/nuta/nsh
- apk - nsh-dbg - 0.4.2-r1: normalized package name match | Alpine Linux edge package indexes: nsh-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | A command-line shell like fish, but POSIX compatible (debug symbols) | https://github.com/nuta/nsh
- MacPorts - nsh: normalized package name match | MacPorts ports tree: shells/nsh/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://www.automicvault.com/pkg/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://www.automicvault.com/pkg/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [rust](https://www.automicvault.com/pkg/brew/rust/) - Build dependency declared by Homebrew.
- [nushell](https://www.automicvault.com/pkg/brew/nushell/) - Shares av.db curated category or tags: cli, rust, shell, system, terminal.
- [bashish](https://www.automicvault.com/pkg/brew/bashish/) - Shares av.db curated category or tags: cli, shell, system, terminal.
- [brush](https://www.automicvault.com/pkg/brew/brush/) - Shares av.db curated category or tags: cli, rust, shell, system.
- [dash-shell](https://www.automicvault.com/pkg/brew/dash-shell/) - Shares av.db curated category or tags: cli, posix, shell, system.
- [murex](https://www.automicvault.com/pkg/brew/murex/) - Shares av.db curated category or tags: cli, shell, system, terminal.
- [posh](https://www.automicvault.com/pkg/brew/posh/) - Shares av.db curated category or tags: cli, posix, shell, system.
- [thefuck](https://www.automicvault.com/pkg/brew/thefuck/) - Shares av.db curated category or tags: cli, shell, system, terminal.
- [bash](https://www.automicvault.com/pkg/brew/bash/) - Shares av.db curated category or tags: cli, shell, system.
- [clifm](https://www.automicvault.com/pkg/brew/clifm/) - Local package facts share a topical domain. Shared terms: cli, shell, system, terminal.
- [hr](https://www.automicvault.com/pkg/brew/hr/) - Local package facts share a topical domain. Shared terms: cli, shell, system, terminal.

## Combined YAML source

View the package source record on GitHub. [combined/nsh.yml](https://github.com/automic-vault/db/blob/main/combined/nsh.yml)


## Sources

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