Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

feat(cli): add --verbose/-v to restyle (#936)

Loi Nguyen34e58e3ea9eb
diff --git a/docs/CLI_REFERENCE.md b/docs/CLI_REFERENCE.md
index 2e0ce847f..119838954 100644
--- a/docs/CLI_REFERENCE.md
+++ b/docs/CLI_REFERENCE.md
@@ -210,12 +210,14 @@ working. See [WIKI_STYLES.md](WIKI_STYLES.md).
| `--model` | Override model |
| `--concurrency` | Max concurrent LLM calls (default: 12) |
| `--reasoning` | Reasoning mode for supported providers |
+| `--verbose` / `-v` | Show debug logs from the pipeline |
| `--yes` / `-y` | Skip the confirmation prompt |
```bash
repowise restyle # show current style + options
repowise restyle caveman # condensed, AI-first
repowise restyle reference --yes # API-manual, skip the confirm
+repowise restyle tutorial --verbose # show pipeline debug logs
```
> Editing `wiki_style` in `config.yaml` by hand and running `update` does **not**
diff --git a/packages/cli/src/repowise/cli/commands/restyle_cmd.py b/packages/cli/src/repowise/cli/commands/restyle_cmd.py
index 7b3037b1f..200abbde6 100644
--- a/packages/cli/src/repowise/cli/commands/restyle_cmd.py
+++ b/packages/cli/src/repowise/cli/commands/restyle_cmd.py
@@ -18,6 +18,7 @@ from typing import Any
import click
+from repowise.cli._setup import configure_cli_logging
from repowise.cli.helpers import (
config_fingerprint,
console,
@@ -145,6 +146,13 @@ async def _run_restyle(
@click.option("--model", default=None, help="Model identifier override.")
@click.option("--concurrency", type=int, default=12, help="Max concurrent LLM calls.")
@click.option("--reasoning", default=None, help="Reasoning mode override.")
+ "--verbose",
+ "-v",
+ is_flag=True,
+ default=False,
+ help="Show debug logs from the pipeline.",
+)
@click.option("--yes", "-y", is_flag=True, default=False, help="Skip the confirmation prompt.")
def restyle_command(
style: str | None,
@@ -153,6 +161,7 @@ def restyle_command(
model: str | None,
concurrency: int,
reasoning: str | None,
+ verbose: bool,
yes: bool,
) -> None:
"""Switch a repo's wiki STYLE and regenerate every page in the new voice.
@@ -163,6 +172,8 @@ def restyle_command(
This regenerates the whole wiki with LLM calls (a cost), reusing the existing
index/graph/git so no re-resolution or re-blame is needed.
"""
+ configure_cli_logging(verbose=verbose)
+
repo_path = resolve_repo_path(path)
load_dotenv(repo_path)
state = load_state(repo_path)
diff --git a/tests/unit/cli/test_restyle_cmd.py b/tests/unit/cli/test_restyle_cmd.py
index 3c9b688bd..31bee48d2 100644
--- a/tests/unit/cli/test_restyle_cmd.py
+++ b/tests/unit/cli/test_restyle_cmd.py
@@ -13,6 +13,7 @@ from pathlib import Path
from click.testing import CliRunner
+from repowise.cli.commands import restyle_cmd
from repowise.cli.main import cli
@@ -58,6 +59,24 @@ def test_restyle_no_style_shows_current_and_options():
assert "caveman" in result.output # catalogue shown
+def test_restyle_verbose_configures_cli_logging(monkeypatch, tmp_path):
+ calls: list[bool] = []
+ monkeypatch.setattr(
+ restyle_cmd,
+ "configure_cli_logging",
+ lambda *, verbose=False: calls.append(verbose),
+ )
+
+ result = CliRunner().invoke(
+ cli,
+ ["restyle", "caveman", str(tmp_path), "--yes", "--verbose"],
+ )
+
+ assert result.exit_code == 1
+ assert "No index found" in result.output
+ assert calls == [True]
+
+
def test_restyle_unknown_style_errors(tmp_path):
result = CliRunner().invoke(cli, ["restyle", "bogus", str(tmp_path)])
# A mistyped STYLE is a usage error (Click convention: exit code 2), not a