agent/skills/nu-shell/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 nu-shellInstall 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
^ 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.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.