Skip to content

Nushell

1 post with the tag “Nushell”

Scripting is More Fun With Nushell

There are multiple ways to improve your experience in the terminal. You can get a nice prompt with starship. On Linux and macOS, you can switch to the fish shell. A lot of nice things like syntax highlighting, tab completion with help text and inline suggestions simply work out of the box.

However, I went for Nushell. Unlike fish, Nu also works on Windows. Nu’s interactive experience is nearly as nice as fish’s out-of-the-box and just as nice with a few configuration tweaks. Since I don’t use Windows as my daily driver that shouldn’t matter all that much to me, but it can be an extra benefit.

Another common way of use case of shells is for scripting. After experimenting with commands in your terminal, you put the very same commands in a text file. In the case of Nu, you then execute that script with nu script.nu. This is the workflow where shells shine, and Nu is a prime example for that.

So let’s take a look at the pitch on Nu’s homepage:

Nu pipelines use structured data so you can safely select, filter, and sort the same way every time. Stop parsing strings and start solving problems.

When I first read this, it didn’t really resonate with me. Maybe I didn’t write enough shell scripts at that time.