Skip to main content

Why Nushell belongs in the toolbox for everyone working practically with AI

Submitted by Lennart on
Why Nushell belongs in the toolkit of everyone working practically with AI

There's a difference between working with AI and working practically with AI.

The former is using ChatGPT from a browser. The latter is building something where AI is one step among many—where data needs to be fetched, validated, sent to a model, checked, transformed, and stored elsewhere. Almost all commercial AI work is of the latter kind.

And if you're doing the latter, Nushell should live in your terminal.

The problem you have—even if you haven't articulated it yet

Try to write it down: what is your actual workflow when you use AI for something productive?

Typically, it looks something like this:

  1. You fetch some data—from a file, an API, a database, a CSV you received by email.
  2. You clean or filter it—remove empty rows, normalize formats, pick out the relevant fields.
  3. You send it into a language model—for classification, summarization, translation, transformation.
  4. You take the output and do something with it—save it, pass it on, format it as a report.

If you do this in Python scripts, you write 50 lines each time. If you do it in bash, you curse jq, awk, and temporary files a lot. If you do it manually, you waste hours and give up halfway.

Nushell hits that workflow precisely. It's designed to be a shell where pipelines carry structured data—not text streams.

A concrete example

Let's say you have a CSV with 200 customer inquiries and want a model to classify them into three categories: inquiry, complaint, praise. In bash, it's half a day's work with jq, temporary files, and parsing. In Python, it's a script you need to maintain. In Nushell, it's:

open inquiries.csv
| each { |h|
    let category = ($h.text | llm "classify as inquiry, complaint, or praise. Respond with a single word.")
    $h | insert category $category
  }
| save classified.csv

That's it. Five lines. Readable by a non-developer. The data flows as typed records from start to finish. You don't need to parse anything. You don't need to import anything. You don't need to build a dataframe framework around it.

And most importantly: you can put it into a cron job, a hook, or a larger pipeline without changing anything.

What makes it specifically good for AI

Four things set Nushell apart when the work is AI-heavy:

1. All formats speak the same language. open file.json, open file.csv, open file.toml, http get—all return parsed data in the same structure. You can join a JSON response from an API with a CSV from a folder with one line. It sounds trivial until you've tried to do it in bash.

2. AI calls feel like all other commands. Once you've made a small wrapper—llm, gemima, whatever it may be—they behave like head, sort, or where. They take something in, spit something out, can be piped. There's no context switch between "now I'm working with data" and "now I'm calling an AI."

3. Your business logic sits visually right next to your AI call. That's very healthy. It constantly reminds you that most of the pipeline isn't AI. It's checking if a field is empty, routing based on a value, filters, and transformations. Nushell makes it trivial to maintain that distinction.

4. Modules make it easy to reuse. My own Nushell modules for Drupal, LLMs, IWE, etc., are in ~/.config/nushell/modules/ and can be loaded with use. After a few months, you'll have a small library of your own building blocks—and that means your next AI pipeline will take 10 minutes to build, not 10 hours.

Who it's for

It's not for everyone. If you only use AI through a browser interface, or if your "AI work" is paying someone for a license and hoping for the best—then this isn't for you.

But if you:

  • Fetch data from one place, run it through a model, and send the result somewhere else
  • Automate editorial, administrative, or analysis workflows
  • Build internal tools that need to be reliable without being a full software project
  • Help others integrate AI into their processes

—then Nushell will become the tool you reach for almost every day. I use it multiple times a day. This blog post was published with a 26-line Nushell command that sends the text to Drupal, generates an image via Gemini, processes it with ImageMagick, and uploads it with the correct alt text. I type article | drupal article-with-image "title", and the rest is gone.

The broader point

Tools shape what we imagine is possible. If your tool for working with data is Excel, you think in rows and cells. If it's Python, you think in dataframes. If it's bash, you think in text manipulation.

If your tool is Nushell, you think in typed pipelines—and when you're dealing with AI tasks, that mindset fits best. You automatically think in terms of "where is the structured data, where does it change format, where is the AI step, where is the validation." That's precisely the mental model reliable AI systems require.

I'm not saying you should abandon Python. Python remains the right choice for building the AI components themselves—model integration, heavy data processing, ML pipelines. Nushell is the gluing layer on top. The two complement each other.

But if you work practically with AI and have never opened Nushell, you're trying to build houses without a tape measure. It can be done. It's just silly.

How to get started

brew install nushell       # or winget, or apt, or cargo install nu
nu                         # run it
open data.csv              # feel the difference

Ten minutes later, you'll have written your first pipeline. An hour later, you'll have replaced a bash script that never quite worked. A week later, it's the first thing you open when someone asks, "Can we just get that automated?"

And then, suddenly, you're in that small, noticeable group of people who actually get AI work done—instead of talking about it.

Tags