Alex Spinov Nushell is a modern shell where everything is structured data. Pipelines work with tables, not text —...
Nushell is a modern shell where everything is structured data. Pipelines work with tables, not text — think SQL meets bash.
# ls returns a table, not text
ls | where size > 1mb | sort-by modified | first 5
# JSON is native
open package.json | get dependencies | transpose name version
# HTTP requests return structured data
http get https://api.github.com/repos/nushell/nushell | select stargazers_count forks_count
# Group and aggregate
ls **/*.ts | group-by { path parse | get extension } | transpose ext files | each { |r| {ext: $r.ext, count: ($r.files | length)} }
# Filter JSON
open data.json | where age > 25 | select name email | to csv
# Math
[1 2 3 4 5] | math avg # 3
ls | get size | math sum # Total directory size
def greet [name: string, --loud(-l)] {
let msg = $"Hello, ($name)!"
if $loud { $msg | str upcase } else { $msg }
}
greet World --loud # HELLO, WORLD!
$env.config = {
show_banner: false
table: { mode: rounded }
completions: { algorithm: fuzzy }
}
Need to scrape or monitor web data at scale? Check out my web scraping actors on Apify or email spinov001@gmail.com for custom solutions.