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
Copy file name to clipboardExpand all lines: book/plugins.md
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,41 @@ Nu can be extended using plugins. Plugins behave much like Nu's built-in command
4
4
5
5
Nu plugins are executables; Nu launches them as needed and communicates with them over [stdin, stdout, and stderr](https://en.wikipedia.org/wiki/Standard_streams). Nu plugins can use either JSON or MSGPACK as their communication encoding.
6
6
7
-
## Adding a plugin
7
+
## Downloading and installing a plugin
8
8
9
-
To add a plugin, call the [`register`](/commands/docs/register.md) command to tell Nu where to find it. As you do, you'll need to also tell Nushell what encoding the plugin uses.
9
+
::: warning
10
+
11
+
Please note that plugin installation methods are still under heavy development and that the following workflow will be refined before the release of 1.0. The nupm official package manager should simplify installation in the future when it becomes ready for general use.
12
+
13
+
:::
14
+
15
+
To install a plugin on your system, you first need to make sure that the plugin uses the same version of Nu as your system.
16
+
17
+
```nu
18
+
> version
19
+
```
20
+
21
+
Find plugins that have the exact same Nushell version either on crates.io, online git repositories or [`awesome-nu`](https://github.com/nushell/awesome-nu/blob/main/plugin_details.md). You can find which version the plugin uses by checking the Cargo.toml file.
22
+
23
+
To install a plugin by name from crates.io, run:
24
+
25
+
```nu
26
+
> cargo install plugin_name
27
+
```
28
+
29
+
If you chose to download the git repository instead, run this when inside the cloned repository:
30
+
31
+
```nu
32
+
> cargo install --path .
33
+
```
34
+
35
+
This will create a binary file that can be used to register the plugin.
36
+
37
+
Keep in mind that when installing using crates.io, the binary can be saved in different locations depending on how your system is set up. A typical location is in the users's home directory under .cargo/bin.
38
+
39
+
## Registering a plugin
40
+
41
+
To enable an installed plugin, call the [`register`](/commands/docs/register.md) command to tell Nu where to find it. As you do, you'll need to also tell Nushell what encoding the plugin uses.
10
42
11
43
Please note that the plugin name needs to start with `nu_plugin_`, Nu uses the name prefix to detect plugins.
0 commit comments