Nushell#

Nushell (nu) is a structured-data shell. Pipelines pass tables and records between commands instead of raw bytes. The operator queries every result by field name and reshapes it with a small, consistent vocabulary that does the work of awk, jq, sed, cut, and curl rolled together. Both a shell and a data-processing language; both a Linux desktop shell and a credible cross-platform automation tool.

Nu as an interactive shell, typed pipelines, completion- aware, integrated history, fzf-style fuzzy search. Nu as a data-processing language, first-class records and tables, real types, native JSON / CSV / TOML / Parquet, immutable by default. The chapters below cover both faces.

Setup#

Nushell ships as a single static binary; install through a package manager or download from the project’s releases page.

$ brew install nushell                          # macOS / Homebrew
$ winget install Nushell.Nushell                # Windows
$ cargo install nu                              # any platform with cargo

$ sudo apt install nushell                      # Debian / Ubuntu (recent)
$ sudo dnf install nushell                      # Fedora

Launch with nu. Make it the login shell with the usual chsh flow (add $(which nu) to /etc/shells first).

Files#

Nu keeps configuration split between an environment file (sourced first, no aliases or non-env logic) and a main config file (aliases, themes, keybindings, prompt). Inspecting $nu from inside the shell is the easiest way to find the actual paths on a given machine:

File

Used for

~/.config/nushell/env.nu

Environment setup; runs first

~/.config/nushell/config.nu

Aliases, themes, keybindings, prompt

~/.config/nushell/

Additional scripts and modules

~/.config/nushell/plugins/

Compiled plugins (nu_plugin_*)

~/.config/nushell/history.txt / history.sqlite3

Per-user history

Inspect from the prompt.

$nu.config-path
$nu.env-path
$nu.history-path
$nu.plugin-path

The Big Idea#

Nushell rebuilds the Unix pipeline around tables instead of bytes. Every command emits structured data; downstream commands query it by field name, not column position.

$ ps aux | grep nginx | awk '{print $2}'

In Nushell.

ps | where name =~ nginx | get pid

Every command produces structured output. ls, ps, open file.json, http get https://api..., sys host, all return tables or records you can filter, sort, and project without parsing text.

Pipelines#

Nu’s verbs work the same on any structured source, e.g. ls listing, parsed JSON, a database row set, an HTTP response. where filters, sort-by sorts, select projects, get extracts a field. The same vocabulary every time.

ls | sort-by size --reverse | first 10
ls | where modified > (date now) - 1day
ls | where name =~ '\.go$' | get name | length

open Cargo.toml | get dependencies | columns
open users.json | where age > 30 | select name email

History#

Nu keeps a per-user history file with optional SQLite backend that records exit code, duration, working directory, and hostname per entry. history is itself a table; the operator queries it with the same verbs they use everywhere else.

history | last 20 | select command exit_status duration
history | where exit_status != 0 | get command
history | where cwd =~ projects | sort-by start_timestamp | last 50

The SQLite backend is on by default in recent versions; the plain-text fallback exists for compatibility.

Completion#

Tab completes commands, file paths, and (when the operator opts in) external program flags via the external_completer hook. Plugins like nu_plugin_polars and vendor CLIs that ship completion files extend the surface.

$env.config = ($env.config | upsert completions {
    external: {
        enable: true
        max_results: 100
        completer: {|spans| ... }
    }
})

HTTP Built In#

http get and http post ship as Nu commands; no curl, no jq, no escaping mismatch. Responses come back as records, so the same select / where / get verbs work directly on the JSON the API returned.

http get https://api.github.com/repos/nushell/nushell
    | select stargazers_count forks_count language

http post https://api.example.com/items {name: "operator"} `
    -H {Authorization: "Bearer ..."}

Strengths#

What Nu replaces. Most of these add up to “fewer one-off tools glued together with text parsing”, e.g. jq, awk, sed, curl, and a sprinkling of Python become a single consistent vocabulary.

  • Structured pipelines, transformative once internalized.

  • No more parsing awk-style text columns.

  • Multi-format file support out of the box (JSON, CSV, TOML, YAML, XML, Parquet, SQLite, Excel).

  • HTTP, SQL, JSON as first-class.

  • Strong typing for data-processing scripts.

  • Cross-platform, runs the same on Windows, macOS, Linux.

Weaknesses#

What you trade for the structured-data model. Most operators run Nu as a second shell rather than a Bash replacement, precisely because the points below make it a poor fit for the everyday system-scripting work Bash handles cleanly.

  • Not POSIX, can’t replace bash for system scripts on other people’s boxes.

  • Different mental model, learning curve, especially around built-ins vs. external commands.

  • Smaller community, fewer tutorials, plugins, completions.

  • Frequent breaking changes, still pre-1.0 in spirit; check the changelog before upgrading.

When to Pick Nu#

Pick Nu when your day involves a lot of structured-data wrangling and you’re already keeping Bash around for everything else. A common pattern is two shells in different terminals: Nu for data exploration, Bash or Fish for system-level work.

  • You spend a lot of time slicing JSON / CSV / log files at the command line.

  • You want jq + awk + sed + curl in one consistent vocabulary.

  • You’re willing to keep Bash around for system scripts.

Many engineers run Nu alongside Bash / Fish: Nu for data exploration, the other for everything else.

Chapters#

Overview

Nu as a command interpreter and a data-processing language. Syntax, types, operators, control flow, custom commands.

Overview
I/O and Pipelines

Structured pipelines, byte mode, redirection, open and save, the host-shell boundary.

I/O and Pipelines
Structures

Records, tables, lists, the typed primitives underneath. Building, querying, reshaping data.

Structures
Algorithms

Search, sort, group, dedupe, aggregate. When Nu’s table operations replace whole bash pipelines.

Algorithms
Libraries

Standard library, scripts, modules, use, plugins.

Libraries
Frameworks

Plugins, prompt managers, the small Nu ecosystem.

Frameworks
Networking

http, url, DNS through plugins, external tools when they fit better.

Networking
Patterns

Error handling, try / catch, immutability discipline, the bash-interop idioms.

Patterns
Tools

The interpreter, plugins, debugging.

Tools