Oh My Niu: the theme & plugin framework for Niubash
niubash's official Oh-My-style plugin framework and bundled distribution: plugins are directories, themes are plugins, and the shell core only provides loading primitives. Out of the box you get 27 themes and a family of feature plugins (git / docker / kubectl / zoxide / fzf…); it ships with niubash as an offline baseline and then updates and rolls back independently. It is not a zsh compatibility layer — the useful shape of Oh My Zsh, with a bash body.
github.com/unixwin/oh-my-niu ↗ 1 stars (repo-meta.json, measured 2026-10-19)
Why Oh My Niu
People used to Oh My Zsh / fish plugin managers / PowerShell prompt frameworks expect not one specific theme but a model: list plugins, pick a theme, source one line — everything is in place. Native shells often lack that layer; oh-my-niu adds it to niubash while deliberately refusing to weld the framework into the shell.
中文原文 · Chinese original(3 张卡片全文)
- Oh My 的形状,bash 的身体——Oh My Zsh 真正好用的不是 zsh 语法,而是「插件即目录、按可预测顺序加载」的模型;用户零学习成本。
- shell 出原语,框架出组合——niubash 拥有加载、生命周期钩子、权限审阅、更新回滚等原语;oh-my-niu 拥有框架库、插件目录、主题与默认组合。bundled 不等于 built in——与第三方插件走同一套系统。
- catalog 指向官方上游——niu plugin 的 bash 生态 catalog(niu plugin add oh-my-bash 即装)直指各自官方仓:上游插件一行不改即可原生运行,官方 bundle 只是选项之一。
Core features
A gallery of 27 themes; themes-as-plugins; the prompt-core segment registry; a Starship takeover mode; the feature plugin family; five new 2.0 first-party plugins; alias/completion/keybinding asset packs; and env packages that wire a whole toolchain in one command. Full eight-point list (Chinese):
中文原文 · Chinese original(八条特性全文)
- 主题画廊——27 款主题(plugins/theme-* 目录与 themes/*.toml 资产层一一对应):Oh My Zsh 经典款、Powerlevel 风 p10 四款、Oh My Posh 风配色款与官方基础款。
- 主题即插件——每款主题是一个普通插件目录,与功能插件同一加载面。
- prompt-core——提示符 API 与 segment 注册表的拥有者,默认开启;git 段解析为 niubash 原生 Vcs 段(1.4.1+),零 git 子进程。
- Starship 接管模式——加载 starship 插件、留空 NIU_THEME,由 Starship 接管 PROMPT_COMMAND/PS1/PS2/PS0。
- 功能插件族——git、docker、kubectl、npm、jj、zoxide、direnv、dotenv、fzf、last-working-dir、thefuck、path-tools、extract、common-aliases、keybindings、command-not-found、winuxcmd-core……
- 2.0 新一方插件——command-timer、auto-env、dirmarks、git-fetch-reminder、env-sync。
- 别名 / 补全 / 键位资产——aliases/ 五组 TOML;completions/ 174 个 TOML 补全定义;keybindings/ emacs 与 vi 预设。
- 环境包(envs)——一个小 TOML 声明装哪些 wpm 包、启用哪些插件:niu env use git 一键配好原生 Git 工具链。
Install & quick start
The bundle ships with niubash (the offline baseline, which advances with
niu self-update); enabling it takes three rc lines. The niu plugin
command family manages the external ecosystem (oh-my-bash, bash-it and other
third-party sources) — a separate track from the bundled oh-my-niu. The entry file
oh-my-niu.niu is re-entrant — sourcing twice is a no-op; add --reload
for a full reload.
# Three lines in ~/.niubashrc: pick plugins, pick a theme, source the framework
NIU_PLUGINS=(prompt-core git docker zoxide)
NIU_THEME=minimal
source "$NIUBASH/oh-my-niu.niu" Day-to-day surface
# Switch themes: edit NIU_THEME, reopen the terminal, or hot-reload the session
source "$NIUBASH/oh-my-niu.niu" --reload
# The bundled baseline follows niubash releases
niu self-update
# Top-level health check (rc blocks, PATH consistency, ...)
niu doctor
Changing themes: edit NIU_THEME and reopen the terminal; keep config changes in
~/.niubashrc (sourcing itself writes nothing to disk, and plugins never rewrite the
rc without an explicit user command). To verify everything works, make the cow speak:
niu_moo "Bash, native on Windows." # a cowsay-style speech bubble Deep dive: the theme gallery
The gallery is not a static skin library — every theme is an ordinary plugin directory under
plugins/theme-*/ (plugin.toml metadata + a *.plugin.niu
behavior), rendered by prompt-core's segment registry; the themes/*.toml asset
layer serves manifest compatibility and review. Four style groups:
| Group | Themes |
|---|---|
| Oh My Zsh classics | agnoster · avit · bira · clean · fishy · lambda · robbyrussell |
| Powerlevel-style | p10-lean · p10-classic · p10-rainbow · p10-pure |
| Oh My Posh-style | dracula · catppuccin-mocha · gruvbox · spaceship · tokyonight |
| Official basics | default · dark · light · colorful · minimal · classic · pure · compact · cyberpunk · forest · ocean |
Source: the oh-my-niu README "First-Party Plugins" table and the plugins/, themes/ directories (measured 2026-10-24: 27 theme-* directories and 27 themes/*.toml, identical sets; the four groups above total 27).
中文原文 · Chinese original(目录优先 / catalog / 与 niu plugin 命令族的边界 三节全文)
目录优先模型——行为本体在 plugins/<name>/;packs/、aliases/、completions/、prompts/、keybindings/、themes/ 是过渡期的 manifest 兼容与审阅元数据面。新行为先进插件目录,再暴露 TOML 元数据供审阅、托管安装、更新与回滚——设计全文见仓内 docs/design.md(framework-first)。
catalog 指向官方上游——niu plugin 的三个内置 bash 生态源不绑 oh-my-niu——origin 直指官方上游仓,上游资产一行不改原生运行(兼容性是被 rubash 引擎测出来的事实)。
与 niu plugin 命令族的边界——bundle 契约:api = "niubash:[email protected]"、min_niubash = "1.0.0"(2.0 线自旧 winuxsh: 前缀迁至 niubash:)。发布档附 .sha256。更新模型:oh-my-niu 不是 niu plugin 的 source(niu plugin update oh-my-niu 报 unknown source,1.4.4 实测)——捆好的框架随 niubash 版本走(niu self-update 推进基线),update/rollback 的 spec+lockfile 机制管的是外部第三方源。旧的 niu plugin themes/doctor/review/search 内建面也已退役(niubash#145):主题选择就是 NIU_THEME,诊断走顶层 niu doctor。
The catalog points at official upstreams
| catalog source | Official origin | Content |
|---|---|---|
oh-my-bash | github.com/ohmybash/oh-my-bash | bash framework: 80+ themes, plugins and aliases (MIT) |
bash-it | github.com/Bash-it/bash-it | community aliases, plugins, completions and themes (MIT) |
bash-completion | github.com/scop/bash-completion | the standard bash completion library (GPL-2.0+, fetched on demand) |
Source: niubash crates/niubash-runtime/src/plugins/descriptors.rs (ManagerDescriptor origin field) · HIGHLIGHTS #13.
Measured numbers
Framework projects don't do micro-benchmarks — these numbers are the structural ledger and in-repo measured counts (2026-10-19):
| Metric | Value | Source |
|---|---|---|
| Themes | 27 (27 theme-* plugin directories and 27 themes/*.toml assets, name-for-name identical) | in-repo plugins/ and themes/ counts, measured 2026-10-19 |
| Plugin directories | 50 (27 themes + 23 feature plugins) | in-repo plugins/ count, measured 2026-10-19 |
| Completion definitions | 174 TOML files | in-repo completions/ count, measured 2026-10-19 |
| Index pack entries | 22 (bundle 2.0.0, min_niubash 1.0.0) | oh-my-niu/index.toml |
| Alias packs / env packages | 5 TOML packs · 2 official envs (git / cicd) | in-repo aliases/ · envs/ counts |
Release feed
oh-my-niu keeps its own CHANGELOG. Latest 3 versions (changelogs.json, fetched 2026-10-19; the full feed lives on the changelog):
- 2.0.0
Renamed oh-my-winuxsh → oh-my-niu (aligned with the niubash 1.0.0 branding); bundle/plugin
API prefix
winuxsh:→niubash:, env prefix nowNIU_*; new first-party plugins command-timer / auto-env / dirmarks / git-fetch-reminder / env-sync; the git prompt segment resolves to the native Vcs segment for niubash 1.4.1+ (in-process rendering, zero git subprocesses). - 1.0.1 First source packs (Git/Docker/kubectl/npm/zoxide/direnv/dotenv/fzf/last-working-dir/thefuck); framework entry point, directory-first official plugins, prompt-core and the seven theme plugins minimal/classic/pure/compact/cyberpunk/forest/ocean; runtime smoke scripts; deterministic release packaging (zip + sha256).
- 1.0.0 Founded as the official plugin bundle: bundle metadata (api = winuxsh:[email protected], min_winuxsh 0.8.3), alias/completion/prompt-preset/keybinding/theme assets and author templates, deterministic release packaging with checksums.
Related links
On this site
- Niubash product page — the host shell and plugin primitives
- Rubash product page — the engine that runs upstream plugins unmodified
- WinuxCmd product page — what winuxcmd-core completes
- wpm product page — the package channel behind env packages
- CLI & flags reference — the full niu plugin / niu env listing
- Docs home · Changelog
FAQ
How do I enable oh-my-niu?
Three rc lines: NIU_PLUGINS=(prompt-core git …) picks plugins, NIU_THEME=… picks the theme, source "$NIUBASH/oh-my-niu.niu" loads the framework. It ships with niubash; the entry is re-entrant (sourcing twice is a no-op, --reload forces a full reload).
How do I change themes in oh-my-niu?
Edit NIU_THEME and reopen the terminal; the current session can hot-reload with source "$NIUBASH/oh-my-niu.niu" --reload. Each of the 27 themes is an ordinary plugin directory — there is no special "theme system".
Can I run oh-my-bash themes and plugins?
Yes — niu plugin add oh-my-bash (the catalog points at the official upstream repo) runs upstream assets unmodified; oh-my-niu and external sources do not interfere and can coexist.
How do I update oh-my-niu?
The bundled baseline advances with niu self-update. It is not a niu plugin source — niu plugin update oh-my-niu fails with "unknown source" (measured on niubash 1.4.4); the spec+lockfile mechanism governs external third-party sources.
Is it free? Which platforms are supported?
Everything is open source and free. niubash ships native Windows x64 / arm64 installers (winget: Unixwin.Niubash); the rubash engine additionally has CI-gated builds for five platforms: Linux (gnu/musl), macOS, Android and OpenHarmony.