this post was submitted on 04 Jan 2025
3 points (100.0% liked)

Nushell

47 readers
3 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…

nu> 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 │
╰───┴───────────────────┴──────┴─────────┴────────────╯
nu> help commands | where name == each | first | get params.name
╭───┬──────────────────╮
│ 0 │ closure          │
│ 1 │ --help(-h)       │
│ 2 │ --keep-empty(-k) │
╰───┴──────────────────╯
nu> http get https://programming.dev/api/v3/site | get all_languages | length
184

nu> http get https://programming.dev/api/v3/site | get taglines.content
╭───┬───────────────────────────────────────────────────────╮
│ 0 │ Some communities may be broken while we work on fixes │
╰───┴───────────────────────────────────────────────────────╯
## Web-Links * [Website](https://www.nushell.sh/) * [GitHub](https://github.com/nushell/nushell) (Rust, MIT)

founded 2 months ago
MODERATORS
 

I track and version my Nushell environment and configuration in a public repository.

I added a GitHub Actions workflow that tests these files. That will ensure a more defined environment and prerequisites/assumptions, given that they have to be set up in the workflow configuration. Given that I mostly work on Windows, but set up the CI to run on Linux/Ubuntu, it will also ensure platform neutrality.


Since Nushell version 0.101.0, there's no need for a default, base env.nu or config.nu, and the nu binary can be called with only the custom, minimal env and config files.

The nu binary offers --env-config and --config parameters.

I noticed that when using them, errors do not lead to error exist codes; nu will continue execution and report success despite env or config not loading [correctly]. (Bug Ticket #14745)


Do you version your environment configuration? Only locally, or with a hosted repository as a backup or to share? Do you run automated tests on it?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here