Environment and Activation
Environment and Activation
Upon project initialization or installation, Quiver creates a project-local environment in .nu-env/.
Directory layout
.nu-env/
├── activate.nu
├── config.nu
├── plugins.msgpackz
├── bin/
│ └── nu
└── modules/Key pieces:
activate.nuloads the environment as an overlay and providesdeactivateconfig.nusets Nushell library and plugin directoriesplugins.msgpackzis the plugin registry/config used by Nushellbin/nupoints to the Nushell version selected for the projectmodules/contains installed module dependencies
Running Scripts or Entering the Nu REPL for The Environment
For most automation and scripting, qv run is the simplest entrypoint.
# run a specific script with all the dependencies loaded (including plugins)
qv run nu script.nu# run the nu version in .nu-env/bin/ with the package environment
qv run nuOverlay activation
You can also use the overlay:
overlay use .nu-env/activate.nu
# and run nu with the alias supplied by `activate.nu`
nuLeave the shell with exit, then unload the overlay with deactivate.
LSP configuration
Quiver can also generate editor-specific Nushell LSP settings:
qv lsp
qv lsp --editor helix --editor zedThere are currently only presets for Helix and Zed.
Auto-activation hook
Quiver can print a Nushell hook that updates environment state when you cd into or out of a project.
mkdir ($nu.default-config-dir | path join "vendor" "autoload")
qv hook | save -f ($nu.default-config-dir | path join "vendor" "autoload" "quiver_hook.nu")This hook is useful for keeping $env.NU_LIB_DIRS in sync with the current project. For the full overlay behavior, use overlay use .nu-env/activate.nu.