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 启动(Windows 同机)
# 安装 · session 1/3
PS C:\> irm https://unixwin.dev/install.ps1 | iex
downloading niubash-win-x64-setup.exe …
✓ Niubash 1.5.1 installed
PS C:\> niu --version
Niubash 1.5.1 — 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.5.1 — 真语法,真命令,原生三平台
agent>
# 速度 · session 3/3
cmx@unixwin:~$ time git --version
git version 2.56.0.windows.4.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;git 启动 ~14 ms(Windows 同机实测)
Native Windows Git without MSYS; git starts in ~14 ms (Windows, same-machine measurement).
git --version WinuxCmd 内置包管理器,官方索引 282 包
WinuxCmd's built-in package manager with a 282-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(均为 Windows 同机实测,niu-git 口径);提示符 git 段
每遍至多 spawn 一次(仓内 p50 26ms,Windows 实测),对方每条提示符给 git 交 113–362ms 的税。
git ~14ms(Windows 同机)· prompt ≤1 spawn/遍 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.5.1/niubash-v1.5.1-linux-x86_64.tar.gz && tar xzf niubash.tar.gz curl -fsSL -o niubash.tar.gz https://github.com/unixwin/niubash/releases/download/v1.5.1/niubash-v1.5.1-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) — git ~14 ms (Windows, same machine), 176+ unix commands
agent> niu -c 'ls | grep src'
src
agent> niu -c 'git log --oneline -1'
f0c0ffe niubash 1.5.1 — 真语法,真命令,原生三平台
agent>
# 引号地狱终结者:整条命令编成一个 base64 词,任何宿主层都改不动
agent> niu --ec "Z2l0IGxvZyAtMSAtLWZvcm1hdD0iY29tbWl0ICVoIG9uICVjZCIgLS1kYXRlPSJmb3JtYXQ6JVktJW0tJWQi"
commit a08e7afd on 2026-11-02
✓ 没有引号,就没有可被弄坏的东西——嵌套引号、$ 展开、heredoc、反斜杠塌缩,整类失败免疫
agent 用上 niubash 后,每一条命令都跑在真 bash
语法上——输出确定、启动够快,长会话也不掉链子。各家 agent
的启动方式与配置细节见
探测机制文档;命令递交的终极形态是
--ec——base64 直通、零引号穿越,cookbook 同在文档内。
tail -f changelogs.json
niubash 1.5.1
Deep-audit host fix wave (1.5.1-bound, 2026-11-04): seven no…
rubash 1.5.1
深审修复波(1.5.1 向,2026-11-04):两轮深度审计(约 214 条经队长复核的发现)中可局部修复项全部落地…
WinuxCmd 1.2.2
locale value model (#1549): `locale` answers keyword operand…
oh-my-niu 2.1.0
详见更新日志。