agent/skills/tools/nu/SKILL.md
Reads, filters, transforms, and manipulates structured data using Nushell's pipeline commands. Use when working with CSV/TSV files, parsing command output, transforming tabular data, system administration tasks, or building data pipelines.
npx skillsauth add knoopx/pi nuInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Nushell treats all data as structured tables — lists of records with rows and columns. Every file and command output becomes a table you can filter, transform, and combine.
Files auto-detect from extension. Pipe command output into tables:
open data.csv # CSV → table
df -h | detect columns # Command output → table
$data | save -f output.csv # Write (overwrite with -f)
open data.csv | where rating > 4.0 and status == "active"
ls | sort-by size | reverse | first 10
select col1 col2 — keep specific columns (keeps table shape)reject col — drop a columnget col — extract as a list (not a table)# Map rows
$items | each { |row| { ...$row, tax: ($row.price * 0.1) } }
# Transform a column
$table | update price { |x| $x * 1.1 }
# Add or update columns
$table | insert new_col ($in.old_col * 2)
# Rename
$table | rename old_name new_name
$first | append $b # Stack rows
$first | merge $second # Side-by-side columns
where name =~ "pattern" # Regex match
str upcase / str downcase # Case conversion
str trim / str kebab-case # Formatting
str join "," $list # Join list with separator
$"My value is ($expr)" # Interpolation
let x = (open data.csv); mut count = 0
if ($x | length) > 0 { print "has" } else { print "empty" }
for row in $items { process $row }
match $value { "A" => do_a, "B" => do_b, _ => default_action }
try { open nonexistent.txt } catch { |err| print $"Error: ($err.msg)" }
# Capture external command output
do { ^my-command arg1 } | complete # Returns .exit_code, .stdout, .stderr
Nushell replaces jq entirely. Parse with from json, transform with pipeline commands, output with to json.
# Select a field (jq '.name')
'{"name": "Alice"}' | from json | get name
# Filter array (jq '.[] | select(.age > 28)')
'[...]' | from json | where age > 28
# Map values (jq 'map(. * 2)')
'[1, 2, 3]' | from json | each { $in * 2 }
# Conditional (jq 'if .age > 18 then "Adult" else "Child" end')
'{"age": 30}' | from json | if $in.age > 18 { "Adult" } else { "Child" }
# Format string (jq "Name: \(.name)")
'{"name": "Alice", "age": 30}' | from json | format "Name: {name}, Age: {age}"
# Build new record (jq '{name: .name, age: (.age + 5)}')
'{"name": "Alice", "age": 30}' | from json | {name: $in.name, age: ($in.age + 5)}
# Filter nulls (jq 'map(select(. != null))')
'[1, null, 3]' | from json | where { $in != null }
# Flatten nested arrays (jq '.data[].values[]')
'{"data": [{"values": [1, 2]}]}' | from json | get data.values | flatten
# Sort / unique (jq 'sort' / 'unique')
'[3, 1, 4]' | from json | sort
'[1, 2, 2]' | from json | uniq
# Average (jq 'map(.score) | add / length')
'[...]' | from json | get score | math avg
# Group and aggregate (jq 'group_by(.category)')
'[...]' | from json | group-by --to-table category
| update items { |row| $row.items.value | math sum }
| rename category sum
# Reduce (jq 'reduce .[] as $item (0; . + $item.value)')
'[...]' | from json | reduce -f 0 { |item, acc| $acc + $item.value }
For patterns without built-in equivalents, see references/jq_patterns.md:
cherry-pick — recursive key extraction (jq .. | .key?)walk — recursive transformation (jq walk(...))flatten record-paths — flatten nested records to dot-paths^ prefix for external binaries when necessary.collect | save --force file to avoid read/write conflicts.where column != "" | into int.where, each, reduce instead of for/while — they stream and parallelize better.from json + pipeline commands instead of jq. Nushell works natively with JSON, YAML, CSV, and more.duckdb skill) when you need SQL queries, schema inference, or complex joins over JSON data.tools
Inform the user what is happening — skip passive lookups
development
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
testing
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
content-media
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.