Skip to content

Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.

fix: keep method templates in he list --lang zh

Frankie-Xu0b370d08cf82
diff --git a/docs/en/cli/commands/list.md b/docs/en/cli/commands/list.md
index b35a6c8..a0cef6f 100644
--- a/docs/en/cli/commands/list.md
+++ b/docs/en/cli/commands/list.md
@@ -137,10 +137,12 @@ he list method | grep -q light_rag && echo "Available"
|---------|-----------|---------|
| **Purpose** | Domain-specific extraction | General algorithms |
| **Configuration** | Pre-configured prompts | Algorithm parameters |
-| **Language** | Multi-language support | English only |
+| **Language** | Multi-language support | Descriptions are English only (rows still appear under `--lang zh`) |
| **Use case** | Quick start, domain tasks | Research, customization |
| **Example** | `finance/earnings_summary` | `light_rag` |
+`he list template --lang zh` still includes `method/*` rows. Method descriptions are currently English-only; `--no-methods` hides them in every language.
+
---
## See Also
diff --git a/docs/zh/cli/commands/list.md b/docs/zh/cli/commands/list.md
index 2f3f3de..f0af652 100644
--- a/docs/zh/cli/commands/list.md
+++ b/docs/zh/cli/commands/list.md
@@ -137,10 +137,12 @@ he list method | grep -q light_rag && echo "Available"
|---------|-----------|---------|
| **目的** | 特定领域提取 | 通用算法 |
| **配置** | 预配置提示 | 算法参数 |
-| **语言** | 多语言支持 | 仅英文 |
+| **语言** | 多语言支持 | 描述目前只有英文(`--lang zh` 下列表仍会显示这些行) |
| **用例** | 快速开始、领域任务 | 研究、定制 |
| **示例** | `finance/earnings_summary` | `light_rag` |
+`he list template --lang zh` 仍会列出 `method/*`。方法描述目前只有英文;`--no-methods` 在任意语言下都会隐藏它们。
+
---
## 另请参见
diff --git a/hyperextract/cli/commands/list.py b/hyperextract/cli/commands/list.py
index 2b8907f..2a032f7 100644
--- a/hyperextract/cli/commands/list.py
+++ b/hyperextract/cli/commands/list.py
@@ -69,7 +69,7 @@ def template(
)
templates.append((path, cfg.type, _get_description(cfg, lang)))
- if include_methods and target_lang != "zh":
+ if include_methods:
from hyperextract.methods import list_method_cfgs
method_templates = list_method_cfgs()
diff --git a/tests/cli/test_list_template.py b/tests/cli/test_list_template.py
new file mode 100644
index 0000000..36df70e
--- /dev/null
+++ b/tests/cli/test_list_template.py
@@ -0,0 +1,21 @@
+"""CLI tests for `he list template` language / method inclusion."""
+
+from typer.testing import CliRunner
+
+from hyperextract.cli.cli import app
+
+runner = CliRunner()
+
+
+def test_list_template_lang_zh_includes_methods():
+ result = runner.invoke(app, ["list", "template", "--lang", "zh"])
+ assert result.exit_code == 0, result.output
+ assert "method/" in result.output
+ assert "chunk_rag" in result.output
+
+
+def test_list_template_lang_zh_no_methods_hides_methods():
+ result = runner.invoke(app, ["list", "template", "--lang", "zh", "--no-methods"])
+ assert result.exit_code == 0, result.output
+ assert "method/" not in result.output
+ assert "chunk_rag" not in result.output