Nushell 0.86
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.86 of Nu. This release adds fish-like directory completions, type system improvements, our first officially supported uutils command, and much more.
Where to get it
Nu 0.86 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>
.
Table of content
- Themes of this release / New features
- Breaking changes
- Full changelog
Themes of this release / New features [toc]
Hall of fame [toc]
Bug fixes [toc]
Thanks to all the contributors below for helping us solve issues and bugs 🙏. This effort is a major part of what is moving Nushell closer to 1.0 with each release.
author | title | pr |
---|---|---|
@anka-213 | Fix exponential parser time on sequence of [[[[ | #10439 |
@anka-213 | Fix tilde-expansion for multi-byte unicode chars | #10434 |
@sholderbach | Improve select row perf for large N | #10355 |
@anka-213 | Prevent cubic time on nested parentheses | #10467 |
@amtoine | fix public boolean switches in the standard library | #10477 |
@bobhy | std dt datetime-diff: fix uninitialized field ref when borrowing | #10466 |
@NotLebedev | Fix default argument value type checking | #10460 |
@fdncred | fix magenta_reverse and friends | #10491 |
@zhiburt | nu-table: Fix failing test (relied on termwidth assumptions) | #10492 |
@sholderbach | Fix editor config for reedline and config nu/env | #10535 |
@fennewald | Fix Default Prompt Tilde Insertion Logic | #10539 |
@sophiajt | fix windows default prompt slash direction | #10555 |
@lavafroth | fix: complete paths surrounded by quotes or backticks | #10600 |
@dmatos2012 | ucp: Change error when directory is specified but not recursive | #10609 |
@zhiburt | nu-explore: Try to fix a truncation issue in expand view | #10580 |
@kubouch | Fix wrong parsing of signatures in predecl scan | #10637 |
@kubouch | Fix parsing of signature inp/out types in predecls | #10642 |
@gaetschwartz | fix labelled error from shell error | #10639 |
@CAD97 | Fix registry query flag validation | #10648 |
@CAD97 | Fix clippy in registry_query.rs | #10652 |
@WindSoilder | fix clippy | #10659 |
@sholderbach | Fix output types of math commands to be narrower | #9740 |
@zhiburt | nu-table: Use config color scheme in kv tables and table -e | #10720 |
@lavafroth | fix: only escape path containing numbers if they can be valid floating points | #10719 |
@fdncred | evaluate $nu during --ide-check | #10470 |
@WindSoilder | allow early return outside of main | #10514 |
@lavafroth | Preserve relative paths for local files | #10658 |
@bobhy | glob with ../ prefix now works; | #10504 |
@fnuttens | Add support for HTTP proxy in network commands | #10401 |
Enhancing the documentation [toc]
Thanks to all the contributors below for helping us making the documentation of Nushell commands better 🙏
author | title | pr |
---|---|---|
@sholderbach | Docstring some intricacies around SyntaxShape | #10544 |
@Hofer-Julian | Add long options for bits and bytes | #10601 |
@Hofer-Julian | Add long options for conversions | #10602 |
@Hofer-Julian | Use long options for debug | #10621 |
@Hofer-Julian | Add long options for core and dataframes | #10619 |
@Hofer-Julian | Add long options for filters | #10641 |
@Hofer-Julian | Add long options for formats | #10645 |
@amtoine | add examples with .. and / to path join | #10620 |
@DanyPDev | Add themes to help command when available #10318 | #10623 |
Internal changes [toc]
Thanks to all the contributors below for working on the internals of Nushell, doing refactoring and bookkeeping, ... 🙏
author | title | pr |
---|---|---|
@fdncred | allow values command to support LazyRecord s | #10418 |
@sholderbach | Remove dead BSON related tests | #10458 |
@sholderbach | Simplify nu! test macros. | #10403 |
@sholderbach | Improve assertions in src/tests.rs | #10449 |
@sholderbach | Split up nu-protocol/src/engine/engine_state.rs | #10368 |
@sholderbach | Remove unused SyntaxShape::Variable | #10511 |
@sholderbach | Remove parsing literals of unrepresentable SyntaxShape s | #10512 |
@amtoine | break the definition of LS_COLORS onto multiple lines | #10538 |
@sholderbach | Rename SyntaxShape::Custom to CompleterWrapper | #10548 |
@bobhy | toolkit check pr does same clippy checks as github CI | #10528 |
@Hofer-Julian | chore: Small refactor of eval.rs | #10554 |
@stormasm | engine eval.rs remove pub from fn eval_element_with_input | #10587 |
@sholderbach | Parse custom completer annotation only in args | #10581 |
@sholderbach | Move SyntaxShape specifier parsing into own file | #10448 |
@Hofer-Julian | Let run_in_login_mode succeed even with broken local config | #10622 |
@fdncred | change canonicalize test use a more deeply rooted folder | #10685 |
@quat1024 | Use heck for string casing (again) | #10680 |
@lavafroth | refactor: move the partial_from function to the single place it is invoked | #10705 |
Platform support [toc]
Thanks to all the contributors below for helping Nushell be used on more platforms easily 🙏
author | title | pr |
---|---|---|
@fdncred | optimize aarch64 when able | #10433 |
@hustcer | Add full releases of Nu binaries along with the standard releases | #10457 |
@hustcer | feat: Update nightly build workflow add full release support | #10485 |
@hustcer | Update winget submission workflow include only default msi files | #10487 |
@hustcer | Improve release script for github release workflow | #10502 |
@hustcer | Update build flags for riscv64gc and armv7 targets | #10564 |
Making errors better [toc]
Thanks to all the contributors below for making errors better and less confusing for users 🙏
author | title | pr |
---|---|---|
@amtoine | show the whole path in "missing mod.nu" errors | #10416 |
@amtoine | show the full directory / file path in "directory not found" error | #10430 |
@WindSoilder | make better error message for not operator | #10507 |
@amtoine | improve assertion error messages in std assert | #10551 |
@GPadley | Map DirectoryNotFound to FileNotFound for open command (issue #10085) | #10089 |
@brunerm99 | Add warning to url join when input key is not supported (#10506) | #10565 |
@amtoine | make "can't follow stream paths" error a bit better | #10569 |
@brunerm99 | give better error if required field of url join is invalid | #10589 |
Improving the completions in the REPL [toc]
With Nushell 0.86.0
come a few improvements to the completions!
@ZerdoX-x did add built-in support for the doas
command in addition to sudo
in #10256.
In #10543, @lavafroth have implement Fish-like completions for nested directories. This means that now typing tar/de/inc
in the REPL of Nushell and hitting TAB will autocomplete to ./target/debug/incremental
if you are in a Rust directory with compiled artifact.
Breaking change
See a full overview of the breaking changes
As a consequence to #10543, @sophiajt helped remove the cd with abbreviation feature from Nushell. This feature will be taken care of by the Fish-like completions described above and the removal mainly means that $env.config.cd.abbreviations
is not longer a valid config field: do not forget to update your configs 😉
The type system [toc]
With this new release, we are still working on the type system of Nushell.
@WindSoilder has been working on the arguments and options of custom commands. With #10424, default values won't overwrite type annotations anymore, i.e. the following is now possible:
def foo [x: any = null] { print $"$x" }
foo "string" # will show `x: string`
foo null # will show `x: `
Breaking change
See a full overview of the breaking changes
Continuing with the options on custom commands, let's talk about an important change introduced by #10456 about boolean switches:
- annotating a boolean option will create an option and will require to pass a boolean value
def foo [--option: bool] { if $option { print "yeah" } }
foo --option # will give an error
foo --option false # won't print anything
foo --option true # will print "yeah"
- to create a boolean switch, you need to omit the type annotation
def bar [--switch] { if $switch { print "yeah" } }
bar # won't print anything
bar --switch # will print "yeah"
💡 Note Boolean options are one step towards addressing a major pain point of Nushell: Passing flags around to other commands. Calling a command with a flag, such as
def inner [--foo] { ... }
, from another command used to requireif
-else
to pass the flag:def outer [--foo] { if $foo { inner --foo } else { inner } }
With boolean options, it is now possible to define
def inner [--foo: bool] { ... }
and then call simply asdef outer [--foo] { inner --foo $foo }
Once again, @NotLebedev has been pushing forward type annotations to their limits, this time by allowing complex types in input/output signaturate for custom commands and in let
assignments. This means that #10405 allows one to write things like:
let my_r: record<a :int> = { a: 123 }
or
def my_complex_command []: nothing -> record<a: int> { { a: 123 } }
💡 Note other contributions worth mentioning about the type system:
author title pr @sholderbach Use int
type name consistently#10579 @sholderbach Relax type-check of key-less table
/record
#10629 @fdncred change Type::Float => SyntaxShape::Number to SyntaxShape::Float #10689
Unified command definitions
Nushell currently has three ways to define a command:
def
to define a regular commanddef-env
to define a command that preserves the environmentextern-wrapped
to define a command with a signature where unknown flags and parameters are collected into strings without throwing an error- (
extern
defines an external signature, not a real command)
In this release, @kubouch unified the syntax in #10566 such that the def-env
and extern-wrapped
are now defined with the --env
and --wrapped
options to the def
keyword. We made this change to go in line with the let-env
removal and simplifying the language in general. Also, confusingly, extern-wrapped
has nothing to do with extern
apart from the permissive signature. We hope the new notation makes it clearer. A bonus feature of this change is that now you can define def --env --wrapped
!
💡 Note In the next release,
def-env
andextern-wrapped
will get deprecated. If you have any of those definitions in your scripts, simply replace them withdef --env
ordef --wrapped
. In the following releases, they will be removed completely.
Some news with the standard library [toc]
Thanks to @Yethal and their work in #10545, the use of the test runner and the std testing run-tests
command should be faster!
Work has been done to improve the std log
module:
- @gaetschwartz allow specifying a custom date format with #10603
- @fdncred remove the underline from
NU_LOG_FORMAT
with #10604
Finally, a bug with std dirs goto
, a shell command in the prelude of the library, has been fixed by @bobhy in #10706.
Miscellaneous [toc]
Nushell now supports the keyboard enhancement protocol from Kitty with the work of @Abdillah in #10540. This feature is off by default but can be turned on in config.nu
with the $env.use_kitty_protocol
config option.
Nushell and Direnv are now integrated with each other thanks to @amtoine in direnv/direnv#1175 and #10675.
With the changes from #10593 written by @gaetschwartz, open
can now read tar.gz
file because from
can handle multiple extensions. To be more precise, if from tar.gz
and from gz
are defined at the same time, open foo.tar.gz
will try to call from tar.gz
first and then fall back to from gz
.
Let's finish with some delight to make the Nushell experience a bit nicer:
- transient prompts are now possible introduced in #10391 by @ysthakur
LS_COLORS
supports.fb2
files as text documents thanks to @1256-bits in #10532- a few more grid icons have been added by @fdncred in #10583
Our set of commands is evolving [toc]
As usual, new release rhyms with changes to commands!
It's official! 🥳 With the landing of PR 10678 the uutils/coreutils version of cp
is now the default copy command in nushell. We're so happy to have this command landed and we're working on several other commands. If you'd like to help out please visit our Discord and ask about helping. The coreutils team would also appreciate your help since changes need to be made there before integrating into nushell.
New commands [toc]
- when parsing raw data streams from external commands, a common task in Nushell is to give explicit types to all fields and columns of the parsed data structure. Until now, this had to be done manually but, thanks to @fdncred and #10427, the new
into value
command should help make that task easier by trying to infer the types for you:
# should help you catch integer user and group IDs in the `/etc/passwd` file on *nix systems
open /etc/passwd | lines | split column ":" user . uid gid desc home shell | into value
- @zhiburt did add an
--abbreviated
option totable
to truncate the output of long tables in #10399 - to get the content of the default config files of Nushell without overwriting the true
config.nu
andenv.nu
, @poliorcetics have added the--default
option to bothconfig nu
andconfig env
in #10480 - to know about all the available escapes that Nushell supports, @vedaRadev have added
help escapes
in #10522 - tired of crawling the internet or computing series of number with loops and mutable variables? @hudclark got your back with the new
unfold
command from #10489! The first 10 Fibonacci numbers can now be computed very easily with something like
unfold [0, 1] {|fib| {out: $fib.0, next: [$fib.1, ($fib.0 + $fib.1)]} } | first 10
To crawl multi-page API responses, e.g. when listing issues of a GitHub repository, the unfold
is very handy and allows to transform
mut pages = []
for page in 1.. {
let resp = http get (
{
scheme: https,
host: "api.github.com",
path: "/repos/nushell/nushell/issues",
params: { page: $page, per_page: $PAGE_SIZE }
} | url join)
$pages = ($pages | append $resp)
if ($resp | length) < $PAGE_SIZE {
break
}
}
$pages
into
unfold 1 {|page|
let resp = http get (
{
scheme: https,
host: "api.github.com",
path: "/repos/nushell/nushell/issues",
params: { page: $page, per_page: $PAGE_SIZE }
} | url join)
if ($resp | length) < $PAGE_SIZE {
{out: $resp}
} else {
{out: $resp, next: ($page + 1)}
}
}
- in previous release,
from ndjson
andfrom jsonl
have been added to the standard library. In this new release, @amtoine has added theirto
counterpart in #10519 - to complete
url encode
,url decode
has been added by @lpchaim in #10611 dfr
to get some help on dataframes by @sholderbach in #10683- our mascot
ellie
has been added to the standard library by @amtoine in #10686 - complementary to the
sys
command,debug info
, added by @fdncred in #10711, should give more insight into the resources Nushell is using at runtime
Changes to existing commands [toc]
The open
command is now case-insensitive when it comes to file extensiens thanks to @poketch in #10451.
A bug inside from ics
and from vcf
has been fixed thanks to @joergsch in #10577.
Breaking change
See a full overview of the breaking changes
With #10526 from @WindSoilder, the --column
option of the rename
command now takes a record
instead of a list
:
> ls | where type == file | rename --column {name: filename, size: nb_bytes}
#┬filename─┬type┬nb_bytes┬─────modified──────
0│LICENSE │file│ 35.1 KB│2022-12-23 11:34:42
1│README.md│file│ 9.3 KB│2023-10-04 18:41:25
─┴─────────┴────┴────────┴───────────────────
The do
command can now mutate its outside environment with a new --env
option added by @ClipplerBlood in #10572. This means that the following will now be possible:
do --env { cd some/where }
A few updates on the explore
command [toc]
Once again, @rgwood has done work to simplify the explore
command
- the highlighting of selected cells has been made easier to see in #10533 |
- some config options have been removed in#10559, #10562 and #10570
Deprecated commands [toc]
The following commands and options are being deprecated and will be removed soon:
random int
in favor ofrandom integer
in #10520- the
$nothing
built-in variable in favor of thenull
value in #10478 to xml --pretty {int}
in favor ofto xml --indent {int}
in #10660
Removed commands [toc]
The following commands are being removed from Nushell:
Breaking changes [toc]
- #10456 differentiating between
--x
and--x: bool
In 0.86, we now differentiate between a switch --x
and a flag with a boolean argument --x: bool
. If you declare a flag as a parameter and give it the : bool
type annotation, we now require that the flag is followed by a boolean value. Previously, we took the boolean type to mean that the flag was actually a switch.
- #10680 Use
heck
for string casing (again)
Before
> [UserID ABCdefGHI foo123bar] | str camel-case
╭───┬───────────╮
│ 0 │ userID │
│ 1 │ abcdefGHI │
│ 2 │ foo123Bar │
╰───┴───────────╯
> [UserID ABCdefGHI foo123bar] | str snake-case
╭───┬─────────────╮
│ 0 │ user_id │
│ 1 │ ab_cdef_ghi │
│ 2 │ foo_12_3bar │
╰───┴─────────────╯
After
> [UserID ABCdefGHI foo123bar] | str camel-case
╭───┬───────────╮
│ 0 │ userId │
│ 1 │ abCdefGhi │
│ 2 │ foo123bar │
╰───┴───────────╯
> [UserID ABCdefGHI foo123bar] | str snake-case
╭───┬─────────────╮
│ 0 │ user_id │
│ 1 │ ab_cdef_ghi │
│ 2 │ foo123bar │
╰───┴─────────────╯
cd
with abbreviations was a feature you could enable to expand an abbreviated path for you automatically. It would do so after you hit return. In comparing the experience between this and the fish-like path abbreviation completions added in 0.86, we decided the new style of completions satisfied this in a much more visual way.
- #10526 Rename: change the SyntaxShape of
-c
flag from list to record
After this change, we need to use -c flag like this:
> [[a, b, c]; [1, 2, 3]] | rename -c { a: ham }
But we can rename many columns easily, here is another example:
> [[a, b, c]; [1, 2, 3]] | rename -c { a: ham, b: ham2 }
Full changelog [toc]
Nushell
- fdncred created
- add coreutils to cp search terms
- add a
debug info
command to show memory info - change Type::Float => SyntaxShape::Number to SyntaxShape::Float
- change canonicalize test use a more deeply rooted folder
- rename nushell's cp command to cp-old making coreutils the default cp
- bump rust-toolchain to 1.71.1
- remove underline from std NU_LOG_FORMAT
- add a few more grid icons
- fix magenta_reverse and friends
- evaluate
$nu
during--ide-check
- new command:
into value
- allow
values
command to supportLazyRecord
s - optimize aarch64 when able
- 0scvr created
- sholderbach created
- Pin
uu_cp
to the0.0.22
release. - Update
polars
to0.33
- Fix output types of
math
commands to be narrower - Add a stub
dfr
command - Relax type-check of key-less
table
/record
- Move
SyntaxShape
specifier parsing into own file - Parse custom completer annotation only in args
- Use
int
type name consistently - Rename
SyntaxShape::Custom
toCompleterWrapper
- Fix editor config for reedline and
config nu/env
- Docstring some intricacies around
SyntaxShape
- Remove parsing literals of unrepresentable
SyntaxShape
s - Remove unused
SyntaxShape::Variable
- Rename
random integer
torandom int
- Bump
dialoguer
to0.11.0
- Improve
select
row perf for large N - Split up
nu-protocol/src/engine/engine_state.rs
- Improve assertions in
src/tests.rs
- Simplify
nu!
test macros. - Remove dead BSON related tests
- Bump to
0.85.1
development version
- Pin
- zhiburt created
- lavafroth created
- gaetschwartz created
- bobhy created
- quat1024 created
- amtoine created
- add Ellie to the standard library
- remove
into decimal
- add Direnv to the integrations
- remove
random decimal
- add examples with
..
and/
topath join
- make "can't follow stream paths" error a bit better
- add
to ndjson
andto jsonl
to the standard library - improve assertion error messages in
std assert
- break the definition of LS_COLORS onto multiple lines
- remove the
$nothing
variable - show the full directory / file path in "directory not found" error
- show the whole path in "missing mod.nu" errors
- fix public boolean switches in the standard library
- app/dependabot created
- Bump trash from 3.0.6 to 3.1.0
- Bump byteorder from 1.4.3 to 1.5.0
- Bump crate-ci/typos from 1.16.15 to 1.16.17
- Bump shadow-rs from 0.23.0 to 0.24.1
- Bump wax from 0.5.0 to 0.6.0
- Bump crate-ci/typos from 1.16.13 to 1.16.15
- Bump ureq from 2.7.1 to 2.8.0
- Bump crate-ci/typos from 1.16.11 to 1.16.13
- Bump rayon from 1.7.0 to 1.8.0
- brunerm99 created
- DanyPDev created
- Hofer-Julian created
- Let
run_in_login_mode
succeed even with broken local config - Deprecate
to xml --pretty {int}
in favor of--indent {int}
- Add long options for formats
- Add long options for filters
- Add long options for core and dataframes
- Use long options for debug
- Add long options for conversions
- Add long options for bits and bytes
- Port command examples to long option
- chore: Small refactor of
eval.rs
- Let
- WindSoilder created
- CAD97 created
- kubouch created
- dmatos2012 created
- lpchaim created
- sophiajt created
- joergsch created
- stormasm created
- ClipplerBlood created
- rgwood created
- Yethal created
- hustcer created
- hudclark created
- vedaRadev created
- poketch created
- fennewald created
- Abdillah created
- 1256-bits created
- ZerdoX-x created
- fnuttens created
- poliorcetics created
- NotLebedev created
- ysthakur created
- anka-213 created
- Prevent cubic time on nested parentheses
- Fix tilde-expansion for multi-byte unicode chars
- [Fix exponential parser time on sequence of [[[
- GPadley created
Extension
- glcraft created
Documentation
- app/dependabot created
- petrisch created
- joergsch created
- KAAtheWiseGit created
- cptpiepmatz created
- dedebenui created
- Hofer-Julian created
- hustcer created
- savente93 created
- amtoine created
- EmilyGraceSeville7cf created
- sholderbach created
- ShalokShalom created
- marcelarie created
- ysthakur created
Nu_Scripts
- TechWatching created
- amtoine created
- bobhy created
- cptpiepmatz created
- fj0r created
- savente93 created
- sholderbach created
- schrieveslaach created
- 1adept created
- Abdillah created
- marcelarie created
- baehyunsol created