From 0dbfca8b5d53b25051b6963223014ac8ebdb3294 Mon Sep 17 00:00:00 2001 From: Peng Lu Date: Wed, 3 Jun 2026 17:46:28 +0800 Subject: [PATCH] Update plugin list docs: replace is_running with status field --- book/plugins.md | 68 ++++++++++++++++++++++--------------------- ko/book/plugins.md | 68 ++++++++++++++++++++++--------------------- zh-CN/book/plugins.md | 68 ++++++++++++++++++++++--------------------- 3 files changed, 105 insertions(+), 99 deletions(-) diff --git a/book/plugins.md b/book/plugins.md index e35b4db6a25..d978136ffb9 100644 --- a/book/plugins.md +++ b/book/plugins.md @@ -199,23 +199,25 @@ Installed plugins are displayed using [`plugin list`](/commands/docs/plugin_list ```nu plugin list # => -╭───┬─────────┬────────────┬─────────┬───────────────────────┬───────┬───────────────────────────────╮ -│ # │ name │ is_running │ pid │ filename │ shell │ commands │ -├───┼─────────┼────────────┼─────────┼───────────────────────┼───────┼───────────────────────────────┤ -│ 0 │ gstat │ true │ 1389890 │ .../nu_plugin_gstat │ │ ╭───┬───────╮ │ -│ │ │ │ │ │ │ │ 0 │ gstat │ │ -│ │ │ │ │ │ │ ╰───┴───────╯ │ -│ 1 │ inc │ false │ │ .../nu_plugin_inc │ │ ╭───┬─────╮ │ -│ │ │ │ │ │ │ │ 0 │ inc │ │ -│ │ │ │ │ │ │ ╰───┴─────╯ │ -│ 2 │ example │ false │ │ .../nu_plugin_example │ │ ╭───┬───────────────────────╮ │ -│ │ │ │ │ │ │ │ 0 │ nu-example-1 │ │ -│ │ │ │ │ │ │ │ 1 │ nu-example-2 │ │ -│ │ │ │ │ │ │ │ 2 │ nu-example-3 │ │ -│ │ │ │ │ │ │ │ 3 │ nu-example-config │ │ -│ │ │ │ │ │ │ │ 4 │ nu-example-disable-gc │ │ -│ │ │ │ │ │ │ ╰───┴───────────────────────╯ │ -╰───┴─────────┴────────────┴─────────┴───────────────────────┴───────┴───────────────────────────────╯ +╭───┬───────┬─────────┬─────────┬───────┬───────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ # │ name │ version │ status │ pid │ filename │ shell │ commands │ +├───┼───────┼─────────┼─────────┼───────┼───────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ 0 │ gstat │ 0.113.0 │ loaded │ │ .../nu_plugin_gstat │ │ ╭───┬───────┬──────────────────────────────╮ │ +│ │ │ │ │ │ │ │ │ # │ name │ description │ │ +│ │ │ │ │ │ │ │ ├───┼───────┼──────────────────────────────┤ │ +│ │ │ │ │ │ │ │ │ 0 │ gstat │ Get the git status of a repo │ │ +│ │ │ │ │ │ │ │ ╰───┴───────┴──────────────────────────────╯ │ +│ 1 │ query │ 0.113.0 │ running │ 27312 │ .../nu_plugin_query │ │ ╭───┬────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ │ │ │ │ │ │ │ # │ name │ description │ │ +│ │ │ │ │ │ │ │ ├───┼────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ │ │ │ │ │ │ │ 0 │ query │ Show all the query commands │ │ +│ │ │ │ │ │ │ │ │ 1 │ query json │ execute json query on json file (open --raw | query json 'query string') │ │ +│ │ │ │ │ │ │ │ │ 2 │ query web │ execute selector query on html/web │ │ +│ │ │ │ │ │ │ │ │ 3 │ query webpage-info │ uses the webpage crate to extract info from html: title, description, language, links, │ │ +│ │ │ │ │ │ │ │ │ │ │ RSS feeds, Opengraph, Schema.org, and more │ │ +│ │ │ │ │ │ │ │ │ 4 │ query xml │ Execute XPath 1.0 query on XML input │ │ +│ │ │ │ │ │ │ │ ╰───┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────╯ │ +╰───┴───────┴─────────┴─────────┴───────┴───────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` All of the commands from installed plugins are available in the current scope: @@ -228,31 +230,31 @@ scope commands | where type == "plugin" Plugins stay running while they are in use, and are automatically stopped by default after a period of time of inactivity. This behavior is managed by the [plugin garbage collector](#plugin-garbage-collector). To manually stop a plugin, call `plugin stop` with its name: -For example, run the `gstat` command from the corresponding plugin, then check its `is_running` status: +For example, run the `query` command from the corresponding plugin, then check its `status` status: ```nu -gstat -# => gstat output -plugin list | where name == gstat | select name is_running +http get http://example.com | query web --document --query body +# => query output +plugin list | where name == query | select name status # => -╭───┬───────┬────────────╮ -│ # │ name │ is_running │ -├───┼───────┼────────────┤ -│ 0 │ gstat │ true │ -╰───┴───────┴────────────╯ +╭───┬───────┬─────────╮ +│ # │ name │ status │ +├───┼───────┼─────────┤ +│ 0 │ query │ running │ +╰───┴───────┴─────────╯ ``` Now stop the plugin manually, and we can see that it is no longer running: ```nu -plugin stop gstat -plugin list | where name == gstat | select name is_running +plugin stop query +plugin list | where name == query | select name status # => -╭───┬───────┬────────────╮ -│ # │ name │ is_running │ -├───┼───────┼────────────┤ -│ 0 │ gstat │ false │ -╰───┴───────┴────────────╯ +╭───┬───────┬────────╮ +│ # │ name │ status │ +├───┼───────┼────────┤ +│ 0 │ query │ loaded │ +╰───┴───────┴────────╯ ``` ### Plugin Garbage Collector diff --git a/ko/book/plugins.md b/ko/book/plugins.md index 7bcf3c64a8d..77e4742acae 100644 --- a/ko/book/plugins.md +++ b/ko/book/plugins.md @@ -196,23 +196,25 @@ nu --plugins '[./my_plugins/nu_plugin_cool]' ```nu plugin list # => -╭───┬─────────┬────────────┬─────────┬───────────────────────┬───────┬───────────────────────────────╮ -│ # │ name │ is_running │ pid │ filename │ shell │ commands │ -├───┼─────────┼────────────┼─────────┼───────────────────────┼───────┼───────────────────────────────┤ -│ 0 │ gstat │ true │ 1389890 │ .../nu_plugin_gstat │ │ ╭───┬───────╮ │ -│ │ │ │ │ │ │ │ 0 │ gstat │ │ -│ │ │ │ │ │ │ ╰───┴───────╯ │ -│ 1 │ inc │ false │ │ .../nu_plugin_inc │ │ ╭───┬─────╮ │ -│ │ │ │ │ │ │ │ 0 │ inc │ │ -│ │ │ │ │ │ │ ╰───┴─────╯ │ -│ 2 │ example │ false │ │ .../nu_plugin_example │ │ ╭───┬───────────────────────╮ │ -│ │ │ │ │ │ │ │ 0 │ nu-example-1 │ │ -│ │ │ │ │ │ │ │ 1 │ nu-example-2 │ │ -│ │ │ │ │ │ │ │ 2 │ nu-example-3 │ │ -│ │ │ │ │ │ │ │ 3 │ nu-example-config │ │ -│ │ │ │ │ │ │ │ 4 │ nu-example-disable-gc │ │ -│ │ │ │ │ │ │ ╰───┴───────────────────────╯ │ -╰───┴─────────┴────────────┴─────────┴───────────────────────┴───────┴───────────────────────────────╯ +╭───┬───────┬─────────┬─────────┬───────┬───────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ # │ name │ version │ status │ pid │ filename │ shell │ commands │ +├───┼───────┼─────────┼─────────┼───────┼───────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ 0 │ gstat │ 0.113.0 │ loaded │ │ .../nu_plugin_gstat │ │ ╭───┬───────┬──────────────────────────────╮ │ +│ │ │ │ │ │ │ │ │ # │ name │ description │ │ +│ │ │ │ │ │ │ │ ├───┼───────┼──────────────────────────────┤ │ +│ │ │ │ │ │ │ │ │ 0 │ gstat │ Get the git status of a repo │ │ +│ │ │ │ │ │ │ │ ╰───┴───────┴──────────────────────────────╯ │ +│ 1 │ query │ 0.113.0 │ running │ 27312 │ .../nu_plugin_query │ │ ╭───┬────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ │ │ │ │ │ │ │ # │ name │ description │ │ +│ │ │ │ │ │ │ │ ├───┼────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ │ │ │ │ │ │ │ 0 │ query │ Show all the query commands │ │ +│ │ │ │ │ │ │ │ │ 1 │ query json │ execute json query on json file (open --raw | query json 'query string') │ │ +│ │ │ │ │ │ │ │ │ 2 │ query web │ execute selector query on html/web │ │ +│ │ │ │ │ │ │ │ │ 3 │ query webpage-info │ uses the webpage crate to extract info from html: title, description, language, links, │ │ +│ │ │ │ │ │ │ │ │ │ │ RSS feeds, Opengraph, Schema.org, and more │ │ +│ │ │ │ │ │ │ │ │ 4 │ query xml │ Execute XPath 1.0 query on XML input │ │ +│ │ │ │ │ │ │ │ ╰───┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────╯ │ +╰───┴───────┴─────────┴─────────┴───────┴───────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` 설치된 플러그인의 모든 명령은 현재 범위에서 사용할 수 있습니다. @@ -225,31 +227,31 @@ scope commands | where type == "plugin" 플러그인은 사용 중인 동안 계속 실행되며, 비활성 상태가 일정 기간 지속되면 기본적으로 자동으로 중지됩니다. 이 동작은 [플러그인 가비지 수집기](#plugin-garbage-collector)에 의해 관리됩니다. 플러그인을 수동으로 중지하려면 해당 이름으로 `plugin stop`을 호출하십시오. -예를 들어, 해당 플러그인에서 `gstat` 명령을 실행한 다음 `is_running` 상태를 확인하십시오. +예를 들어, 해당 플러그인에서 `query` 명령을 실행한 다음 `status` 상태를 확인하십시오. ```nu -gstat -# => gstat 출력 -plugin list | where name == gstat | select name is_running +http get http://example.com | query web --document --query body +# => query 출력 +plugin list | where name == query | select name status # => -╭───┬───────┬────────────╮ -│ # │ name │ is_running │ -├───┼───────┼────────────┤ -│ 0 │ gstat │ true │ -╰───┴───────┴────────────╯ +╭───┬───────┬─────────╮ +│ # │ name │ status │ +├───┼───────┼─────────┤ +│ 0 │ query │ running │ +╰───┴───────┴─────────╯ ``` 이제 플러그인을 수동으로 중지하면 더 이상 실행되지 않는 것을 볼 수 있습니다. ```nu -plugin stop gstat -plugin list | where name == gstat | select name is_running +plugin stop query +plugin list | where name == query | select name status # => -╭───┬───────┬────────────╮ -│ # │ name │ is_running │ -├───┼───────┼────────────┤ -│ 0 │ gstat │ false │ -╰───┴───────┴────────────╯ +╭───┬───────┬────────╮ +│ # │ name │ status │ +├───┼───────┼────────┤ +│ 0 │ query │ loaded │ +╰───┴───────┴────────╯ ``` ### 플러그인 가비지 수집기 diff --git a/zh-CN/book/plugins.md b/zh-CN/book/plugins.md index 2a8ca349722..18b49e486e3 100644 --- a/zh-CN/book/plugins.md +++ b/zh-CN/book/plugins.md @@ -196,23 +196,25 @@ Nushell 包括两个可用于设置插件搜索路径的 `list` 变量。这仅 ```nu plugin list # => -╭───┬─────────┬────────────┬─────────┬───────────────────────┬───────┬───────────────────────────────╮ -│ # │ name │ is_running │ pid │ filename │ shell │ commands │ -├───┼─────────┼────────────┼─────────┼───────────────────────┼───────┼───────────────────────────────┤ -│ 0 │ gstat │ true │ 1389890 │ .../nu_plugin_gstat │ │ ╭───┬───────╮ │ -│ │ │ │ │ │ │ │ 0 │ gstat │ │ -│ │ │ │ │ │ │ ╰───┴───────╯ │ -│ 1 │ inc │ false │ │ .../nu_plugin_inc │ │ ╭───┬─────╮ │ -│ │ │ │ │ │ │ │ 0 │ inc │ │ -│ │ │ │ │ │ │ ╰───┴─────╯ │ -│ 2 │ example │ false │ │ .../nu_plugin_example │ │ ╭───┬───────────────────────╮ │ -│ │ │ │ │ │ │ │ 0 │ nu-example-1 │ │ -│ │ │ │ │ │ │ │ 1 │ nu-example-2 │ │ -│ │ │ │ │ │ │ │ 2 │ nu-example-3 │ │ -│ │ │ │ │ │ │ │ 3 │ nu-example-config │ │ -│ │ │ │ │ │ │ │ 4 │ nu-example-disable-gc │ │ -│ │ │ │ │ │ │ ╰───┴───────────────────────╯ │ -╰───┴─────────┴────────────┴─────────┴───────────────────────┴───────┴───────────────────────────────╯ +╭───┬───────┬─────────┬─────────┬───────┬───────────────────────┬───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ +│ # │ name │ version │ status │ pid │ filename │ shell │ commands │ +├───┼───────┼─────────┼─────────┼───────┼───────────────────────┼───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤ +│ 0 │ gstat │ 0.113.0 │ loaded │ │ .../nu_plugin_gstat │ │ ╭───┬───────┬──────────────────────────────╮ │ +│ │ │ │ │ │ │ │ │ # │ name │ description │ │ +│ │ │ │ │ │ │ │ ├───┼───────┼──────────────────────────────┤ │ +│ │ │ │ │ │ │ │ │ 0 │ gstat │ Get the git status of a repo │ │ +│ │ │ │ │ │ │ │ ╰───┴───────┴──────────────────────────────╯ │ +│ 1 │ query │ 0.113.0 │ running │ 27312 │ .../nu_plugin_query │ │ ╭───┬────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────╮ │ +│ │ │ │ │ │ │ │ │ # │ name │ description │ │ +│ │ │ │ │ │ │ │ ├───┼────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────┤ │ +│ │ │ │ │ │ │ │ │ 0 │ query │ Show all the query commands │ │ +│ │ │ │ │ │ │ │ │ 1 │ query json │ execute json query on json file (open --raw | query json 'query string') │ │ +│ │ │ │ │ │ │ │ │ 2 │ query web │ execute selector query on html/web │ │ +│ │ │ │ │ │ │ │ │ 3 │ query webpage-info │ uses the webpage crate to extract info from html: title, description, language, links, │ │ +│ │ │ │ │ │ │ │ │ │ │ RSS feeds, Opengraph, Schema.org, and more │ │ +│ │ │ │ │ │ │ │ │ 4 │ query xml │ Execute XPath 1.0 query on XML input │ │ +│ │ │ │ │ │ │ │ ╰───┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────╯ │ +╰───┴───────┴─────────┴─────────┴───────┴───────────────────────┴───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` 已安装插件的所有命令在当前作用域中都可用: @@ -225,31 +227,31 @@ scope commands | where type == "plugin" 插件在使用时保持运行,并且在一段时间不活动后默认会自动停止。此行为由[插件垃圾回收器](#plugin-garbage-collector)管理。要手动停止插件,请使用其名称调用 `plugin stop`: -例如,从相应的插件运行 `gstat` 命令,然后检查其 `is_running` 状态: +例如,从相应的插件运行 `query` 命令,然后检查其 `status` 状态: ```nu -gstat -# => gstat output -plugin list | where name == gstat | select name is_running +http get http://example.com | query web --document --query body +# => query output +plugin list | where name == query | select name status # => -╭───┬───────┬────────────╮ -│ # │ name │ is_running │ -├───┼───────┼────────────┤ -│ 0 │ gstat │ true │ -╰───┴───────┴────────────╯ +╭───┬───────┬─────────╮ +│ # │ name │ status │ +├───┼───────┼─────────┤ +│ 0 │ query │ running │ +╰───┴───────┴─────────╯ ``` 现在手动停止插件,我们可以看到它不再运行: ```nu -plugin stop gstat -plugin list | where name == gstat | select name is_running +plugin stop query +plugin list | where name == query | select name status # => -╭───┬───────┬────────────╮ -│ # │ name │ is_running │ -├───┼───────┼────────────┤ -│ 0 │ gstat │ false │ -╰───┴───────┴────────────╯ +╭───┬───────┬────────╮ +│ # │ name │ status │ +├───┼───────┼────────┤ +│ 0 │ query │ loaded │ +╰───┴───────┴────────╯ ``` ### 插件垃圾回收器