# Nushell 0.14.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.

We're excited to release version 0.14.0 of Nu!

# Where to get it

Nu 0.14.0 is available as pre-built binaries (opens new window) or from crates.io (opens new window). 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

# Temporary environment variables (jonathandturner)

A feature requested by many, many folks is finally here. Up until now, to change an environment variable, you had to update the config settings, and then these changes would be permanent. This makes working with certain kinds of commands, which need some additional environment information, annoying to use.

With 0.14.0, you'll now be able to temporarily set an environment variable. To do so, you can use the new with-env command. This command takes the variable/value pair and the block to run once the environment is set:

> with-env [DEBUG true] { command arg1 arg2 }

Bash, as well as many other shells, use a handy shorthand form, which we also now support. You can write the above as:

> DEBUG=true command arg1 arg2

# Starting things off right (1ntEgr8)

Modern desktops have a way to associate file types with applications and often have a way to run that application automatically when you open a file of that type. In macOS, you can use the open command, start on Windows, and a variety of related start command in Linux.

In 0.14.0, we've added a unified start command that works across platforms that will run the associated application for a file type. For example, if you've associated your .py files with VSCode, you can edit them now using start myfile.py.

# Nu gets a calendar (JosephTLyons)

A fun surprise for this release is the recently-added cal command, which will give you a calendar in table form.

> cal
───┬────────┬────────┬─────────┬───────────┬──────────┬────────┬──────────
 # │ sunday │ monday │ tuesday │ wednesday │ thursday │ friday │ saturday
───┼────────┼────────┼─────────┼───────────┼──────────┼────────┼──────────
 0 │        │        │         │           │          │      1 │        2
 1 │      3 │      4 │       5 │         6 │        7 │      8 │        9
 2 │     10 │     11 │      12 │        13 │       14 │     15 │       16
 3 │     17 │     18 │      19 │        20 │       21 │     22 │       23
 4 │     24 │     25 │      26 │        27 │       28 │     29 │       30
 5 │     31 │        │         │           │          │        │
───┴────────┴────────┴─────────┴───────────┴──────────┴────────┴──────────

You can pass in flags to give you additional columns for the year, month, and even get calendars from the past or future.

# Commands get some helpful examples (elichai)

A last minute update also gave us a big improvement in our built-in help. Starting with 0.14, we'll now have examples as part of the help commands can use:

image of new command help with colored example

We're working to add examples to all commands. If that's something you're interested in helping with, come join us on discord (opens new window).

# Subcommands (jonathandturner)

As we fill out more forms of commands that Nu can represent, one type that we weren't able to do was subcommands. This meant all of our commands were at the top level, making it more difficult to find what you needed. Additionally, many external commands use subcommands, which meant we had no way to effectively wrap them in Nu.

With 0.14, you can now define subcommands. Subcommands each get a unique signature which has its own coloring, autocomplete, etc.

> open myfile.txt | from csv --headerless

# Breaking changes: renaming some commands (jonathandturner, andrasio)

You may have noticed above that the from-csv is now from csv, that is, the csv part is now a subcommand of the from command. We've moved all from-* and to-* commands to be subcommands. This change was requested by users as part of an effort to streamline how conversion commands work.

Another set of changes requested by users was to update the names of some of the commands to the more common forms:

  • pick is now select. This matches more closely with SQL, LINQ, and shells with similar functionality.
  • edit is now update

While we are cautious to take breaking changes, we're confident - judging from user feedback - that these changes make Nu more ergonomic and easier to learn.

# ls learns read directory sizes (JosephTLyons)

A few users have wondered why Nu doesn't print the full directory size as part of ls. With 0.14, you'll now be able to get just that with the new --du argument to ls. Note: this isn't enabled by default as calculating the directory size can take quite a lot of processing.

# Startup speedups (fdncred)

It's important to make a good first impression, and with this release Nu gets a speed boost for the initial startup. It will now load plugins in parallel rather than one after another. In some cases, this can lead to startups 3x-4x faster than previous versions.

# Auto-cd speedups (quebin31)

We've also gotten a boost when using the automatic change directory. You'll notice that 0.14 is a lot snappier when you type a directory to automatically jump to.

# Lots of new commands

  • from eml (aeshirey) - have lots of saved emails lying around and want to process them? With 0.14, you can now easily load them into Nu
  • empty? (andrasio) - you can now check multiple columns for emptiness, and if empty, give them a value
  • skip-until, keep-while, keep-until (andrasio) - similar to skip-while, you can optionally skip or keep rows if they meet a condition or until they meet a condition
  • merge (andrasio) - ever have two related tables and wish you could merge them into one? The new merge command can help you do that
  • not-in: operator (jonathandturner) - going along with the in: operator is the new not-in:, which checks that a value isn't in the given list

# It-expansion (jonathandturner, thegedge)

We've streamlined how $it is handled. The $it variable has always implied iteration ($it gets the name from iteration, item, and being "it"). In 0.14, we've made this more explicit with an expansion that happens inside of Nu.

Now, with Nu sees an $it, it expands it to a full each call.

> ls | echo $it.name

Internally, now expands to:

> ls | each { echo $it.name }

This helps us be more uniform about when iteration will happen. We've also updated how externals are handled so they can take advantage of this, making them work a lot more closely with how internals work.

# Doc and book updates (nespera, jonathandturner, fdncred, jzaefferer, siedentop)

We're continuing to fill out help information on each of the commands. This release adds a few more to the list of documented commands.

The book (opens new window) has also gone through a big revision to bring it up-to-date with the 0.14 release. We've also added tables to help you transition from Bash, PowerShell, SQL, and LINQ. A big thanks to our contributors to help find and fix issues. There's more work to do here. If you're writing-inclined, come join us!

# Bugfixes and polish (quebin31, BurNiinTree, avandesa, pka, homburg, rimathia, thegedge, jonathandturner, mhmdanas, JesterOrNot)

Lots of bugfixes and polish for this release. A big "thanks!" to everyone that joined in and filed bugs, fixed bugs, and gave feedback on discord, github, and twitter.

# Looking forward

We've got lots of fun things planned for upcoming releases: more intelligent autocomplete, autocomplete for popular external commands, and more streamlining of the engine itself.

If you'd like to help out by writing code, writing docs, helping with the website, or just have an idea, come join us on discord (opens new window) or github (opens new window). We'd love to hear from you!