niubash
RustAI-native 的真·Bash:真语法、真 Unix 命令、原生三平台
AI-native real bash: real syntax, real Unix commands, native on Windows/Linux/macOS.
AI-native 的真·Bash 家族——真语法、真 Unix 命令、原生 Windows / Linux / macOS,无 WSL、无 MSYS。
AI-native bash family — real syntax, real Unix commands, native Windows / Linux / macOS. No WSL, no MSYS.
83/83 GNU 套件 · 82 套逐字节一致 · 176+ Unix 命令 · ~14 ms git 启动
# 安装 · session 1/3
PS C:\> irm https://unixwin.dev/install.ps1 | iex
downloading niubash-win-x64-setup.exe …
✓ Niubash 1.4.3 installed
PS C:\> niu --version
Niubash 1.4.3 — bash-compatible shell for Windows
# agent 接管 · session 2/3
cmx@unixwin:~$ claude
✓ shell: niubash (rubash engine) — $SHELL 自动识别
agent> niu -c 'git log --oneline -1'
f0c0ffe niubash 1.4.3 — 真语法,真命令,原生三平台
agent>
# 速度 · session 3/3
cmx@unixwin:~$ time git --version
git version 2.56.0.windows.2.niugit
✓ real 0m0.014s ← niu-git
user 0m0.006s · sys 0m0.002s
# Git Bash 同机对照:real 0.045s – 0.103s(3–7× 慢)
cmx@unixwin:~$
six projects · one family
全部六项随 niubash 一键可得——装一次 niubash,六个产品全部就位。
AI-native 的真·Bash:真语法、真 Unix 命令、原生三平台
AI-native real bash: real syntax, real Unix commands, native on Windows/Linux/macOS.
irm unixwin.dev/install.ps1 | iex 原生 Windows 的 Unix 命令集,单文件约 3MB
Native-Windows Unix command set, single ~3 MB executable.
winuxcmd --version 可嵌入的 GNU Bash 5.3 兼容引擎
Embeddable GNU Bash 5.3-compatible engine.
cargo add rubash 原生 Windows Git,无 MSYS,~14ms 启动
Native Windows Git without MSYS, ~14 ms startup.
git --version WinuxCmd 内置包管理器,官方索引 281 包
WinuxCmd's built-in package manager with a 281-package official index.
wpm install neovim Oh-My 式框架:40+ 主题与插件
Oh-My-style framework: 40+ themes and plugins.
niu plugin list why --real --fast --native
GNU Bash 上游 83 套测试套件全部通过,其中 82 套输出与 bash 逐字节一致——唯一残差经逐字节论证是 GNU 自己的竞态。存量脚本零修改。
suites 83/83 · byte-identical 82 ( ) 与 $( ) 零进程创建——子壳在进程内完成,fd
继承、共享偏移、退出码、信号处置与 GNU 行为一致。全平台同一模型,无 POSIX 模拟层。
( ) $( ) → 0 processes C:\、D:/、/d/、/mnt/d、/cygdrive/d——
四大生态的路径写法一个 shell 全收且真折叠。换 shell,不用改脚本。
C:\ · /d/ · /mnt/d · /cygdrive/d
Git Bash 会在 spawn 前启发式改写你的参数,你得学会
MSYS_NO_PATHCONV;niu 没有 MSYS 运行时——argv
逐字节原样抵达,这个词不存在,因为它不需要存在。
argv verbatim
从 niu 会话启动 Claude Code、Codex、Cursor,agent 按 $SHELL 约定直接用上
niubash;niu -c
单条命令、确定性输出,专为 agent 的反复调用与解析而生。
niu -c 'ls | grep src' git --version 约 ~14ms,Git Bash 要 45–103ms;提示符直接读
.git/HEAD(≤29ms),对方每条提示符给 git 交 113–362ms 的税。
git ~14ms · prompt ≤29ms Git Bash (MSYS)
argv 被运行时改写 → 三连败
niubash (niu)
argv 逐字节原样 → 一次通过
cd、cmd
/c、git grep -n 接连失败;niu 没有 MSYS 层,argv
逐字节原样抵达,同样的命令一次通过(见「无 MSYS 咒语」)。
右侧三条命令可直接复制到 niu 里复现。
quick start · 一行命令
winget install --id Unixwin.Niubash --source winget irm https://unixwin.dev/install.ps1 | iex curl -fsSL -o niubash.tar.gz https://github.com/unixwin/niubash/releases/download/v1.4.3/niubash-v1.4.3-linux-x86_64.tar.gz && tar xzf niubash.tar.gz curl -fsSL -o niubash.tar.gz https://github.com/unixwin/niubash/releases/download/v1.4.3/niubash-v1.4.3-macos-x86_64.tar.gz && tar xzf niubash.tar.gz wpm 看 help);装包如 wpm install neovim,自升级 wpm update winuxcmd。niu × claude code
$ claude # 在 niu 会话里启动,$SHELL 已指向 niubash
✓ shell: niubash (rubash engine) — 14ms git, 176+ unix commands
agent> niu -c 'ls | grep src'
src
agent> niu -c 'git log --oneline -1'
f0c0ffe niubash 1.4.3 — 真语法,真命令,原生三平台
agent>
agent 用上 niubash 后,每一条命令都跑在真 bash 语法上——输出确定、启动够快,长会话也不掉链子。各家 agent 的启动方式与配置细节见 探测机制文档。
tail -f changelogs.json
niubash 1.4.4
`ping`/`netstat`/`tracert` were `command not found` (rubash#…
rubash 1.4.3
命令词干大小写折叠(#998/#1000):System32 的盘上真名全大写(`PING.EXE`/`NETSTAT.…
WinuxCmd 1.1.20
bare drive-root operands (`ls /e`, `cp /e ...`, every applet…
oh-my-niu 1.0.1
Released first-party `.winux` source packs for Git, Docker, …