Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
GitHub

Nushell 0.83

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

Today, we're releasing version 0.83 of Nu. This release adds match guards, stronger type checking features, unit testing improvements, flexible variable initializations, and more.

Where to get it

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

NOTE: The optional dataframe functionality is available by cargo install nu --features=dataframe.

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>.

Themes of this release / New features

Fixes, stabilization and shoutouts

NameLinkDescription
@WindSoilder9747Redirection: make o>, e>, o+e>'s target support variables and string interpolation
@kubouch9679Fix broken constants in scopes
@rusty-jules9594Fix: return all headers with the same name from http <method>
@baehyunsol9582make the behaviours of last and first more consistent
@hanjunghyuk9623Fix explore crashes on {}
@YassineHaouzane9616Fix: update engine_state when history.isolation is true (#9268)
@IanManske9603Fix headers command handling of missing values
@AyushSingh139580fixes which showing aliases as built-in nushell commands
@mengsuenyan9662fix the command cp -u src dst/mv -u src dst doesn't work when the…

Changes to commands

Since last release, some commands have changed and some have been created, here is a list of some changes and what they mean:

  • @amtoine in #9646: which returns the type of the command instead of only whether it is builtin or not and uses more explicit column names
  • @atahabaki in #9750: str expand now allows empty member in brace expansion, e.g. A{,B,C} would expand to [A, AB, AC]
  • @fdncred in #9669: keybinding listen gives more information about keys like home and end, namely their kind and state
  • @NotLebedev in #9453: input listen allows to query for a single key press, e.g. the following will take a 4-char input 1..4 | each { input listen } | where key_type == char | get code | str join
  • @kubouch in #9687: path commands lose the -c flag; instead, use update to update table columns

Command set refinement efforts

Again with this new release, we are continuing refining our set of core commands. As part of this, another set of commands have moved to extra. Thanks to folks who are helping our efforts on the road to 1.0!

Note No command has been removed completely, they have just been moved in the extra feature of Nushell. simply use cargo ... --features extra to reenable them.

Math commands have been moved by @stormasm in #9674, #9657 and #9647 and the following commands have been moved in #9404: fmt, each while, roll, roll down, roll left, roll right, roll up, rotate, update cells, decode hex, encode hex, from url, to html, ansi gradient, ansi linkand format

Language improvements

Since last release, a few changes have happened to the Nu language itself.

Declaration and assignment of variables

Until now, declaration keywords such as let and mut have required the use of parentheses around pipelines to assign the output of a chain of command to a variable. Thanks to @sophiajt in #9658 and #9589, this syntax has been relaxed for let and mut. Let's give some examples!

let filenames = ls | where type == file | get name

and

mut my_var = "hello world" | str length

are now completely valid Nushell code.

Note this new syntax does not work on const and it does not apply to assignment of values to variables, e.g.

$env.FILENAMES = ls | where type == file | get name

is not parsed as valid Nushell.

Another parser improvement has to do with the use of if and match in variable assignment. In #9650, @Windsoilder made the following Nushell snippets possible:

mut a = 3
$a = if 4 == 3 { 10 } else {20}

and

$env.BUILD_EXT = match 3 { 1 => { 'yes!' }, _ => { 'no!' } }

Input / output type checking and annotations (@sophiajt)

Nushell as a language is more strictly typed than other shell languages. However, not everything was type-checked nor possible to annotate and this new release tries to fill this gap a bit more.

Note in the following of this section, the term input / output signature is used. This describes the input of a command and the associated output type of the command for the given input type, e.g. in ls | get 0.name the input type of get is a table and its output type is a string, so we can say that the input / output signature of get here is table -> string.

Please note that input / output signatures always come in pair.

First, #9686 makes the input / output type signatures clearer in the help pages of commands. Then, #9690 and #9680 enable input / output type annotations on custom commands and enforce a strong type checking on the input and output of commands. This means a few things

  • the input / output of custom commands can be annotated
def sum []: list<int> -> int {
    math sum
}
  • some type-invalid calls to commands are now parsed as an error, e.g. 123 | get foo gives the following error
Error: nu::parser::input_type_mismatch

  × Command does not support int input.
   ╭─[entry #2:1:1]
 1 │ 123 | get foo
   ·       ─┬─
   ·        ╰── command doesn't support int input
   ╰────

This is still a work in progress, so some commands might have incorrect or missing input / output type annotations 😮 This is expected and we worked and are working on this to fix all incorrect signatures (#9755, #9749, #9707, #9706, #9695, #9683, #9775, #9741, #9742, #9739 and #9778)!

Shoutouts

In between the two releases, @1Kinoti has worked on some nice improvements to the language

  • match guards have been added to the match command in #9621
  • table types can now have parameters, just as records and lists can, thanks to #9613
  • structural subtyping has been improved in #9614 and allow to match structured types regardless of the orders of the fields

Configuration tweaks

Contributions have been made to give a more consistent and sensible default experience in Nushell, both when using the default_config.nu config file or when not having a config, e.g. with nu -n. A better right prompt has been written in #9585 and #9581 and the default configuration has been polished in #9676.

The standard library

The biggest topic in this 0.83 release for the standard library has been the test runner!

Thanks to @Yethal, the test runner of the standard library can now use annotations to decide whether or not to run a command as part of the test suite of a project: #9628, #9622, #9611 and #9406.

For instance, we can now write a module as follows

def add [a: int, b: int] {
    $a + $b
}

#[test]
def addition [] {
    use std assert
    assert equal (add 1 2) 3
}

and std testing run-tests would successfully run the addition test, no need to define tests with test_ in their names!

Thanks to @Hofer-Julian (#9607), the standard library now also comes with a pwd command that tells you were you are in the filesystem.

Breaking changes

PLEASE NOTE: there are some big breaking changes in this release. These include:

  • Removal of let-env (now use the $env.FOO = "BAR" form instead)
  • Stricter checking of input/output types
  • Transitioning of a set of commands to now be available via extra feature rather than default

Full list of breaking changes:

  • #9574 remove let-env, focus on mutating $env
  • #9587 disallow blocks as first-class values
  • #9589 let no longer allows bareword assignment (Eg, let foo = bar where bar is assumed to be a string)
  • #9582 make the behaviours of last and first more consistent
  • #9594 Fix: return all headers with the same name from http <method>
  • #9646 change the output of which to be more explicit
  • #9404 #9647 #9657 - a number of commands have been moved to extra
  • #9680 Input output checking
  • #9613 allow table types to have parameters
  • #9687 Refactor path commands
  • #9690 The extern command has split into extern and extern-wrapped, the latter allowing a block to be called when calling an extern

Full changelog

Nushell

  • sholderbach created
    • Adjust signatures for cellpath access of tables
    • Update nu-ansi-term, lscolors, and reedline
    • Abort type determination for List early
    • Fix output signature of split chars/words
    • Use explicit in/out list types for vectorized commands
    • Add explicit input types for vectorized into int form
    • Remove underused devdep getset
    • Clean up tests containing unnecessary cwd: tokens
    • Use is-terminal crate for now
    • Bump deps to transitively use hashbrown 0.14
    • Apply nightly clippy lints
    • Update reedline dev version lock
    • Bump indexmap to 2.0
    • Remove duplicated dependency on ansi-str 0.7
    • Update proc-macro2 lock, fix nightly build
    • Exclude deprecated commands from completions
    • Document fn pipeline() used with nu! tests
    • Remove unnecessary parentheses
  • app/dependabot created
    • Bump pretty_assertions from 1.3.0 to 1.4.0
    • Bump tempfile from 3.6.0 to 3.7.0
    • Bump miette from 5.9.0 to 5.10.0
    • Bump strum_macros from 0.24.3 to 0.25.1
    • Bump strum from 0.24.1 to 0.25.0
    • Bump scraper from 0.16.0 to 0.17.1
    • Bump libproc from 0.13.0 to 0.14.0
    • Bump tempfile from 3.5.0 to 3.6.0
    • Bump calamine from 0.19.1 to 0.21.2
    • Bump ureq from 2.6.2 to 2.7.1
    • Bump open from 4.1.0 to 5.0.0
  • amtoine created
    • add table -> table to into datetime
    • change the output of which to be more explicit
    • add any -> record to metadata
    • sync default config / env with default behaviour without any configuration
    • allow into filesize to take tables as input / output
    • simplify the test for let core command
    • fix the std test commands calls in dev documents
    • refactor the CI
    • REFACTOR: move the 0% commands to nu-cmd-extra
    • simplify the nu! tests for last and first commands
  • hexavik created
    • Fix: remove unnecessary r#"..."# (#8670)
  • mengsuenyan created
    • fix #9653 the cmd detect columns with the flag -c
    • fix the command cp -u src dst/mv -u src dst doesn't work when the…
  • IanManske created
    • Add functions for each Value case
    • nushell should be non-interactive if --testbin is supplied
    • Do not attempt to take control of terminal in non-interactive mode
    • Fix SIGTTIN handling
    • Fix headers command handling of missing values
  • fdncred created
    • update history_isolation to false
    • change the default of history.isolation
    • handle sqlite tables better by surrounding with brackets
    • add range input to par-each
    • normalize default_config/env formatting
    • allow range as a input_output_type on filter
    • update rust toolchain to 1.69.0
    • add more input_output_types found from breaking scripts
    • add kind and state to other key presses
    • fix right prompt in the default_env.nu
    • fix typo in deprecated message: $nu should be $env
    • update ide-check help text
    • add input_output type to input list to return string
    • convert a string to a raw binary string of 0s and 1s
    • update sqlparser dep to 0.34
  • atahabaki created
    • str-expand: new capability, empty collection item
    • A new subcommand to str, str-expand.
  • sophiajt created
    • Fix capture logic for inner closures
    • fix input signature of let/mut
    • Revert "Fix SIGTTIN handling"
    • Custom command input/output types
    • Change input/output types in help to a table
    • Input output checking
    • Remove broken compile-time overload system
    • allow mut to take pipelines
    • Move to using a safer shell integration default setting
    • Let with pipeline
    • disallow blocks as first-class values
    • use an easier-to-read date format in prompt
    • fix a few clippy issues
    • remove let-env, focus on mutating $env
    • Improve type hovers
  • cramt created
    • fix removing symlinks on windows
  • WindSoilder created
    • Redirection: make o>, e>, o+e>'s target support variables and string interpolation
    • support env assignment and mutable variable assignment with if block and match guard
    • dependency: use notify-debouncer-full(based on notify v6) instead of notify v4
    • Bracketed paste refactor
    • fix cd permissions when user belongs to folder group
    • rename: add -b flag to support closure input
  • stormasm created
    • add in a Readme for the crate nu-cmd-extra
    • remove warning: unused import pipeline
    • cratification: part III of the math commands to nu-cmd-extra
    • cratification: part II of the math commands to nu-cmd-extra
    • cratification: start moving over the math commands to nu-cmd-extra
  • dmatos2012 created
    • Disallow empty record with empty key,value pairs on ini format
  • nibon7 created
    • Remove is-root crate
    • Replace users with nix crate
    • Fix cargo-build-nu
    • Refactor cargo-build-nu
    • Fix release workflows
  • 1Kinoti created
    • add match guards
    • allow tables to have annotations
    • improve subtyping
  • kubouch created
    • Refactor path commands
    • Fix broken constants in scopes
  • zhiburt created
    • nu-explore/ Add handlers for HOME/END keys
    • Fix #9548
  • hanjunghyuk created
    • Remove unnecessary cwd, pipeline(), r# from various tests
    • Fix explore crashes on {}
  • Yethal created
    • test-runner: add configurable threading
    • test-runner: Performance improvements + regex match for test include/exclude
    • test-runner: Add option to exclude single test and module
    • Implement annotations support in test runner
    • Pre-register plugins inside docker container
  • AyushSingh13 created
    • fixes which showing aliases as built-in nushell commands
  • YassineHaouzane created
    • Fix: update engine_state when history.isolation is true (#9268)
  • Hofer-Julian created
    • Add pwd command to stdlib
  • NotLebedev created
    • Command to get individual keys
  • rusty-jules created
    • Fix: return all headers with the same name from http <method>
  • baehyunsol created
    • make the behaviours of last and first more consistent
  • bgmort created
    • Add useful example to http options documentation

Extension

  • fdncred created
    • forgot to merge changes for 1.60

Documentation

  • amtoine created
    • refactor ssh-agent cookbook example
    • remove all | table from the book
    • add a more complete example to persist aliases in config.nu
  • Heidar-An created
    • Update nushell_map_imperative.md
  • JoaquinTrinanes created
    • Add external completers cookbook entry to sidebar
    • Expand external completer docs
  • fachammer created
    • Fix link
    • Fix typo
    • Fix typo
  • hustcer created
    • Use lefthook instead of husky and lint-staged for git hooks
    • Refresh commands docs for Nu v0.82
  • Equationzhao created
    • fix a broken link in plugins page in zh-CN
  • Hofer-Julian created
    • Remove && and ||
  • jarrodu created
    • Fix typo
  • sholderbach created
    • Automate response to PRs trying to update commands
  • waldyrious created
    • Fix typo in 2023-06-27-nushell_0_82.md

Nu_Scripts

  • amtoine created
    • add $.version to package.nuon
    • move the extra menus of Nushell into custom-menus/extra/
    • make the release note TODOs HTML comments
    • refactor: simplify the nu_release script
    • fix the release note scripts
    • update the make_release/Readme.md with the whole process
    • use $env. instead of let-env
  • sophiajt created
    • Update some benchmarks. Re-port the gradient benchmark
  • JalonWong created
    • Add a git prompt
  • fj0r created
    • ssh complete cache use whitelist
    • upgrade to 0.82
  • fdncred created
    • fix error background color in oh-my.nu script
  • maxim-uvarov created
    • conda fix
  • trantor created
    • Update README.md: typo
  • dedebenui created
    • fix pass-completion as let cannot be used at module level
  • bobhy created
    • full line v2; with git status!

Reedline

  • sholderbach created
    • Bump nu-ansi-term to 0.49.0
    • Update the Cargo.lock for tests and demo
    • Fix clippy lint for DoubleEndedIterator
    • Update (dev-)deps strum/pretty-assertions,rstest
  • nibon7 created
    • Fix big_word_left_index
    • Remove unneeded features of chrono
  • NotLebedev created
    • Replace crossterm ScrollUp with universal workaround
  • WindSoilder created
    • always disable bracketed paste after read_line
Edit this page on GitHub
Contributors: amtoine, jntrnr, Ian Manske, sophiajt