Skip to content

feat: add nushell's plugin management commands (plugin list, stop, use, ...) - #56

Merged
cablehead merged 2 commits into
mainfrom
plugin-commands
Oct 21, 2026
Merged

cablehead merged 2 commits into
mainfrom
plugin-commands

Conversation

@cablehead

Copy link
Copy Markdown
Owner

Adds the nu-cmd-plugin command context (0.116.0, matching the other nu crates) to the engine in Engine::new, so scripts can use plugin list, plugin stop, plugin use, plugin add and plugin rm. Previously these failed with "Command plugin not found".

The use case is a served script checking on a plugin loaded with --plugin, e.g. plugin list --engine | where name == foo | get pid.0 to see whether the plugin process exited and was respawned.

Changes:

  • Cargo.toml / Cargo.lock: add nu-cmd-plugin = "0.116.0", locked at 0.116.0 so the other nu crates stay on 0.116.0.
  • src/engine.rs: call nu_cmd_plugin::add_plugin_command_context.
  • README.md: note in the Plugins section that the plugin commands are available.

Tests:

  • server_test::test_plugin_list_engine: a served closure with the test plugin loaded; plugin list --engine reports status running and a pid equal to the one test-plugin-pid returns.
  • eval_test::test_eval_plugin_stop_respawns: after plugin stop test, the next plugin call runs in a new process and plugin list --engine reports the new pid.

cargo fmt --check, cargo clippy (flags from scripts/check.sh), cargo test, the three tests/*.nu suites and the two example tests pass. deno fmt README.md --check was not run (deno not installed on the machine).

@cablehead
cablehead merged commit 3bedf9e into main Oct 21, 2026
8 checks passed
@cablehead
cablehead deleted the plugin-commands branch October 21, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant