Comprehensive documentation for the nushell-dev Claude Code plugin Nushell version: 0.110.0+
| Resource | Description |
|---|---|
| Snippets | Copy-paste code examples by category |
| Reference | Complete language and API reference |
| Guides | Step-by-step tutorials and how-tos |
# Check Nushell version (requires 0.100+)
version | get version
# Verify LSP availability
which nu | get 0.path
nu --ide-check --help# Install from nushell-marketplace
/plugin marketplace add danielbodnar/nushell-dev
/plugin install nushell-dev@nushell-marketplace
# Or test in isolation
claude --plugin-dir ~/.claude/plugins/nushell-dev/plugins/nushell-dev# High-performance data processing
plugin add polars
# Additional file formats
plugin add formats
# SQL-like queries
plugin add querydocs/
├── README.md # This file
├── snippets/ # Code snippets
│ ├── README.md # Snippet index
│ ├── pipelines.md # Pipeline patterns
│ ├── data.md # Data transformation
│ ├── http.md # HTTP & API calls
│ ├── files.md # File operations
│ ├── commands.md # Custom commands
│ └── modules.md # Module patterns
├── reference/ # Reference documentation
│ ├── README.md # Reference index
│ ├── types.md # Type system
│ ├── operators.md # Operators reference
│ ├── configuration.md # $env.config reference
│ ├── commands.md # Built-in commands
│ └── errors.md # Error handling
└── guides/ # How-to guides
├── README.md # Guide index
├── cli-design.md # CLI design patterns
├── testing.md # Testing strategies
├── performance.md # Performance optimization
└── migration.md # Migrating from bash/Python
Nushell treats command output as structured data, not text:
# Commands return tables, not strings
ls | where size > 1mb | sort-by modified
# JSON is automatically parsed
http get https://api.example.com/data | get items | first 5
# Types are preserved through pipelines
date now | $in - 1day | format date "%Y-%m-%d"Data flows through pipelines with known shapes:
# Input: nothing → Output: table<name, size, modified>
ls
# Input: table → Output: table (filtered)
where size > 1mb
# Input: any → Output: transformed any
each { |it| $it.name | str upcase }Every command declares its interface:
# View command signature
help str join
# Signatures enforce types at runtime
def greet [name: string, --excited] -> string {
if $excited {
$"Hello, ($name)!"
} else {
$"Hello, ($name)."
}
}Skills automatically activate based on context:
| Skill | Triggers |
|---|---|
nushell-fundamentals |
pipelines, closures, modules, types |
nushell-data-processing |
polars, dataframes, large datasets |
nushell-http-api |
http commands, REST APIs, webhooks |
nushell-storage |
stor, SQLite, parquet, file formats |
nushell-cloudflare |
workers, R2, wrangler |
nushell-tooling |
LSP, linting, testing |
cli-guidelines |
CLI design, argument parsing |
| Command | Description |
|---|---|
/nushell-dev:new |
Scaffold scripts, modules, commands |
/nushell-dev:lint |
Lint and auto-fix Nushell code |
/nushell-dev:docs |
Generate documentation |
/nushell-dev:test |
Create or run tests |
/nushell-dev:convert |
Convert from bash/Python/jq |
/nushell-dev:cli-scaffold |
Create CLI-compliant scripts |
/nushell-dev:cli-check |
Audit against CLI guidelines |
| Agent | Purpose |
|---|---|
nushell-generator |
Generate complete scripts from descriptions |
nushell-code-reviewer |
Review for best practices |
nushell-refactorer |
Modernize and optimize code |
- PreToolUse: Validates syntax before writing
.nufiles - PostToolUse: Auto-formats after successful writes
/nushell-dev:new script --name my-script --description "Process log files"
/nushell-dev:convert ./legacy.sh
/nushell-dev:docs ./src
/nushell-dev:lint ./my-module.nu
# Good: Explicit types
def process [input: path, --format: string = "json"] -> table {
open $input | from json
}
# Avoid: Untyped parameters
def process [input, format] {
open $input
}# Good: Try/catch with meaningful errors
def safe-read [path: path] -> any {
try {
open $path
} catch {
error make { msg: $"Failed to read ($path)" }
}
}
# Good: Optional access with fallback
$record.maybe_field? | default "fallback"# Good: Return structured data
def analyze [file: path] -> record {
let content = open $file
{
lines: ($content | lines | length)
words: ($content | split words | length)
bytes: ($content | str length)
}
}
# Avoid: Return formatted strings
def analyze [file: path] {
print $"Lines: ..."
}# Good: Pipeline operations
ls **/*.nu | where size > 1kb | each { |f| open $f.name | lines | length }
# Avoid: Manual iteration
mut results = []
for f in (ls **/*.nu) {
if $f.size > 1kb {
$results = $results ++ [(open $f.name | lines | length)]
}
}# Fetch user data from the API
#
# Returns user record with profile information.
#
# Examples:
# fetch-user 123
# fetch-user 123 --include-posts
def fetch-user [
id: int # User ID to fetch
--include-posts # Include user's posts in response
] -> record {
# Implementation
}| Version | Nushell | Changes |
|---|---|---|
| 1.0.0 | 0.100+ | Initial release |
| 1.1.0 | 0.107+ | CLI guidelines, hooks |
| 1.2.0 | 0.110+ | Configuration reference |