# nsh を Homebrew, apk, MacPorts, Nix でインストール

nsh のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。

## インストール

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

追加のインストールコマンド:

### macOS

- Homebrew (100%):

```sh
brew install nsh
```

  証拠: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install nsh
```

  証拠: 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
```

  証拠: 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
```

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

## パッケージ情報

- **パッケージキー:** brew:nsh
- **パッケージマネージャ:** Homebrew
- **バージョン:** 0.4.2
- **ソース概要:** Fish-like, POSIX-compatible shell
- **ホームページ:** <https://github.com/nuta/nsh>
- **リポジトリ:** <https://github.com/nuta/nsh>
- **生成日時:** 2026-08-03T19:37:03+00:00

## 実行可能ファイル

- nsh (エイリアス)

## インストール挙動

- Bottle: 利用不可

## バージョンと鮮度

- ページ生成日: 2026-08-03
- マネージャ版: 0.4.2
## プロジェクトの歴史と使われ方

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.

### プロジェクトの歴史

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.

### 採用の歴史

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.

### 使われ方

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.

### パッケージ好きにとっての重要性

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.

### タイムライン

- 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.

### ソース

- <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>


## セキュリティノート

generalized runtime or code generation signal.

- **Geiger リスク:** yellow / 中
- generalized runtime or code generation signal

## 他のパッケージマネージャ記録

- 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


## Combined YAML source

View the package source record on GitHub. [combined/nsh.yml](https://github.com/mxcl/pkgdb/blob/main/combined/nsh.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
