Nushell 0.16.0

Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. 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 commandline pipelines.

Today, we’re releasing 0.16 of Nu

Where to get it

Nu 0.16.0 is available as pre-built binaries or from crates.io. If you have Rust installed you can install it using cargo install nu.

If you want more goodies, you can install cargo install nu --features=stable.

As part of this release, we also publish a set of plugins you can install and use with Nu. To install, use cargo install nu_plugin_<plugin name>.

What’s New

New automated release binaries (charlespierce, fdncred, jonathandturner)

Up to this point, we’ve hand-rolled all the binary releases. The process has been time-consuming and error-prone. Starting with 0.16.0, we’ll be releasing using the GitHub release automation. The first benefits you’ll see is that we’ve also added a wix-based installer for Windows users. The second, perhaps harder to see, benefit is a more relaxed release process that’s easier on the project maintainers :)

Please note: as part of this, we took the opportunity to also align the directory structure across platforms. Apologies in advance for any inconvenience this might cause.

New textview (fdncred)

We’ve had a few requests for an improved text viewing experience, so with 0.16.0 we’re trying out a new viewer based on the bat crate. We also support quite a lot of configuration settings for this new text viewer.

New commands

Let’s get random (JosephTLyons)

We have a new top-level command: random. To start, there are three sub-commands:

More math (JosephTLyons, arashout, andrasio, amousa11)

We’ve consolidated and added to our math operations. Now available as part of the 0.16.0 release:

Other commands

Custom prompts (jonathandturner)

You can now run a pipeline which returns a string, or list of strings, that is used to create a custom prompt. To do so, set the pipeline you want to use in the config for the prompt setting.

A simple example:

> config --set [prompt "echo '> '"]

We’ve also added a new ansi command to let you change the color. Let’s use it to change the prompt to blue:

> config --set [prompt "echo $(ansi blue) '> '"]

You can make the prompt even fancier. For example, this prompt prints the current directory, git branch, and current date and time:

> config --set [prompt 'echo [ $(ansi green) $(pwd) $(ansi reset) $(do -i {git rev-parse --abbrev-ref HEAD } | trim | echo [ "(" $(ansi blue) $it $(ansi reset) ")" ] | str collect) $(char newline) $(ansi cyan) $(date --format "%d/%m/%Y %H:%M:%S").formatted $(ansi reset) "> " ]']

image of full prompt

Example of full prompt

Or update your prompt to show an abbreviated path:

> config --set [prompt 'echo [ $(ansi green) $(pwd | split row "/" | first $(pwd | split row "/" | count | = $it - 1 ) | each { str substring "0,1" | format "{$it}/" } | append $(pwd | split row "/" | last ) | str collect) $(do -i { git rev-parse --abbrev-ref HEAD | trim | echo $(ansi reset) "(" $(ansi blue) $it $(ansi reset) ")" | str collect }) $(ansi reset) "> "]']

(note: the above assumes Unix-based systems, so on Windows use “" as the path separator))

image of abbreviated prompt

Example of abbreviated prompt

RFC process (jzaefferer)

We now have an RFC process if you want to propose new features and breaking changes to Nu. Come let us know what you think and share your vision with us.

Starship becomes optional (fdncred)

We’ve made enabling starship a configuration option, rather than always being on. This allows you to opt-in, if you’d like the starship experience, but removes the requirement that you have to know to build without starship if you’d rather not have it (which may not be possible if you’re using binary releases).

To enable starship, set the use_starship setting:

> config --set [use_starship $true]

New table drawing (jonathandturner)

With 0.16.0, we now use a new table drawing algorithm. Here’s the before and after for comparison:

image of a table before

Table drawn with 0.15.0

image of a table before

Table drawn with 0.16.0

If you’re struggling to see much difference, that’s a good thing! Where you’ll really see the difference is in the time it takes to draw these tables:

image of a table before

0.16.0 renders tables 40% faster than 0.15.0

Simplified Chinese Nu book (zombie110year)

Over the past few weeks we’ve seen steady progress on the Simplified Chinese translation of the Nu book. With this release, another set of translated chapters were added.

Command improvements

Internal improvements

Looking ahead

We are looking into a few areas for the next release: further improving our per-directory environments, improving compile times, continuing to do code cleanup and pay down tech debt, and possibly more.