Skip to content

Commit 428df89

Browse files
committed
plugin cache file ⇒ plugin registry file
1 parent 44b4855 commit 428df89

File tree

1 file changed

+43
-33
lines changed

1 file changed

+43
-33
lines changed

blog/2024-04-30-nushell_0_93_0.md

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ author_site: https://twitter.com/nu_shell
55
author_image: https://www.nushell.sh/blog/images/nu_logo.png
66
excerpt: Today, we're releasing version 0.93.0 of Nu. This release adds...
77
---
8+
89
<!-- TODO: complete the excerpt above -->
910

1011
# Nushell 0.93.0
1112

1213
Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your command line. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful command line pipelines.
1314

1415
<!-- TODO: write this excerpt -->
16+
1517
Today, we're releasing version 0.93.0 of Nu. This release adds...
1618

1719
# Where to get it
@@ -99,7 +101,7 @@ We now have two commands to replace `register` that break this functionality int
99101
The previous example would now be equivalent to this, at the REPL:
100102

101103
```nushell
102-
# Add the plugin's commands to your plugin cache file:
104+
# Add the plugin's commands to your plugin registry file:
103105
> plugin add ~/.cargo/bin/nu_plugin_gstat
104106
105107
# Load it into scope:
@@ -108,37 +110,38 @@ The previous example would now be equivalent to this, at the REPL:
108110

109111
Note that this _will not_ work in a script in this order, as `plugin use` is a [parser command](/book/thinking_in_nu.md#think-of-nushell-as-a-compiled-language) and would get evaluated first. If you would like to make sure a certain plugin is available in a script, there are a few options:
110112

111-
1. Prepare a plugin cache file in advance, and use `--plugin-config` with `plugin use`:
112-
```nushell
113-
plugin use --plugin-config /path/to/custom.msgpackz your_required_plugin
114-
```
113+
1. Prepare a plugin registry file in advance, and use `--plugin-config` with `plugin use`:
114+
```nushell
115+
plugin use --plugin-config /path/to/custom.msgpackz your_required_plugin
116+
```
115117
2. The same thing, but pass the `plugin config` to `nu`:
116-
```nushell
117-
nu --plugin-config /path/to/custom.msgpackz your-script.nu
118-
```
119-
3. Pass a NUON list to `--plugins` (new in 0.93) to `nu`, to use plugins without a cache file:
120-
```nushell
121-
nu --plugins '[/path/to/nu_plugin_your_required_plugin]' your-script.nu
122-
123-
# or you can use `to nuon` from inside nu:
124-
let plugins = [
125-
'/path/to/nu_plugin_foo'
126-
'/path/to/nu_plugin_bar'
127-
]
128-
nu --plugins ($plugins | to nuon) your-script.nu
129-
```
118+
```nushell
119+
nu --plugin-config /path/to/custom.msgpackz your-script.nu
120+
```
121+
3. Pass a NUON list to `--plugins` (new in 0.93) to `nu`, to use plugins without a registry file:
122+
123+
```nushell
124+
nu --plugins '[/path/to/nu_plugin_your_required_plugin]' your-script.nu
130125
131-
The last option will run the plugin to get signatures at startup, without modifying the user's cache file, and can even be used when `--no-config-file` is specified.
126+
# or you can use `to nuon` from inside nu:
127+
let plugins = [
128+
'/path/to/nu_plugin_foo'
129+
'/path/to/nu_plugin_bar'
130+
]
131+
nu --plugins ($plugins | to nuon) your-script.nu
132+
```
132133

133-
Finally, we have also added [`plugin rm`](#plugin-rm-toc), which removes a plugin from the cache file. This was something that previously needed to be done manually in a text editor, but is made possible by the new format.
134+
The last option will run the plugin to get signatures at startup, without modifying the user's registry file, and can even be used when `--no-config-file` is specified.
134135

135-
## New plugin cache format [[toc](#table-of-content)]
136+
Finally, we have also added [`plugin rm`](#plugin-rm-toc), which removes a plugin from the registry file. This was something that previously needed to be done manually in a text editor, but is made possible by the new format.
137+
138+
## New plugin registry format [[toc](#table-of-content)]
136139

137140
::: warning Breaking change
138141
See a full overview of the [breaking changes](#breaking-changes)
139142
:::
140143

141-
The plugin cache format has been changed from the previous Nushell script format (containing a sequence of `register` commands) to a custom, declarative format based on [MessagePack](https://msgpack.org/) compressed with [brotli](https://github.com/google/brotli). This new format is called `msgpackz`, and the default plugin file is `plugin.msgpackz` instead of `plugin.nu`.
144+
The plugin registry format has been changed from the previous Nushell script format (containing a sequence of `register` commands) to a custom, declarative format based on [MessagePack](https://msgpack.org/) compressed with [brotli](https://github.com/google/brotli). This new format is called `msgpackz`, and the default plugin file is `plugin.msgpackz` instead of `plugin.nu`.
142145

143146
Your existing `plugin.nu` file will be automatically upgraded to `plugin.msgpackz` the first time version 0.93 runs.
144147

@@ -157,7 +160,7 @@ The most significantly _breaking_ part of this breaking change is that the follo
157160
source $nu.plugin-file
158161
```
159162

160-
You can use the [`plugin use`](#plugin-use-toc) command instead to (re-)load a specific plugin from the plugin cache file:
163+
You can use the [`plugin use`](#plugin-use-toc) command instead to (re-)load a specific plugin from the plugin registry file:
161164

162165
```nushell
163166
> plugin use gstat
@@ -172,32 +175,36 @@ This frees up stdio for interaction with the user's terminal, which makes plugin
172175
We also added [engine calls](/contributor-book/plugin_protocol_reference.md#enterforeground-engine-call) for moving the plugin into the terminal controlling (foreground) process group, mainly for Unix platforms. This was also necessary to fully support terminal UI plugins, after the last release's new persistence functionality caused plugins to run in a new, background process group by default.
173176

174177
## Hall of fame [[toc](#table-of-content)]
178+
175179
### Bug fixes [[toc](#table-of-content)]
180+
176181
Thanks to all the contributors below for helping us solve issues and bugs :pray:
177-
| author | description | url |
182+
| author | description | url |
178183
| ------------------------------------ | ----------- | ------------------------------------------------------- |
179-
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
184+
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
180185

181186
### Enhancing the documentation [[toc](#table-of-content)]
187+
182188
Thanks to all the contributors below for helping us making the documentation of Nushell commands better :pray:
183-
| author | description | url |
189+
| author | description | url |
184190
| ------------------------------------ | ----------- | ------------------------------------------------------- |
185-
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
191+
| [@author](https://github.com/author) | ... | [#12345](https://github.com/nushell/nushell/pull/12345) |
186192

187193
## Our set of commands is evolving [[toc](#table-of-content)]
194+
188195
As usual, new release rhyms with changes to commands!
189196

190197
### New commands [[toc](#table-of-content)]
191198

192199
#### `plugin add` [[toc](#table-of-content)]
193200

194-
Adds a plugin to the plugin cache file (default `$nu.plugin-path`).
201+
Adds a plugin to the plugin registry file (default `$nu.plugin-path`).
195202

196203
```nushell
197204
plugin add ~/.cargo/bin/nu_plugin_gstat
198205
```
199206

200-
A different cache file can be used if desired:
207+
A different registry file can be used if desired:
201208

202209
```nushell
203210
plugin add --plugin-config ~/polars.msgpackz ~/.cargo/bin/nu_plugin_polars
@@ -211,7 +218,7 @@ glob ~/.cargo/bin/nu_plugin_* | each { |file| plugin add $file }
211218

212219
#### `plugin rm` [[toc](#table-of-content)]
213220

214-
Removes a plugin from the plugin cache file (default `$nu.plugin-path`).
221+
Removes a plugin from the plugin registry file (default `$nu.plugin-path`).
215222

216223
```nushell
217224
plugin rm gstat
@@ -222,11 +229,12 @@ The commands will still remain in scope, but will not be present the next time `
222229

223230
#### `plugin use` [[toc](#table-of-content)]
224231

225-
Loads a plugin from the plugin cache file (default `$nu.plugin-path`) **at parse time**.
232+
Loads a plugin from the plugin registry file (default `$nu.plugin-path`) **at parse time**.
226233

227-
This replaces the other part of `register` - actually adding the commands to scope. It does not run the plugin executable, though, it just loads the [previously added](#plugin-add-toc) commands from the cache file.
234+
This replaces the other part of `register` - actually adding the commands to scope. It does not run the plugin executable, though, it just loads the [previously added](#plugin-add-toc) commands from the registry file.
228235

229236
### Changes to existing commands [[toc](#table-of-content)]
237+
230238
### Deprecated commands [[toc](#table-of-content)]
231239

232240
#### `register` [[toc](#table-of-content)]
@@ -278,6 +286,7 @@ See the [Rust docs for `EngineInterface`](https://docs.rs/nu-plugin/0.93.0/nu_pl
278286
-->
279287

280288
# Breaking changes [[toc](#table-of-content)]
289+
281290
<!-- TODO:
282291
paste the output of
283292
```nu
@@ -287,6 +296,7 @@ See the [Rust docs for `EngineInterface`](https://docs.rs/nu-plugin/0.93.0/nu_pl
287296
-->
288297

289298
# Full changelog [[toc](#table-of-content)]
299+
290300
<!-- TODO:
291301
paste the output of
292302
```nu

0 commit comments

Comments
 (0)