Skip to content

[Feature] Extend quiet-by-default logging plus -v to the remaining CLI commands #930

Description

@RaghavChamadiya

Problem

#929 made repowise init and repowise update quiet by default. Before that, update printed provider and pipeline debug lines (ollama.generate.done, ingestion graph/traverser events) straight into the live Rich progress bar, which is what produced the duplicated "Generating pages..." rows in #922.

That PR deliberately scoped itself to those two commands. Every other command still runs with whatever logging configuration it happens to inherit, so any command that touches the core pipeline or an LLM/embedding provider can spray debug output over its own progress display. Only init and update define a -v flag today:

packages/cli/src/repowise/cli/commands/init_cmd/command.py:499
packages/cli/src/repowise/cli/commands/update_cmd/command.py:260

Proposed Solution

Give the remaining long-running commands the same treatment: a --verbose / -v flag wired to the helper #929 already added.

The helper lives in packages/cli/src/repowise/cli/_setup.py:

configure_cli_logging(verbose: bool = False) -> None
  • Default: httpx, httpcore, repowise.core and repowise.server pinned to ERROR, so progress bars are the only output.
  • verbose=True: repowise's own loggers pass through at DEBUG so a user can watch provider/pipeline activity. httpx/httpcore stay at ERROR either way, since their debug stream is HTTP-level noise that buries the useful lines.

setup_logging_silence() is a thin wrapper over the quiet path, for call sites that never want logs (the multi-repo workspace init flow).

Per command:

  1. Add the flag, matching the existing wording:
    @click.option(
        "--verbose",
        "-v",
        is_flag=True,
        default=False,
        help="Show debug logs from the pipeline.",
    )
  2. from repowise.cli._setup import configure_cli_logging
  3. Call configure_cli_logging(verbose=verbose) as the first statement in the command body, before any pipeline import or work. Reference call site: update_cmd/command.py:387.

Candidates, roughly in priority order. Each renders progress or calls a provider:

Command File Why it matters
reindex commands/reindex_cmd.py Rich Progress at line 118, embedding calls per batch
restyle commands/restyle_cmd.py Regenerates pages through the LLM provider, --concurrency 12
export commands/export_cmd.py Rich Progress at line 155
claude-md commands/claude_md_cmd.py Generation path, plus a workspace variant
watch commands/watch_cmd.py Long-lived, repeatedly triggers update runs
workspace add / workspace scan commands/workspace_cmd.py Indexing and doc generation per repo (_run_index_for_repo, _generate_docs_for_added_repo)
health commands/health_cmd/ codegen.py calls a provider
coverage add commands/coverage_cmd.py Ingests and parses reports
augment commands/augment_cmd/

This is splittable. One PR per command, or a small batch, is easier to review than one sweep. Picking a single command off this list is a reasonable first contribution.

Alternatives Considered

  • A global -v on the root group instead of per-command. Cleaner in principle, but Click would need the flag before the subcommand (repowise -v update), which breaks the existing repowise update -v spelling and every doc that uses it.
  • Always-quiet everywhere, no flag. Rejected: users debugging a stuck provider call need a way to see the pipeline. That was the specific gap feat(cli): make init/update quiet by default, show debug logs under --verbose #929 closed for init.
  • Leaving the read-only commands alone. Still the plan. status, search, costs, risk, saved, expand, and distill print and exit fast, and probably do not need this. Use judgement, and say so in the PR if you skip one from the table.

Additional Context

  • configure_cli_logging sets cache_logger_on_first_use=False on purpose. Modules that call structlog.get_logger(__name__) at import time hold a bound logger snapshotted before configure runs, so without that, debug lines from core/ingestion/* leak past the filter on the first run of a session. This is also why the call has to come before the work, not partway through it.
  • Helper tests live in tests/unit/cli/test_shared_helpers.py (test_configure_cli_logging_quiet_by_default, test_configure_cli_logging_verbose_shows_repowise_debug). A per-command test asserting the flag reaches configure_cli_logging is enough; no need to re-test the helper.
  • Where a command already has a -v meaning something else, or where its output is deliberately terse, either reuse the flag or leave it always-quiet via setup_logging_silence() and note why.
  • The "why it matters" column comes from grepping for Progress( and provider usage, not from running each command, so it is a pointer rather than a confirmed reproduction for every entry.
  • Related: [Bug] repowise update wiki pages generation CLI rendering strangeness #922, fix(update): count onboarding pages in the generation progress total #928, feat(cli): make init/update quiet by default, show debug logs under --verbose #929

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions