diff --git a/src/plyngent/cli/slash.py b/src/plyngent/cli/slash.py index 54aad4c..f67bd05 100644 --- a/src/plyngent/cli/slash.py +++ b/src/plyngent/cli/slash.py @@ -405,10 +405,13 @@ def model_cmd(state: ReplState, model_id: str | None) -> None: @slash.command("tools") -@click.argument("enabled", required=False, type=ON_OFF) +@click.argument("enabled", required=False, type=ON_OFF, metavar="[on|off]") @click.pass_obj def tools_cmd(state: ReplState, enabled: bool | None) -> None: # noqa: FBT001 - """Show or toggle tools.""" + """Show or set whether agent tools are enabled. + + Omit the argument to print the current value; pass ``on`` or ``off`` to change it. + """ if enabled is None: click.echo(f"tools={'on' if state.tools_enabled else 'off'}") return @@ -418,10 +421,15 @@ def tools_cmd(state: ReplState, enabled: bool | None) -> None: # noqa: FBT001 @slash.command("stream") -@click.argument("enabled", required=False, type=ON_OFF) +@click.argument("enabled", required=False, type=ON_OFF, metavar="[on|off]") @click.pass_obj def stream_cmd(state: ReplState, enabled: bool | None) -> None: # noqa: FBT001 - """Show or toggle streaming model output.""" + """Show or set streaming model output. + + ``on`` (default): print assistant text and reasoning as tokens arrive. + ``off``: wait for each full model response before printing. + Omit the argument to print the current value. + """ if enabled is None: click.echo(f"stream={'on' if state.agent.stream else 'off'}") return @@ -431,10 +439,15 @@ def stream_cmd(state: ReplState, enabled: bool | None) -> None: # noqa: FBT001 @slash.command("verbose") -@click.argument("enabled", required=False, type=ON_OFF) +@click.argument("enabled", required=False, type=ON_OFF, metavar="[on|off]") @click.pass_obj def verbose_cmd(state: ReplState, enabled: bool | None) -> None: # noqa: FBT001 - """Show or toggle full tool-result dumps.""" + """Show or set full tool-result dumps in the terminal. + + ``off`` (default): short one-line tool result preview. + ``on``: print the full tool result text. + Omit the argument to print the current value. + """ if enabled is None: click.echo(f"verbose={'on' if state.verbose else 'off'}") return diff --git a/tests/test_cli/test_repl_commands.py b/tests/test_cli/test_repl_commands.py index b4ae440..95dcee1 100644 --- a/tests/test_cli/test_repl_commands.py +++ b/tests/test_cli/test_repl_commands.py @@ -114,6 +114,15 @@ async def test_help_history_no_fake_options(state: ReplState, capsys: pytest.Cap assert "--help" not in out +async def test_help_stream_clearer(state: ReplState, capsys: pytest.CaptureFixture[str]) -> None: + assert await handle_slash(state, "/help stream") is True + out = capsys.readouterr().out + assert "Usage: /stream [on|off]" in out + assert "ENABLED" not in out + assert "tokens arrive" in out + assert "default" in out + + async def test_history_rejects_help_flag(state: ReplState, capsys: pytest.CaptureFixture[str]) -> None: assert await handle_slash(state, "/history --help") is True captured = capsys.readouterr()