nushell
Original:🇺🇸 English
Translated
Use when writing or running Nushell commands, scripts, or pipelines - via the Nushell MCP server (mcp__nushell__evaluate), via Bash (nu -c), or in .nu script files. Also use when working with structured data (JSON, YAML, TOML, CSV, Parquet, SQLite), doing ad-hoc data analysis or exploration, or when the user's shell is Nushell.
1installs
Sourcenushell/nu_scripts
Added on
NPX Install
npx skill4agent add nushell/nu_scripts nushellTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Using Nushell
Nushell is a structured-data shell. Commands pass tables, records, and lists through pipelines - not text.
Two execution paths:
- MCP server: - persistent REPL (variables survive across calls)
mcp__nushell__evaluate - Bash tool: - one-shot (use single quotes for outer wrapper)
nu -c '<code>'
Critical Rules
NEVER use bare in MCP stdio mode. Output will be lost (returns empty ). Use for stderr, or just return the value (implicit return).
print[]print -e "msg"String interpolation uses parentheses, NOT curly braces:
nu
# WRONG: $"hello {$name}"
# CORRECT: $"hello ($name)"
$"($env.HOME)/docs" $"2 + 2 = (2 + 2)" $"files: (ls | length)"Gotcha: errors - parens are evaluated as code. Escape literal parens: .
$"(some text)"\(text\)No bash syntax: not , not , not , not .
cmd1; cmd2&&o+e>|2>&1$env.VAR$VAR(cmd)$(cmd)Common Mistakes
| Mistake | Fix |
|---|---|
| |
| |
| |
| |
| |
| Mutating in closure | Use |
| |
| Second |
| |
| Parsed as two pipeline stages. Use |
When to Use Nushell
Always prefer Nushell for:
- Any structured data (JSON, YAML, TOML, CSV, Parquet, SQLite) - unifies all formats
- CLI tools with flags - pipe JSON output directly into Nushell for querying (e.g.
--json)^gh pr list --json title,state | from json - Ad-hoc data analysis and exploration - faster than Python setup
- Initial data science/analytics - histograms, tabular output, basic aggregations
- Polars plugin for large datasets - DataFrames without Python overhead
Use Bash only when: bash-specific tooling, MCP unavailable, or bash-syntax integrations.
Reference Files
Read the relevant file(s) based on what you need:
| File | Read when you need... |
|---|---|
| commands.md | Command reference tables (filters, strings, conversions, filesystem, math, dates) |
| types-and-syntax.md | Type system, string types, operators, variables, control flow, cell-paths |
| data-analysis.md | Format conversion, HTTP, Polars, SQLite, aggregation patterns |
| advanced.md | Custom commands, modules, error handling, jobs, external commands, env config |
| bash-equivalents.md | Complete Bash-to-Nushell translation table |
| http-transport.md | Differences when using HTTP transport instead of stdio |
MCP Server Quick Notes
- - run code;
mcp__nushell__evaluate- discover;mcp__nushell__list_commands- helpmcp__nushell__command_help - State persists between calls. stores prior results (access
$history, etc.)$history.0 - Use or
| to textfor large outputs. Use| to jsonfor color removal.ansi strip