Nushell is amazing

385 points MrSabuhudo

I've heard about it here and there, thought it sounded interesting. Whatever, some people reinventing the wheel, we've seen that before. Bash and other posix shells are so ubiquitous though, it'll never catch on.

But HOLY COW then I actually read the documentation and started writing some stuff. OMG it's so good you guys! Highlights for me include:

  • Super easy to write scripts that have great help pages like a well crafted CLI tool. (Just put comments next to your arguments)
  • It leans into the pipelining we know and love, but even more ergonomic, versatile, useful and enjoyable. Feels a bit like writing in a functional language.
  • Actual data types, no more unnecessary clumsy string manipulation in your scripts.
  • AMAZING error messages, think elm and rustc.
  • just recipes can be written in nushell!
  • Supports starship prompt. Nice.

But I've saved the best for last. Structured data. Lists, records and tables. Sounds cool, but how useful are they if the outside world communicates in strings? Very, it turns out. Nushell has builtin support for input and output in common formats including json, yaml, toml, csv, tsv, ods, xlsx and even sqlite (haven't tried that one though lol).

xlsx is a little shakier than ods in my first impression. Converting xlsx to ods before passing it to nushell got me better results. I cleaned up my input easily, did some transforms, filtering, and output a report from some spreadsheet and exported it to csv. It was so enjoyable!

But office stuff is just the beginning. I'm thinking about how awesome it will be to write a script pulling in json from an api, parsing it to a table, do some epic stuff with it, produce structured output, serialize back to a json string and send that bad boy back.

Read a config file in json, yaml or toml, update a deep propertie, and save back in that format? That's a oneliner.

I'm in the process of rewriting my setup scripts for fresh linux installs in nushell. It's a bit of a chicken and egg thing, but the posix script required to pull the latest binary from github and dumping it into .local/bin is actually just a couple of lines. From that point onwards, we are in structured data land, baby!

If you haven't had a chance to try it yet, I highly recommend you do! I hope you will enjoy yourself as much as I did.

A question for discussion: What is the cause of so much amazing innovation happening in the Rust community?? The helix editor is another gem that comes to mind. You guys are awesome. Thanks for letting me hitchhike on this wild ride.