Home Explore Blog CI



nushell

17th chunk of `blog/2022-03-22-nushell_0_60.md`
1aa8c32053419ac70e6d458d908a72e1ea27ee745aaf3daf0000000100001031
Also, the new plugin architecture is now multi-protocol, allowing you to pick the right protocol for your plugin. We currently support json and have experimental support for capnp.

By the way, you are not limited to write plugins in Rust. You can even create a python script and use it as a Nushell plugin. You only need to
specify what command should be used to run the plugin

```
> register -e json -s python ~/my_plugins/plugin.py
```

Nushell now has three optional plugins (all using 'json' serialization):

- `inc`: a value/version incrementor
- `gstat`: a git stats viewer
- `query`: a set of three commands for querying data

# Breaking changes

There are quite a number of breaking changes as we fixed design flaws, cleaned up the design, and rethought how commands should work.

| Nushell 0.44                             | Nushell 0.60                                                                                                                                                                                                       |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| if { } { }                               | if { } else { }                                                                                                                                                                                                    |
| str trim -rc (char nl)                   | str trim -r -c (char nl)                                                                                                                                                                                           |
| config.toml                              | config.nu (find location with `$nu.config-path`)                                                                                                                                                                   |
| let-env FOO = $nothing                   | hide $FOO                                                                                                                                                                                                          |
| $nu.home-dir                             | $nu.home-path                                                                                                                                                                                                      |
| $nu.temp-dir                             | $nu.temp-path                                                                                                                                                                                                      |
| `$true` and `$false`                     | now `true` and `false`                                                                                                                                                                                             |
| config commands                          | $config                                                                                                                                                                                                            |
| `$nu.env`                                | `$nu.env` is now `$env`                                                                                                                                                                                            |
| $nu.path                                 | `$env.PATH`/`$env.Path` <- can do more in config.nu                                                                                                                                                                |
| $nu.lang                                 | $nu.scope.commands                                                                                                                                                                                                 |

Title: Plugin Architecture and Breaking Changes in Nushell 0.60
Summary
This section outlines the multi-protocol plugin architecture in Nushell 0.60, allowing plugins to be written in languages other than Rust, such as Python. It also details several breaking changes from Nushell 0.44 to 0.60, including changes to conditional statements, string trimming, configuration files, environment variable handling, boolean values, configuration commands, and access to environment variables and command scopes.