Skip to content

Repository files navigation

Contributors Forks Stars Issues License

nu-require

Require Nushell as the host shell for tailored CLIs (validate + optional relaunch/install).
Report Bug · Request Feature

About The Project

CLI helper library: require Nushell as the host shell for tailored tools.

Nushell-tailored CLIs call validate() near process start:

import { validate } from "@openshellorg/nu-require";

await validate({ offerInstall: true });

Behavior:

  1. Already under Nushell → continue normally.

  2. Not under Nushell, but nu is on PATH → relaunch inside Nushell via nu -c.

  3. nu missing → clear error, link to https://www.nushell.sh/, optionally offer install when offerInstall: true.

Pass relaunch: false only when you want hard-fail instead of auto-relaunch.

Early scaffold. Loop guard: NU_REQUIRE_RELAUNCHED prevents infinite relaunch.

(back to top)

Installation

pnpm add @openshellorg/nu-require

(back to top)

Usage

See packages/nu-require/ for the implementation.

(back to top)

License

MIT — see LICENSE.

(back to top)

About

Require Nushell as the host shell for tailored CLIs (validate + optional relaunch/install)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages