Nushell 0.62

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 version 0.62 of Nu. This release deeper integration with SQLite, new completion logic, and much more.

Where to get it

Nu 0.62 is available as pre-built binariesopen in new window or from crates.ioopen in new window. If you have Rust installed you can install it using cargo install nu.

A note on this release: The binaries published by the Nu team now include a statically linked copy of the OpenSSL library (previously Nu used a shared library, AKA 'dynamic linking'). The goal of this change is to make Nu simpler to deploy with fewer dependencies.

This feature is enabled by the "static-link-openssl" Cargo feature, so it's easy to disable if needed when building Nu.

If you want all the built-in goodies, you can install cargo install nu --features=extra.

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

Database connectivity (rgwood, elferherrera, fdncred)

A gap in the "Nushell story" up to this point has been that although Nushell is a language and shell focused on data, there wasn't yet any ability to query databases and work with their data. With 0.62, we take our first step in that direction.

New in this release is the db command, which allows you to connect to a SQLite database and create a SQL query to run on it:

  > db open db.sqlite
    | db from table_a
    | db select a
    | db limit 10
    | db describe

With the db open command we open a connection to the database, then subsequent db commands build up a query step by step. One new twist with db for Nushell is that the query is built lazily, and will only be run once the data is needed.

Queries can also be written as raw SQL:

  > db open db.sqlite | db query "SELECT a FROM table_a LIMIT 10"

And finally, the open command has been updated to be SQLite-aware:

  > open db.sqlite

In all of the queries above, db open db.sqlite could be replaced by open db.sqlite; open is able to detect databases by looking at file contents.

Full translation of the book to Chinese (hustcer)

The book is now fully translated to Chinese (zh-CN)open in new window. Huge shout-out to hustcer for doing all the work on the translation!

More completions (herlon214, jt)

Nushell can now complete record fields, cell paths in variables created in previous REPL runs, and more.

Starting with 0.62, Nushell will prefer to wrap filenames with spaces in backticks when completing. This allows for filenames to have single quotes, while also being compatible with upcoming improvements in filename handling.

New commands

Quality-of-life Improvements

  • ctrl+o - opens your editor of choice to edit line input (elferherrera)

    • Make sure to set buffer_editor in your configuration so Nushell can find your editor
  • You can use () in create filenames. eg) ls ./($dirname) (jt)

    • Note: this currently only works if the () isn't the start of the filepath
  • ctrl+c now breaks in more cases (gipsyh)

  • $nu.os-info can give you information about the platform Nushell is running on. (fdncred)

  • ~user is now a known path shorthand (merelymyself)'

  • Errors now have helpful descriptions that will show up in the error docs. (zkat)

  • Nushell now has better shell integrationopen in new window for terminals like kitty. (schrieveslaach)

  • Note: this is a shortened list. For the full list, see the "Changelog" section below

Breaking changes

  • ^= is now starts-with
  • config is now an environment variable
    • To update, move let config = ... to let-env config = ...
    • This change was done for performance reasons and gives considerable performance improvements in some use cases.

Looking ahead

The db command joins the dfr command in a set of experiments we're working on to better understand how to integrate Nushell with a wider set of data sources. Coming up soon are "lazy dataframes". These, like the new db command, will allow you to build up a query against a dataframe before you execute it. This allows for much more efficient processing of the request against the data source.

The Nushell design team is deep in discussions about how to make this more universal, allowing the Nushell language to build up queries lazily against a data source, and allowing the data source to perform the optimal native query. There's more research to do here, but we're looking forward to being able to take what we've learned and grow the Nushell language. In the end, we hope, you won't need separate command sets for each data source type. Instead, you'll be able to connect and build your query all in the base Nushell language.




Nu scripts