this post was submitted on 30 Apr 2025
7 points (100.0% liked)

Nushell

84 readers
2 users here now

What is Nushell?

Nushell is a powerful shell and scripting language with strong typing, querying, and piping functionalities.

From the official documentation; Introduction:

The goal of this project is to take the Unix philosophy of shells, where pipes connect simple commands together, and bring it to the modern style of development. Thus, rather than being either a shell, or a programming language, Nushell connects both by bringing a rich programming language and a full-featured shell together into one package.

Nu takes cues from a lot of familiar territory: traditional shells like bash, object based shells like PowerShell, gradually typed languages like TypeScript, functional programming, systems programming, and more. But rather than trying to be a jack of all trades, Nu focuses its energy on doing a few things well:

Examples

Shell Examples…

0x[7F000001] | chunks 1 | each { into int } | str join "."
# => 127.0.0.1
ls | where size > 1kb
# => ╭───┬───────────────────┬──────┬─────────┬────────────╮
# => │ # │       name        │ type │  size   │  modified  │
# => ├───┼───────────────────┼──────┼─────────┼────────────┤
# => │ 0 │ Gemfile           │ file │ 1.1 KiB │ 3 days ago │
# => │ 1 │ Gemfile.lock      │ file │ 6.9 KiB │ 3 days ago │
# => │ 2 │ LICENSE           │ file │ 1.1 KiB │ 3 days ago │
# => │ 3 │ SUMMARY.md        │ file │ 3.7 KiB │ 3 days ago │
# => ╰───┴───────────────────┴──────┴─────────┴────────────╯
help commands | where name == each | first | get params.name
# => ╭───┬──────────────────╮
# => │ 0 │ closure          │
# => │ 1 │ --help(-h)       │
# => │ 2 │ --keep-empty(-k) │
# => ╰───┴──────────────────╯
http get https://programming.dev/api/v3/site | get all_languages | length
# => 184

http get https://programming.dev/api/v3/site | get taglines.content
# => ╭───┬────────────────────────────────────╮
# => │ 0 │ Broken communities have been fixed │
# => ╰───┴────────────────────────────────────╯

Web-Links

founded 6 months ago
MODERATORS
7
Nushell 0.104.0 Release (www.nushell.sh)
submitted 2 weeks ago* (last edited 2 weeks ago) by Kissaki to c/nushell
 

Today, we're releasing version 0.104.0 of Nu. This release adds additional job control capabilities, many datetime improvements, and a number of new Polars commands.

you are viewing a single comment's thread
view the rest of the comments
[–] BatmanAoD 1 points 2 weeks ago (4 children)

I didn't realize Nu had gotten any form of job control; that was one of the limitations that forced me back to a traditional shell last time I tried it.

Looks like they're still making frequent breaking changes, though, which was another thing I found difficult to manage.

[–] Kissaki 2 points 2 weeks ago (1 children)

Jobs are currently in-process background threads, so will exit when exiting the current Nushell process. There's plans for job dispatching though. In the meantime, the nu_scripts repo has a task module that uses pueue to handle such cases.

[–] BatmanAoD 2 points 2 weeks ago

I think that's fine; I don't usually orphan background jobs, but I do relatively often have reason to have them while I do something else. And relying on pueue for more complex uses seems more than reasonable.

load more comments (2 replies)