Fix CI failure after #17237
I don't know how can it happened, but it seems that `rm -f` inside tests
should fix the problem.
## Release notes summary - What our users need to know
NaN
## Tasks after submitting
Fixes: #14900
The solution is suggested by @sgvictorino
## Release notes summary - What our users need to know
rm command will return error when there is one file is failed to remove.
## Tasks after submitting
This is an attempt to get explore's `:nu` command to stream the output
back to explore without blocking the UI. You can test with this command:
```nushell
:nu seq 1 100 | each { |x| sleep 100ms; $x }
```
The `:nu:` command is pretty heavily modified to use channels to
communicate now while spawning a background thread for processing.
This ups the complexit quite a bit so I won't be offended if we decide
_not_ to land this command.
closes https://github.com/nushell/nushell/issues/17206
## Release notes summary - What our users need to know
Within the `explore` command the `:nu` command will now stream content
by spawning the command issues without blocking.
## Tasks after submitting
N/A
A bug was reported that "save" didn't show all the parameters from
within the help menu. I tracked it down to this setting.
Closes#17220
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
This PR fixes a reported bug when pasting "12345abcde項目" into the Test
String widget in the `explore regex` command. It employes more use of
graphemes instead of byte indexes here to work around this problem.
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
## Release notes summary - What our users need to know
Provides the ability to use `polars open` and `polars save` with Google
Cloud Storage:
```nu
$env.GOOGLE_SERVICE_ACCOUNT = "/path/to/service_account.json"
$env.GOOGLE_BUCKET = "your_bucket"
ps | polars into-df | polars save gs://nushell_testing/ps.parquet
polars open gs://nushell_testing/ps.parquet | polars first 5 | polars collect
```
---------
Co-authored-by: Jack Wright <jack.wright@nike.com>
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->
* [x] `cargo clippy -- -D warnings -D clippy::unwrap_used`
* [x] `cargo test`
* [x] `cargo test --package nu-cli --test main --
commands::bytes_length`
* [x] `cargo fmt --all -- --check`
was surprised this did not work since `str length` works at const-time.
now it works.
not entirely sure if what i did with `Signals::EMPTY` is ok tho.
## Release notes summary - What our users need to know
<!--
This section will be included as part of our release notes. See the
contributing guide for more details.
Please include only details relevant for users here. Motivation and
technical details can be added above or below this section.
You may leave this section blank until your PR is finalized. Ask a core
team member if you need help filling this section.
-->
`bytes length` can now be used at const-time
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
---------
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: Tyarel8 <98483313+Tyarel8@users.noreply.github.com>
## Summary
- Add guidance to prefer `par-each` over `each` for parallel processing
in MCP instructions
- Includes examples showing sequential vs parallel iteration
- Documents when `each` is still appropriate (order preservation,
sequential side effects, small lists)
## Test plan
- [x] Documentation change only, no code changes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://discord.com/channels/601130461678272522/614593951969574961/1451198793394557039
## Release notes summary - What our users need to know
Added a flag called `--output` to the `timeit` command that will make
the command return a record with both the execution time and the output
of the closure.
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [x] Added test
Closes: #14858
This pr changes default glob_options while running `nu_glob` function,
by default it makes `require_literal_leading_dot` to be true.
And I added `-a` flag to make * matches dotfiles, so they are consistent
with `ls`. Although the wildcard are different with POSIX shell, but I
think it's fine.
## Release notes summary - What our users need to know
### `*` no longer matches dotfiles in mv/cp/du by default
```nushell
> touch .a
> cp * /tmp
> "/tmp/.a" | path exists
false
```
But users can make it matches dotfiles by `--all(-a)` flag.
## Tasks after submitting
## User-facing Changes
* New arguments! (`error make "hello"`)
* New parts for `error_struct`! (`error make {inner: [] labels: []
...}`)
* Pipeline inputs for chained errors! (`try {error make foo} catch
{error make bar}`)
* Pipeline inputs for normal errors! (`"help" | error make`)
* External errors! (`error make {src: {path: $nu.cofig-path} ...}`)
* Backwards compatibility!
### Arguments and Inputs
The main changes are in how the arguments are passed. Everything is
still backwards compatible with the old `error make` commands, there's
just a nice extra layer we get from the pipeline and a few new args
(that were already added in #17037). There are some new ways to
(hopefully intentionally) cause an error, such as using a naked `error
make`, pipelines from records and simple string input!
#### Inputs
Because `error make` will just make an error anyway, it can technically
take any input to make an error, but only properly formatted record
input will create a chain. the `x | f $in` pattern can be used for
string input, if that is more comfortable.
#### With no arguments
This is a completely new way to do this, with no arguments the `error
make` invocation is highlighted, along with a simple `originates from
here` message. This makes normal errors very easy to create without any
special message setup.
```
> error make
Error: nu::shell::error
× originates from here
╭─[entry #4:1:1]
1 │ error make
· ──────────
╰────
```
#### Create a single argument
* With pipeline input: `{msg: foo} | error make`
* With an argument: `error make {msg: foo}`
* With a string argument: `error make foo`
```
Error: nu::shell::error
× foo
╭─[entry #2:1:12]
1 │ error make {msg: foo}
· ──────────
╰────
```
#### Chaining errors together
These will automatically create a chain of errors, placing the pipeline
as an `inner` to the argument. This can very easily be used to get a bit
more detail in a try loop using the naked `error make`:
```
Error: nu::shell::error
× originates from here
╭─[source:1:31]
1 │ try {error make "foo"} catch {error make}
· ──────────
╰────
Error: nu::shell::error
× foo
╭─[source:1:6]
1 │ try {error make "foo"} catch {error make}
· ──────────
╰────
```
Or with more complex errors:
* With both, combining the errors: `{msg: foo} | error make bar`
* With the raw error from try: `try {error make foo} catch {error make
bar}`
Both are equivalent to:
* `error make {msg: bar inner: [{msg: foo}]}`
```
Error: nu::shell::error
× bar
╭─[entry #1:1:29]
1 │ try {error make foo} catch {error make bar}
· ──────────
╰────
Error: nu::shell::error
× foo
╭─[entry #1:1:6]
1 │ try {error make foo} catch {error make bar}
· ──────────
╰────
```
### Labels
As is noticeable in the examples above, simple errors no longer use an
extra line for the label. If no label is present, `error make` will
place a bar under the span of itself or the argument to `error make`.
Labels have also gotten a bit of a rewrite, but they're pretty much the
same as those in #17037, except for `label`, which is now only a single
label (not `oneof<list, label>`).
#### Simple Labels
`label.text` and `labels.*.text` is no longer required for a span to
show up, an empty text will simply underline. This example can either
use `label: $record` or be written as `labels: [$record]`:
```
> def f [x] {
error make {msg: here label: {span: (metadata $x).span}}
}
f abcd
Error: nu::shell::error
× here
╭─[entry #7:4:3]
3 │ }
4 │ f abcd
· ────
╰────
```
#### Multiple labels
Any number of labels can be added in the `labels` column, allowing for
more detailed error messages, especially for functions:
```
> def f [x y z] {
error make {msg: here labels: [
{text: "there" span: (metadata $x).span}
{text: "everywhere" span: (metadata $y).span}
{text: "somewhere" span: (metadata $z).span}
]
}
}
f abcd [x y z] {d: a}
Error: nu::shell::error
× here
╭─[entry #11:9:3]
8 │ }
9 │ f abcd [x y z] {d: a}
· ──┬─ ───┬─── ───┬──
· │ │ ╰── somewhere
· │ ╰── everywhere
· ╰── there
╰────
```
#### External sources
There is a `ShellError::OutsideSpannedLabeledError` that can be used to
refer to external sources, not just the internal nushell spanns. This
has been expanded to allow the multi-label stuff to work using the new
`src` column:
```
> "foo\nbar\nbaz" | save -f /tmp/foo.bar
error make {
msg: 'error here'
src: {path: /tmp/foo.bar}
labels: [
{text: "this" span: {start: 4 end: 7}}
]
}
Error: nu::shell::outside
× error here
╭─[/tmp/foo.bar:2:1]
1 │ foo
2 │ bar
· ─┬─
· ╰── this
3 │ baz
╰────
```
### Errors That Can't be Caught
These will not work since `try` will never get parsed:
- `try {1 + ""} catch {error make badmath}`
- (TODO: Add more examples)
## Internal Changes
Most of the parsing from an error record to an actual error is now moved
into `nu-protocol`, using `FromValue` to turn it into a useful internal
type.
### `nu-protocol::LabeledError`
This struct has a few changes, the main one being the type of
`LabeledError.inner`. It is now a `ShellError`, not another
`LabeledError`. It should be trivial to do a `.into()` for things that
already use `LabeledError.with_inner(x)`.
### `nu-protocol::ShellError::into_value`
I renamed the old `into_value` to `into_full_value` to better say what
it is, since it doesn't just do the `IntoValue::into_value` method, it
also requires some context to create the `Value`. Now `ShellError` has
an `IntoValue` implementation matching other types.
### `nu-protocol::ShellError::{OutsideSource, OutsideSourceNoUrl}`
Miette's derived types don't have a nice way to maybe include a url, so
there are now two types! These allow using multiple labels on outside
sources. They are used internally for the new `{src: {}}` part of the
`error_struct`, and they look a lot more like the `LabeledError`, but
without the need for a separate type and all the fun `impl`s that would
require for the `Diagnostic::source_code` method.
### Misc
* Spelling fix: `into_chainned` => `into_chained`
## Current bugs:
- [x] `OutsideSpannedLabeledError`
The inner most error of `try {']' from nuon} catch {error make}` will
reference `span: {start: 0, end: 1}`, which in `']' from nuon` will
point to the `]` character, but when it does this in `error make` as an
input it will point to the very first character (probably the `n` in
`nu`).
## Release notes summary - What our users need to know
### New `error make` functionality!
* New arguments! (`error make "hello"`)
* New parts for `error_struct`! (`error make {inner: [] labels: []
...}`)
* Pipeline inputs for chained errors! (`try {error make foo} catch
{error make bar}`)
* Pipeline inputs for normal errors! (`"help" | error make`)
* External errors! (`error make {src: {path: $nu.cofig-path} ...}`)
* Backwards compatibility!
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
This PR fixes the ctrl-c bug @NotTheDr01ds discovered.
closes#17196
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
This PR adds a quick reference panel to `explore regex` with the F1
keybinding and dismisses it with the ESC keybinding. If you click on any
of the items in the quick reference panel, it puts them in the Regex
Pattern edit box. I also refactored a bit to make it eassier to
maintain.
<img width="3234" height="2070" alt="image"
src="https://github.com/user-attachments/assets/502a6566-715f-4ce0-b787-6012fc5b9942"
/>
## Release notes summary - What our users need to know
Add a quick reference panel to `explore regex` with the F1 keybinding
and dismiss it with the ESC keybinding.
## Tasks after submitting
N/A
#17185 # Release notes summary - What our users need to know
Fixes an issue caused by #17085. In that PR, the environment is reset
before running tests. That's a good thing, but it breaks tests entirely
if your Cargo environment is customized using environment variables.
This adds back in `CARGO_*` and `RUSTUP_*` environment variables to help
ensure a proper test run.
## Tasks after submitting
N/A
This PR adds an Agents.md file to help with LLMs
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
I forgot adding `http pool` cmd in #17157. Which is reported by @Tyarel8
.
## Release notes summary - What our users need to know
NaN
## Tasks after submitting
This PR refactors the nu-explore crate so that things are easier to
understand and maintain.
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
Some tweaks to `explore config`
- Make Description a little smaller
- Add syntax highlighting of Value widget
- Fix Ctrl-Enter (remove it) because it didn't work on MacOS
<img width="3234" height="2070" alt="image"
src="https://github.com/user-attachments/assets/eb2740e0-37c5-4d14-94b2-5bb1bf848083"
/>
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
Close#14810
This is done by creating a global `ureq::Agent` in http::client module.
Yeah using global variable may be not good, but it's worse to introduce
such cache in `EngineState`, because it requires `nu-protocol` depends
on `ureq`.
When `--pool` flag is provided, a global `ureq::Agent` will be used, or
else nushell will create a new http connection.
This pr also introduce a new `http pool` command to customize the global
`ureq::Agent` properties.
## Release notes summary - What our users need to know
A new flag `--pool` is added to http relative commands, so users can
reuse the connection:
```nu
http get https://www.google.com --pool
```
Users can also use `http pool` command to reset and customize http pool.
## Tasks after submitting
NaN
## Release notes summary - What our users need to know
This cleans up the `explore` TUI a bit and makes it look a little more
professional. The focus was just on the UI. Functionality should remain
the same.
Add the ability to search `explore config` with `/` or `CTRL-F`.
closes#17167
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
This PR closes#17165 so that when you type in the test string area, the
match count updates.
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
This PR is a follow up to the `explore config` PR
https://github.com/nushell/nushell/pull/17147 to clean some things up.
1. I rewrote the doc_config.nu to make it better work with the TUI
2. I updated the parsing of the doc_config.nu so it would exclude
section headers
3. I fixed a rendering glitch where \n's weren't being escaped right and
were leaking onto the screen
4. I added PgUp/PgDown when just +10/-10 items in the tree widget
5. I disallowed the documentation warning triangle on keybindings and
menus to declutter a bit (probably still some work to do here)
closes https://github.com/nushell/nushell/issues/17166
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
## Summary
- Adds explicit BAD/GOOD examples for stderr redirection syntax to MCP
instructions
## Motivation
Claude Opus 4.5 frequently uses bash-style `2>&1` syntax when running
commands via MCP, despite the command equivalents table in
`evaluate_tool.md`. Explicit BAD/GOOD code blocks (like the string
interpolation section already has) help the model avoid this common
mistake.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Fixes#7245.
I added a configuration option `show_hints` that can be used to disable
hints.
## Release notes summary - What our users need to know
### New Configuration Option: `$env.config.show_hints`
You can now disable hints for completions and the history by setting
`$env.config.show_hints = false`.
## Release notes summary - What our users need to know
This makes a descriptive error message for particular IO / OS errors on
the "rm" command. This would be helpful in the associated issue, where
MacOS will silently deny access in some circumstances, and it can appear
to users as an inconsistency within Nushell
related to #17057
## Tasks after submitting
## Release notes summary - What our users need to know
Introducing the `explore config` command.
Functionality:
- When launched with no parameters it loads your config settings into a
tree and editor to allow you to traverse, explore, and change settings.
- When launched with the `--tree` parameter, it draws a tree view of
your piped in input into the terminal
- When launched with the `--use-example-data` parameter, it shows you a
customized configuration (my config actually). May be removed later.
- When JSON is piped into it e.g `'{"abc": 1, "xyz": 2}' | explore
config --output foo.json` it allows you to explore and edit the JSON
data and save it out to the provided filename.
- When in "config mode" it shows you the nushell datatypes as you
traverse the tree. When in "json" mode it shows you the json datatypes
as you traverse the tree.
- When in "config mode" it shows you a description of the config setting
_assuming proper documentation in doc_config.nu_. This file will need to
be updated a bit in a separate PR. If there is no documentation it shows
you a warning triangle by the tree item.
- As you make changes to your config, you can save those changes and
they're immediately applied.
- If you hit Enter on any node leaf, you immediately jump into editing
that value. If you hit Enter on tree nodes, the tree expands or
collapses.

Help
```nushell
❯ explore config --help
Launch a TUI to view and edit the nushell configuration interactively.
By default, opens the current nushell configuration ($env.config) in the TUI.
Changes made in config mode are applied to the running session when you quit.
You can also pipe JSON data to explore arbitrary data structures, or use
--use-example-data to see sample configuration data.
TUI Keybindings:
Tab Switch between tree and editor panes
↑↓ Navigate tree / scroll editor
←→ Collapse/Expand tree nodes
Enter/Space Toggle tree node expansion
Enter/Space On leaf nodes, open editor pane
Enter/e Start editing (in editor pane)
Ctrl+Enter Apply edit
Esc Cancel edit
Ctrl+S Save/Apply changes
q Quit (applies config changes if modified)
Ctrl+C Force quit without saving
Usage:
> explore config {flags}
Flags:
-h, --help: Display the help message for this command
-e, --use-example-data: Show the nushell configuration TUI using example data
-t, --tree: Do not show the TUI, just show a tree structure of the data
-o, --output <string>: Optional output file to save changes to (default: output.json)
Input/output types:
╭─#─┬──input──┬─output─╮
│ 0 │ nothing │ string │
│ 1 │ string │ string │
╰───┴─────────┴────────╯
Examples:
Open the nushell configuration in an interactive TUI editor
> explore config
Explore JSON data interactively
> open --raw data.json | explore config
Explore with example data to see TUI features
> explore config --use-example-data
```
## Potential TODOs
- Would be nice to add a searching capability
- Update doc_config.nu as mentioned
- Maybe add scrolling to Description if needed
- Open json files without needing --raw option
- Make status bar more colorful and helpful
- Add syntax highlighting to the Value widget
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
## Release notes summary - What our users need to know
The MCP server support is now included as a default feature.
---------
Co-authored-by: Jack Wright <jack.wright@nike.com>
## Summary
Adds documentation about nushell's string interpolation syntax to the
MCP server instructions.
## Problem: LLM Model Behavior
When using Claude Opus 4.5 with the nu-mcp server, the model
consistently attempted bash-style string interpolation which fails
silently or produces errors:
```nu
# What Opus 4.5 tried (bash muscle memory)
mysql -u $env.USER -p$env.PASSWORD dbname # Fails: -p and $env.PASSWORD are separate args
echo "hello $name" # Fails: prints literal "$name"
```
The model would hit cryptic errors like `non_zero_exit_code` without
understanding why, then retry with the same pattern multiple times
before eventually stumbling onto the correct syntax.
## Solution
Add explicit documentation showing the correct `$"...(expr)..."` syntax
with practical examples:
```nu
# Correct nushell interpolation
let name = "world"; echo $"hello ($name)" # Prints: hello world
ls $"($env.HOME)/Documents" # Expands path correctly
cargo build $"--jobs=(sys cpu | length)" # Dynamic flag value
```
## Why This Matters
MCP instructions are injected into the model's context and directly
influence tool usage patterns. Without this documentation, models waste
tokens on failed attempts and may give up or produce incorrect results.
This is a high-leverage fix since it affects every LLM interaction with
the nu-mcp server.
## Release notes summary - What our users need to know
This PR just makes the UI look a little more professional, abstracts the
coloring, and tries to make the code a little more idiomatic.
<img width="1222" height="676" alt="image"
src="https://github.com/user-attachments/assets/15e64dcf-96f7-4c6c-87da-b52c1f78d986"
/>
## Tasks after submitting
<!-- Remove any tasks which aren't relevant for your PR, or add your own
-->
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)
<img width="1582" height="686" alt="image"
src="https://github.com/user-attachments/assets/538326ec-7ec8-45c0-a59f-f170ea88f5f8"
/>
- Add `$history` variable that stores all previous command outputs
- Access by index: `$history.0`, `$history.1`, etc.
- Wrap all responses in structured record with:
- `history_index`: 0-based index of result in history
- `cwd`: current working directory after command
- `output`: command output (possibly truncated)
- Truncate large outputs (>10k chars by default) and reference history
- Configurable threshold via `NU_MCP_OUTPUT_TRUNCATE` env var
- Remove moka caching (incompatible with history tracking)
- Update instructions.md with history documentation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Fixes: #14739
Given the example:
```nushell
#!/usr/bin/env nu
def something [] { "example" }
module spam {}
overlay use spam
def bar [] { "bar" }
overlay hide spam
bar # Returns bar
```
The issue is happened when:
1. nushell parses a scripts, it makes a `preparse` to all custom
commands.
2. When parse `def something`, it calls `parse_def` then calls
`merge_predecl`
3. All custom commands in the current scope are moved to overlay `zero`.
But `bar` should not be moved at that time.
So I think it's good to move just the command `something` to overlay
`zero`.
Also we don't need to move predecls to overlay when adding overlays, it
can move some functions to wrong overlay.
## Release notes summary - What our users need to know
### Overlay works more reliable inside script.
```nushell
#!/usr/bin/env nu
def something [] { "example" }
module spam {}
overlay use spam
def bar [] { "bar" }
overlay hide spam
bar
```
`bar` won't be available to use after `overlay hide spam`.
## Tasks after submitting
NaN
This PR bumps the rust-toolchain to 1.90.0. The newest toolchain will be
released in 3 days. However, I've seen that vscode on Windows will not
run with 1.89.0 anymore and requires at least 1.90.0.
## Release notes summary - What our users need to know
N/A
## Tasks after submitting
N/A
## Release notes summary - What our users need to know
Introduces Azure support to the polars plugin.
The following environment variables will are supported:
- AZURE_STORAGE_ACCOUNT_NAME: storage account name
- AZURE_STORAGE_ACCOUNT_KEY: storage account master key
- AZURE_STORAGE_ACCESS_KEY: alias for AZURE_STORAGE_ACCOUNT_KEY
- AZURE_STORAGE_CLIENT_ID: client id for service principal authorization
- AZURE_STORAGE_CLIENT_SECRET: client secret for service principal
authorization
- AZURE_STORAGE_TENANT_ID: tenant id used in oauth flows
Example Usage:
```nu
$env.AZURE_STORAGE_ACCOUNT_KEY = "<your access key value>"
$env.AZURE_STORAGE_ACCOUNT_NAME = "<your account name>"
ps | polars into-df | polars save azure://<your account name>/ps.parquet
polars open azure://<your account name>/ps.parquet | polars first 5 | polars collect
```
Co-authored-by: Jack Wright <jack.wright@nike.com>