A manager for Nushell packages.
📯 this project has been archived => please refer to the official nupm
package manager of Nushell
- run
http get https://raw.githubusercontent.com/amtoine/nupm/main/bootstrap/bootstrap.nu | save --force ($nu.temp-path | path join "nupm-bootstrap"); nu ($nu.temp-path | path join "nupm-bootstrap")
to have a look at the bootstrap script (HIGHLY RECOMMENDED IN ALL CASES) or
nu --commands (http get https://raw.githubusercontent.com/amtoine/nupm/main/bootstrap/bootstrap.nu)
to run the bootstrap script directly.
- add
export-env {
let-env NUPM_HOME = ...
let-env NU_LIB_DIRS = ($env.NU_LIB_DIRS? | default [] | append [
$env.NUPM_HOME
])
}
to env.nu
Note
it is also recommended to add the following to allow the use of the--save
option oninstall
andactivate
let-env NUPM_CONFIG = { activations: ... packages: ... }
- add
use nupm/activations *
toconfig.nu
- install packages
- activate items
Note
in all the following, we assumenupm
has been installed and loaded withuse nupm
💡 an example with nu-git-manager
please find intructions here
💡 another example with goatfiles/nu_scripts
i'm not using the main
revision of this package, rather the nightly
branch...
we can use nupm install --revision
to make this happen!
nupm install https://github.com/goatfiles/nu_scripts --revision nightly
and then something like
nupm activate nu-goat-scripts misc back # module import syntax
nupm activate "nu-goat-scripts misc edit" # single-block syntax
as i have the activations above exported with
nupm activate --list
| to nuon -i 4
| save --force ($nu.config-path | path dirname | path join "nupm" "activations.nuon")
i can run a simpler
nupm activate --from-file ($nu.config-path | path dirname | path join "nupm" "activations.nuon")
one can also export the packages installed with
nupm install --list
| to nuon -i 4
| save --force ($nu.config-path | path dirname | path join "nupm" "packages.nuon")
Note
alternatively, one can defineNUPM_CONFIG
inenv.nu
, e.g.let-env NUPM_CONFIG = { activations: ($nu.default-config-dir | path join "nupm" "activations.nuon") packages: ($nu.default-config-dir | path join "nupm" "packages.nuon") set_prompt: false }and then use the
--save
option ofnupm install
andnupm activate
to dump the installed packaged and activated items to the files inNUPM_CONFIG
, e.g.nupm install --list --save nupm activate --list --save
one can use the following to update the package manager
nupm update --self
# or
nupm update nupm
or something like this to update all the packages
nupm install --list
| get name
| each {|pkg| nupm update $pkg --ignore}
# or
nupm update --all
Note
nupm update --self
will automagically reload itself after the update, no need to runuse nupm/
! 🥳
trynupm version
before and after anupdate --self
... 😏
- 🔴 install packages from a NUON file
- 🟢 hot-swap the version of packages once installed
- 🟢 update packages
- 🔴 add support for Nushell plugins, e.g. the
nu_plugin_*
innushell/crates/
- 🔴 list all official packages and plugins in a centralized remote store
- 🔴 support unit and integration tests of Nushell packages
in order to load nupm
in the blink of an eye, i've added the following to my $env.config.keybindings
:
{
name: nupm
modifier: control
keycode: char_n
mode: [emacs, vi_insert, vi_normal]
event: {
send: executehostcommand
cmd: "overlay use --prefix nupm"
}
}
which allows me to load nupm
BLAZZINGLY FAST on <c-n>
💪