Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One-liner for installing plugins with Cargo #1564

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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