You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Install all global dependencies from ~/.config/nuance/config.toml
56
+
nuance install -g
57
+
43
58
# Re-resolve everything (ignore lockfile)
44
59
nuance update
45
60
46
61
# Remove a dependency
47
62
nuance remove nu-some-module
48
63
49
-
# List installed modules (project-local if mod.toml exists, otherwise global)
64
+
# Remove a script dependency
65
+
nuance remove-script quickfix
66
+
67
+
# List installed dependencies (project-local if mod.toml exists, otherwise global)
50
68
nuance list
51
69
```
52
70
@@ -58,24 +76,33 @@ A nuance project is a directory containing:
58
76
-**`mod.nu`** — the Nushell module entry point
59
77
-**`mod.lock`** — auto-generated lockfile pinning exact commits (commit this to version control)
60
78
61
-
Running `nuance install` fetches dependencies into `.nu_modules/`.
79
+
Running `nuance install` fetches module dependencies into `.nu_modules/` and script dependencies into `.nu_scripts/`.
62
80
63
81
## Activation
64
82
65
-
To make the installed modules available to `use` in Nushell without specifying their full `.nu_modules/`paths, you need to add the project's modules directory to your`$env.NU_LIB_DIRS`.
83
+
To make installed modules/scripts available to `use` in Nushell without full paths, add the project's dependency directories to `$env.NU_LIB_DIRS`.
66
84
67
85
Nuance provides two ways to do this:
68
86
69
-
### 1. Manual Overlay (Recommended)
70
-
`nuance install` and `nuance init`automatically generate an `activate.nu` script inside the `.nu_modules` directory. This script adds `.nu_modules/` to your `$env.NU_LIB_DIRS`**and automatically imports** all installed modules into your active scope using `export use <module> *`.
87
+
### 1. Manual Activation (Recommended)
88
+
`nuance install` and `nuance init` generate activation scripts for both dependency kinds:
71
89
72
-
You can activate it using Nushell's `overlay` command:
90
+
-`.nu_modules/activate.nu` (module overlay): updates `$env.NU_LIB_DIRS` and imports module dependencies with `export use <name> *`
91
+
-`.nu_scripts/activate.nu` (sourceable script loader): sources script dependencies with `source <name>.nu`
92
+
93
+
Activate modules with an overlay:
73
94
74
95
```nu
75
96
overlay use .nu_modules/activate.nu
76
97
```
77
98
78
-
All commands from all installed modules are now available. When you're done, simply run `deactivate` (or `overlay hide activate`) to revert the environment changes and unload the modules.
99
+
If you installed script dependencies, source their activate file:
100
+
101
+
```nu
102
+
source .nu_scripts/activate.nu
103
+
```
104
+
105
+
When you're done, run `deactivate` (or `overlay hide activate`) to unload the module overlay.
79
106
80
107
### 2. Auto-activation Hook
81
108
If you want nuance projects to automatically update your module path when you `cd` into their directory (and remove it when you leave), add the nuance env_change hook to your `config.nu` or `env.nu`:
@@ -85,7 +112,7 @@ If you want nuance projects to automatically update your module path when you `c
85
112
nuance hook
86
113
```
87
114
88
-
> **Note**: Due to Nushell's static scoping rules, the auto-activation hook can only update`$env.NU_LIB_DIRS`. It cannot automatically import the module commands (you must still type `use <module> *` interactively). For fully automatic loading, use the Manual Overlay approach above.
115
+
> **Note**: Due to Nushell's static scoping rules, the auto-activation hook only updates`$env.NU_LIB_DIRS`. It cannot auto-import module/script commands. For automatic loading, use the manual activation approach above.
89
116
90
117
## mod.toml
91
118
@@ -95,34 +122,66 @@ name = "my-module"
95
122
version = "0.1.0"
96
123
description = "a wonderful nu module anyone can use"
97
124
98
-
[dependencies]
125
+
[dependencies.modules]
99
126
nu-utils = { git = "https://github.com/user/nu-utils", tag = "v1.0.0" }
0 commit comments