Skip to content

armgit / Soup

Public Imported from GitHub
0

Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.

fix: add missing CLI help text (#1795)

Aykut Güneyd0fadc45853f
diff --git a/changelog.d/0.76.0/1795.fixed.md b/changelog.d/0.76.0/1795.fixed.md
new file mode 100644
index 00000000..93caab40
--- /dev/null
+++ b/changelog.d/0.76.0/1795.fixed.md
@@ -0,0 +1 @@
+- CLI help now includes descriptions for the remaining plugin, data, registry, `.can`, and agent command entries, with a regression test preventing new blank help text (#1793 by @KeuqS in #1795).
diff --git a/src/soup_cli/commands/agent.py b/src/soup_cli/commands/agent.py
index 1274b999..03bdc02c 100644
--- a/src/soup_cli/commands/agent.py
+++ b/src/soup_cli/commands/agent.py
@@ -123,6 +123,7 @@ def train(
),
examples_per_endpoint: int = typer.Option(
4, "--examples-per-endpoint", "-n", min=1, max=32,
+ help="Number of synthetic examples to create per API endpoint.",
),
):
"""One-shot wrapper: synth + planned soup train invocation (printed)."""
diff --git a/src/soup_cli/commands/can.py b/src/soup_cli/commands/can.py
index d24e07e2..8171bb75 100644
--- a/src/soup_cli/commands/can.py
+++ b/src/soup_cli/commands/can.py
@@ -216,7 +216,9 @@ def publish_cmd(
..., "--hf-hub",
help="HF Hub dataset repo (e.g. 'me/my-recipe-can')",
),
- private: bool = typer.Option(False, "--private"),
+ private: bool = typer.Option(
+ False, "--private", help="Create a private HF Hub dataset repository."
+ ),
commit_message: Optional[str] = typer.Option(
None, "--message", "-m",
help="Commit message (first line only, capped at 200 chars)",
@@ -246,7 +248,9 @@ def fork_cmd(
modify: list[str] = typer.Option(
[], "--modify", help="Modification like 'training.lr=5e-5' (repeatable)",
),
- author: str = typer.Option("unknown", "--author"),
+ author: str = typer.Option(
+ "unknown", "--author", help="Author name recorded in the forked manifest."
+ ),
) -> None:
"""Fork a can with config modifications and re-pack."""
from soup_cli.cans.pack import fork_can
diff --git a/src/soup_cli/commands/data_score.py b/src/soup_cli/commands/data_score.py
index c9a99976..4a98c19a 100644
--- a/src/soup_cli/commands/data_score.py
+++ b/src/soup_cli/commands/data_score.py
@@ -137,7 +137,9 @@ def score(
def decontaminate(
- input: str = typer.Option(..., "--input", "-i"),
+ input: str = typer.Option(
+ ..., "--input", "-i", help="Input JSONL file to decontaminate."
+ ),
benchmarks: Optional[str] = typer.Option(
None, "--benchmarks", "-b",
help="Comma-separated benchmark names (label only; corpora not bundled).",
@@ -154,8 +156,14 @@ def decontaminate(
"clean.jsonl", "--output", "-o",
help="Output JSONL of rows that survived decontamination.",
),
- threshold: float = typer.Option(0.8, "--threshold", min=0.0, max=1.0),
- n: int = typer.Option(8, "--n", min=1, max=32),
+ threshold: float = typer.Option(
+ 0.8, "--threshold", min=0.0, max=1.0,
+ help="Minimum n-gram overlap ratio for removing a row.",
+ ),
+ n: int = typer.Option(
+ 8, "--n", min=1, max=32,
+ help="N-gram size used for overlap detection.",
+ ),
):
"""Drop rows that overlap public benchmarks (n-gram heuristic).
@@ -227,8 +235,13 @@ def decontaminate(
def toxicity(
- input: str = typer.Option(..., "--input", "-i"),
- output: str = typer.Option("toxicity.jsonl", "--output", "-o"),
+ input: str = typer.Option(
+ ..., "--input", "-i", help="Input JSONL file to score."
+ ),
+ output: str = typer.Option(
+ "toxicity.jsonl", "--output", "-o",
+ help="Output JSONL file for rows meeting the threshold.",
+ ),
threshold: float = typer.Option(
0.05, "--threshold", min=0.0, max=1.0,
help="Rows meeting the abuse-keyword threshold are kept.",
@@ -260,8 +273,13 @@ def toxicity(
def langdetect(
- input: str = typer.Option(..., "--input", "-i"),
- output: str = typer.Option("langdetect.jsonl", "--output", "-o"),
+ input: str = typer.Option(
+ ..., "--input", "-i", help="Input JSONL file to tag."
+ ),
+ output: str = typer.Option(
+ "langdetect.jsonl", "--output", "-o",
+ help="Output JSONL file with language tags.",
+ ),
):
"""Tag each row with a 2-letter language code (heuristic)."""
from soup_cli.utils.data_score import detect_language, extract_row_text
@@ -286,8 +304,13 @@ def langdetect(
def pii(
- input: str = typer.Option(..., "--input", "-i"),
- output: str = typer.Option("pii.jsonl", "--output", "-o"),
+ input: str = typer.Option(
+ ..., "--input", "-i", help="Input JSONL file to scan."
+ ),
+ output: str = typer.Option(
+ "pii.jsonl", "--output", "-o",
+ help="Output JSONL file containing rows with detected PII.",
+ ),
):
"""Flag rows containing email / phone / SSN / credit-card patterns."""
from soup_cli.utils.data_score import detect_pii, extract_row_text
@@ -314,8 +337,13 @@ def pii(
def educational(
- input: str = typer.Option(..., "--input", "-i"),
- output: str = typer.Option("educational.jsonl", "--output", "-o"),
+ input: str = typer.Option(
+ ..., "--input", "-i", help="Input JSONL file to score."
+ ),
+ output: str = typer.Option(
+ "educational.jsonl", "--output", "-o",
+ help="Output JSONL file with educational-value scores.",
+ ),
):
"""Tag each row with an educational-value score [0, 1]."""
from soup_cli.utils.data_score import extract_row_text, score_educational_value
diff --git a/src/soup_cli/commands/plugins.py b/src/soup_cli/commands/plugins.py
index 19be0539..e668c7ef 100644
--- a/src/soup_cli/commands/plugins.py
+++ b/src/soup_cli/commands/plugins.py
@@ -46,6 +46,7 @@ def install_cmd(name: str = typer.Argument(..., help="Plugin name")) -> None:
@app.command("enable")
def enable_cmd(name: str = typer.Argument(..., help="Plugin name")) -> None:
+ """Enable a registered Soup plugin."""
safe = escape(name)
try:
plugins_pkg.load_plugins()
@@ -62,6 +63,7 @@ def enable_cmd(name: str = typer.Argument(..., help="Plugin name")) -> None:
@app.command("disable")
def disable_cmd(name: str = typer.Argument(..., help="Plugin name")) -> None:
+ """Disable a registered Soup plugin."""
safe = escape(name)
try:
plugins_pkg.load_plugins()
diff --git a/src/soup_cli/commands/registry.py b/src/soup_cli/commands/registry.py
index 759cdc1f..d16819ad 100644
--- a/src/soup_cli/commands/registry.py
+++ b/src/soup_cli/commands/registry.py
@@ -81,11 +81,21 @@ def push_cmd(
@app.command("list")
def list_cmd(
- name: Optional[str] = typer.Option(None, "--name", "-n"),
- tag: Optional[str] = typer.Option(None, "--tag", "-t"),
- base: Optional[str] = typer.Option(None, "--base", "-b"),
- task: Optional[str] = typer.Option(None, "--task"),
- limit: int = typer.Option(100, "--limit", "-l"),
+ name: Optional[str] = typer.Option(
+ None, "--name", "-n", help="Filter by registry entry name."
+ ),
+ tag: Optional[str] = typer.Option(
+ None, "--tag", "-t", help="Filter by tag."
+ ),
+ base: Optional[str] = typer.Option(
+ None, "--base", "-b", help="Filter by base model."
+ ),
+ task: Optional[str] = typer.Option(
+ None, "--task", help="Filter by training task."
+ ),
+ limit: int = typer.Option(
+ 100, "--limit", "-l", help="Maximum number of entries to show."
+ ),
) -> None:
"""List registry entries."""
with RegistryStore() as store:
@@ -182,7 +192,9 @@ def show_cmd(
@app.command("search")
def search_cmd(
query: str = typer.Argument(..., help="Keyword to search for"),
- limit: int = typer.Option(50, "--limit", "-l"),
+ limit: int = typer.Option(
+ 50, "--limit", "-l", help="Maximum number of matching entries to show."
+ ),
) -> None:
"""Search registry entries by name/base/task/notes."""
with RegistryStore() as store:
diff --git a/tests/test_cli_help_completeness.py b/tests/test_cli_help_completeness.py
new file mode 100644
index 00000000..2ac1bb86
--- /dev/null
+++ b/tests/test_cli_help_completeness.py
@@ -0,0 +1,58 @@
+"""Keep visible CLI commands and parameters discoverable in ``--help``."""
+
+import inspect
+from collections.abc import Iterator
+
+import click
+import typer
+
+from soup_cli.cli import app
+
+
+def _visible_commands(
+ command: click.Command, path: tuple[str, ...] = ()
+) -> Iterator[tuple[tuple[str, ...], click.Command]]:
+ """Yield visible commands in the complete Typer command tree."""
+ if getattr(command, "hidden", False):
+ return
+ yield path, command
+ if isinstance(command, click.Group):
+ for name, child in command.commands.items():
+ yield from _visible_commands(child, path + (name,))
+
+
+def _parameter_help(command: click.Command, parameter: click.Parameter) -> str | None:
+ """Return help from Click or the Typer declaration behind an argument."""
+ if parameter.help:
+ return parameter.help
+ if not isinstance(parameter, click.Argument) or command.callback is None:
+ return parameter.help
+
+ callback_parameter = inspect.signature(command.callback).parameters.get(
+ parameter.name
+ )
+ if callback_parameter is None:
+ return parameter.help
+
+ argument_info = callback_parameter.default
+ if isinstance(argument_info, typer.models.ArgumentInfo):
+ return argument_info.help
+ return parameter.help
+
+
+def test_visible_commands_and_parameters_have_help() -> None:
+ """Every visible CLI entry should explain itself in generated help."""
+ root = typer.main.get_command(app)
+ missing: list[str] = []
+
+ for path, command in _visible_commands(root):
+ label = " ".join(path) or "soup"
+ if path and not command.help:
+ missing.append(f"command {label!r}")
+ for parameter in command.params:
+ if getattr(parameter, "hidden", False):
+ continue
+ if not _parameter_help(command, parameter):
+ missing.append(f"parameter {label!r}: {parameter.name!r}")
+
+ assert not missing, "Missing CLI help:\n" + "\n".join(missing)