Skip to content

Commit

Permalink
One-liner for installing plugins with Cargo (#1564)
Browse files Browse the repository at this point in the history
* One-liner for installing plugins with Cargo

* `ignore` results
  • Loading branch information
NotTheDr01ds authored Sep 30, 2024
1 parent b0ce793 commit 3b179ab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
14 changes: 10 additions & 4 deletions book/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The main Nushell binary is named `nu` (or `nu.exe` on Windows). After installati

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

[[toc]]

## Pre-built Binaries

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.
Expand Down Expand Up @@ -74,13 +76,17 @@ Using [Homebrew](https://brew.sh/), you will need to install "openssl" and "cmak

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

### Build using [crates.io](https://crates.io)
### Build from [crates.io](https://crates.io) using Cargo

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`:

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`:
```nu
cargo install nu
```

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

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.
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.

### Building from the GitHub repository

Expand Down
12 changes: 12 additions & 0 deletions book/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ Core plugins are typically distributed with the Nushell release and should alrea

::: tip Installing using Cargo
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>`.

To install all of the default plugins, from within Nushell run:

```nu
[ nu_plugin_inc
nu_plugin_polars
nu_plugin_gstat
nu_plugin_formats
nu_plugin_query
] | each { cargo install $in } | ignore
```

:::

### Third-party Plugins
Expand Down

0 comments on commit 3b179ab

Please sign in to comment.