# Nushell — A New Type of Shell for the Modern Era > Nushell is a new type of shell that treats data as structured tables rather than plain text. Pipelines operate on structured data (tables, records, lists) instead of raw strings. Built in Rust with cross-platform support. Think of it as a shell meets a spreadsheet. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use ```bash # Install brew install nushell # macOS cargo install nu # Rust winget install nushell # Windows # Launch nu ``` Structured data pipelines: ```nu # List files as a table ls | sort-by size -r | first 5 # Filter and transform ls | where size > 1mb | select name size | sort-by size -r # HTTP request → structured data http get https://api.github.com/repos/nushell/nushell | select stargazers_count forks_count # CSV processing open sales.csv | where region == "APAC" | math sum revenue # JSON manipulation open config.json | upsert database.port 5433 | save config.json # System info as table sys host | select name os_version ps | where cpu > 10 | sort-by cpu -r # Custom commands def greet [name: string] { $"Hello, ($name)!" } greet William ``` ## Intro Nushell (nu) is a new type of shell written in Rust. Instead of treating everything as text strings, Nushell pipelines operate on structured data — tables, records, lists, and typed values. Think of it as a shell that understands data formats (JSON, CSV, YAML, TOML, SQLite) natively and lets you query them like a database. - **Repo**: https://github.com/nushell/nushell - **Stars**: 39K+ - **Language**: Rust - **License**: MIT ## What Nushell Does - **Structured pipelines** — data flows as tables, not text - **Built-in data formats** — JSON, CSV, YAML, TOML, XML, SQLite, Parquet - **Type system** — strings, ints, floats, booleans, dates, durations, file sizes - **ls / ps / sys** — system commands return structured data - **HTTP client** — `http get/post` with auto-parsing - **SQL-like queries** — where, select, group-by, sort-by, math - **Custom commands** — `def` with typed parameters - **Modules** — organize code into modules - **Plugins** — extend via compiled plugins - **Completions** — context-aware tab completion ## Architecture Rust binary. Parser produces an AST, engine evaluates pipelines. Each command produces a `PipelineData` value (table, record, string, etc.). Plugins communicate via JSON-RPC. ## Comparison | Shell | Data Model | Language | Cross-platform | |---|---|---|---| | Nushell | Structured tables | Own | Yes | | Bash/Zsh | Text streams | POSIX sh | Unix | | Fish | Text streams | Own | Unix | | PowerShell | .NET objects | Own | Yes | | Xonsh | Python objects | Python | Yes | ## FAQ **Q: Can it replace bash?** A: For interactive use, yes. But POSIX shell scripts are not compatible — existing `.sh` scripts still need bash. Nushell fits new scripts and daily interaction. **Q: Similar to PowerShell?** A: Similar in philosophy (structured data pipelines) but different in implementation. Nushell is lighter, cross-platform native, and has a more concise type system. **Q: Performance?** A: Rust implementation — fast startup, fast pipeline processing. Slightly slower than awk/sed on very large files but 100x more readable. ## Sources - Docs: https://www.nushell.sh/book - GitHub: https://github.com/nushell/nushell - License: MIT --- Source: https://tokrepo.com/en/workflows/nushell-new-type-shell-modern-era-903323cf Author: AI Open Source