Skip to content

Commit 3b179ab

Browse files
authored
One-liner for installing plugins with Cargo (#1564)
* One-liner for installing plugins with Cargo * `ignore` results
1 parent b0ce793 commit 3b179ab

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

book/installation.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The main Nushell binary is named `nu` (or `nu.exe` on Windows). After installati
66

77
@[code](@snippets/installation/run_nu.sh)
88

9+
[[toc]]
10+
911
## Pre-built Binaries
1012

1113
Nu binaries are published for Linux, macOS, and Windows [with each GitHub release](https://github.com/nushell/nushell/releases). Just download, extract the binaries, then copy them to a location on your PATH.
@@ -74,13 +76,17 @@ Using [Homebrew](https://brew.sh/), you will need to install "openssl" and "cmak
7476

7577
@[code](@snippets/installation/macos_deps.sh)
7678

77-
### Build using [crates.io](https://crates.io)
79+
### Build from [crates.io](https://crates.io) using Cargo
80+
81+
Nushell releases are published as source to the popular Rust package registry [crates.io](https://crates.io/). This makes it easy to build and install the latest Nu release with `cargo`:
7882

79-
Nu releases are published as source to the popular Rust package registry [crates.io](https://crates.io/). This makes it easy to build and install the latest Nu release with `cargo`:
83+
```nu
84+
cargo install nu
85+
```
8086

81-
@[code](@snippets/installation/cargo_install_nu.sh)
87+
The `cargo` tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path.
8288

83-
That's it! The `cargo` tool will do the work of downloading Nu and its source dependencies, building it, and installing it into the cargo bin path.
89+
Note that the default plugins must be installed separately when using `cargo`. See the [Plugins Installation](./plugins.html#core-plugins) section of the Book for instructions.
8490

8591
### Building from the GitHub repository
8692

book/plugins.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ Core plugins are typically distributed with the Nushell release and should alrea
2828

2929
::: tip Installing using Cargo
3030
For example, when installing or upgrading Nushell directly from crates.io using `cargo install nu`, the corresponding core plugins for that version may also be installed or updated using `cargo install nu_plugin_<plugin_name>`.
31+
32+
To install all of the default plugins, from within Nushell run:
33+
34+
```nu
35+
[ nu_plugin_inc
36+
nu_plugin_polars
37+
nu_plugin_gstat
38+
nu_plugin_formats
39+
nu_plugin_query
40+
] | each { cargo install $in } | ignore
41+
```
42+
3143
:::
3244

3345
### Third-party Plugins

0 commit comments

Comments
 (0)