nu-require
CLI helper library: require Nushell as the host shell for tailored tools.
Idea
Nushell-tailored CLIs call validate() near process start:
import { validate } from "@openshellorg/nu-require";
await validate({ offerInstall: true });
Behavior:
-
Already under Nushell → continue normally.
-
Not under Nushell, but
nuis on PATH → print that the tool is relaunching inside Nushell, then re-exec the same binary/argv vianu -c. -
numissing → clear error, link to https://www.nushell.sh/, optionally offer a one-shot install whenofferInstall: true.
PowerShell is not treated as an acceptable host for these tailored tools (relaunch-to-Nushell is the bridge, not "support pwsh").
In this component
-
Vision — dual-role bug and product decision
-
TypeScript API —
validate()options -
Relaunch Behavior — hop into
nu -
Install Offer — winget / brew / docs
Related
-
shell-architecture — architecture thesis
-
open-shell-org — SOS flag syntax / certification
-
nu-emit — structured emit for Nushell