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.

fix(cli): use init's wording in the commands people run after init (#4284)

Yahya Kayaal3954b60ec1cf
diff --git a/packages/cli/src/repowise/cli/commands/coverage_cmd.py b/packages/cli/src/repowise/cli/commands/coverage_cmd.py
index 14a5a2f3c..bb08f7a7d 100644
--- a/packages/cli/src/repowise/cli/commands/coverage_cmd.py
+++ b/packages/cli/src/repowise/cli/commands/coverage_cmd.py
@@ -197,15 +197,13 @@ def coverage_add(
repo_row = await get_repository_by_path(session, str(repo_path))
if repo_row is None:
console.print(
- "[yellow]No index yet — run `repowise init` once before "
+ "[yellow]No index yet. Run `repowise init` once before "
"adding coverage.[/yellow]"
)
return False
repo_keys = await _repo_file_keys(session, repo_row.id)
if not repo_keys:
- console.print(
- "[yellow]No indexed files found — run `repowise init` first.[/yellow]"
- )
+ console.print("[yellow]No indexed files found. Run `repowise init` first.[/yellow]")
return False
# Stamp the *live* HEAD, not ``repo_row.head_commit``. The stored
@@ -269,7 +267,7 @@ def coverage_add(
console.print(
"[red]More than half the report did not map to the repo "
"tree.[/red] The stored coverage describes only a fragment "
- "of the repository — fix [cyan]coverage.strip_prefix[/cyan] "
+ "of the repository. Fix [cyan]coverage.strip_prefix[/cyan] "
"or [cyan]coverage.path_prefix[/cyan] in "
".repowise/config.yaml and re-run."
)
@@ -336,7 +334,7 @@ def coverage_add(
"not map to the repo tree.[/red] The stored numbers describe only "
"the mapped fragment, not the repository. Fix "
"[cyan]coverage.strip_prefix[/cyan] / [cyan]coverage.path_prefix[/cyan] "
- "in .repowise/config.yaml and re-run — this run exits non-zero so "
+ "in .repowise/config.yaml and re-run. This run exits non-zero so "
"scripts cannot mistake a fragment for complete coverage."
)
return False
@@ -413,7 +411,7 @@ def coverage_status(repo: str | None, fmt: str) -> None:
async with get_session(sf) as session:
repo_row = await get_repository_by_path(session, str(repo_path))
if repo_row is None:
- notices.print("[yellow]No index yet — run `repowise init`.[/yellow]")
+ notices.print("[yellow]No index yet. Run `repowise init`.[/yellow]")
if fmt == "json":
emit_json({"repo": str(repo_path), "indexed": False})
return
@@ -449,7 +447,7 @@ def coverage_status(repo: str | None, fmt: str) -> None:
partial = summary.get("mapping_partial")
partial_suffix = (
" [red](partial: stored numbers cover a fragment of the repo "
- "— fix coverage.strip_prefix and re-ingest)[/red]"
+ "; fix coverage.strip_prefix and re-ingest)[/red]"
if partial
else ""
)
diff --git a/packages/cli/src/repowise/cli/commands/dead_code_cmd.py b/packages/cli/src/repowise/cli/commands/dead_code_cmd.py
index 562e1ccc2..5701d6396 100644
--- a/packages/cli/src/repowise/cli/commands/dead_code_cmd.py
+++ b/packages/cli/src/repowise/cli/commands/dead_code_cmd.py
@@ -270,7 +270,7 @@ def dead_code_command(
assert target.repo_path is not None
repo_path = target.repo_path
- notices.print(f"[bold]repowise dead-code[/bold] — {repo_path}")
+ notices.print(f"[bold]repowise dead-code[/bold]: {repo_path}")
config: dict = {
"min_confidence": min_confidence,
@@ -329,7 +329,7 @@ def dead_code_command(
for f in findings:
safe = " (cleanup-ready)" if f.safe_to_delete else ""
name = f"`{f.symbol_name}`" if f.symbol_name else f"`{f.file_path}`"
- click.echo(f"- [{f.kind.value}] {name} — {f.reason} ({f.confidence:.0%}){safe}")
+ click.echo(f"- [{f.kind.value}] {name}: {f.reason} ({f.confidence:.0%}){safe}")
if report.hidden_below_threshold:
click.echo(
f"\n> {report.hidden_below_threshold} finding(s) hidden below threshold "
diff --git a/packages/cli/src/repowise/cli/commands/generate_cmd/command.py b/packages/cli/src/repowise/cli/commands/generate_cmd/command.py
index a6c8dfec9..00201889e 100644
--- a/packages/cli/src/repowise/cli/commands/generate_cmd/command.py
+++ b/packages/cli/src/repowise/cli/commands/generate_cmd/command.py
@@ -80,7 +80,7 @@ def _reject_structural_page_ids(page_ids: tuple[str, ...]) -> None:
if bad:
joined = ", ".join(bad)
raise click.ClickException(
- f"These pages are rendered from structure, not written by a model, so "
+ f"These pages are built from code, not written by a model, so "
f"generate has nothing to write for them: {joined}. They refresh on "
"`repowise update`. generate writes the concept and overview pages."
)
@@ -174,7 +174,7 @@ def _make_gate(dry_run: bool, embedder: str | None = None):
"--unwritten",
is_flag=True,
default=False,
- help="Write every template (unwritten) page. The default when no selection is given.",
+ help="Write every unwritten page. The default when no selection is given.",
)
@click.option("--stale", is_flag=True, default=False, help="Regenerate pages marked stale.")
@click.option(
diff --git a/packages/cli/src/repowise/cli/commands/health_cmd/codegen.py b/packages/cli/src/repowise/cli/commands/health_cmd/codegen.py
index 5c9d297f6..73104176a 100644
--- a/packages/cli/src/repowise/cli/commands/health_cmd/codegen.py
+++ b/packages/cli/src/repowise/cli/commands/health_cmd/codegen.py
@@ -92,6 +92,6 @@ def _generate_refactoring_code(repo_path, suggestions: list, selector: str, *, f
)
console.print(
f"[dim]Self-check: LCOM4 {v.get('before_lcom4')} → "
- f"max {v.get('after_max_lcom4')} across {v.get('class_count')} classes — {verdict}[/dim]"
+ f"max {v.get('after_max_lcom4')} across {v.get('class_count')} classes: {verdict}[/dim]"
)
console.print(result.content)
diff --git a/packages/cli/src/repowise/cli/commands/health_cmd/command.py b/packages/cli/src/repowise/cli/commands/health_cmd/command.py
index 1ffff0c4b..2f6357b51 100644
--- a/packages/cli/src/repowise/cli/commands/health_cmd/command.py
+++ b/packages/cli/src/repowise/cli/commands/health_cmd/command.py
@@ -244,7 +244,7 @@ def health_command(
status = err_console if fmt != "table" else console
repo_path = _resolve_repo_path(path, no_workspace, repo_alias, status)
- status.print(f"[bold]repowise health[/bold] — {repo_path}")
+ status.print(f"[bold]repowise health[/bold]: {repo_path}")
if score_paths:
_render_score_view(repo_path, score_paths, against, opts, badge_view)
return
@@ -599,7 +599,7 @@ def _render_headline(kpis: dict[str, Any], code_shape: bool, unanalysed: int) ->
f"({kpis.get('worst_performer_path') or 'n/a'})"
)
if code_shape:
- console.print("[dim]Counting code shape only — change history is left out.[/dim]")
+ console.print("[dim]Counting code shape only. Change history is left out.[/dim]")
if unanalysed:
console.print(
f"[dim]{unanalysed} file(s) not analysed: health does not support "
diff --git a/packages/cli/src/repowise/cli/commands/health_cmd/persist.py b/packages/cli/src/repowise/cli/commands/health_cmd/persist.py
index 503c1d24b..27facc8d7 100644
--- a/packages/cli/src/repowise/cli/commands/health_cmd/persist.py
+++ b/packages/cli/src/repowise/cli/commands/health_cmd/persist.py
@@ -270,7 +270,7 @@ def _persist_health(repo_path: object, *, report: object) -> None:
repo = await get_repository_by_path(session, str(repo_path))
if repo is None:
console.print(
- "[yellow]No repository row yet — run `repowise init` once "
+ "[yellow]No repository row yet. Run `repowise init` once "
"before persisting health updates.[/yellow]"
)
return
diff --git a/packages/cli/src/repowise/cli/commands/health_cmd/refactoring_targets.py b/packages/cli/src/repowise/cli/commands/health_cmd/refactoring_targets.py
index 3dd90826c..763e8a63a 100644
--- a/packages/cli/src/repowise/cli/commands/health_cmd/refactoring_targets.py
+++ b/packages/cli/src/repowise/cli/commands/health_cmd/refactoring_targets.py
@@ -322,8 +322,8 @@ def _emit(
for t in targets:
click.echo(
f"- **{t['file_path']}** ({t['effort_bucket']}, "
- f"score {t['score']:.1f}/10, -{t['total_impact']:.2f}) "
- f"— {t['primary_biomarker']}: {t['primary_reason']}"
+ f"score {t['score']:.1f}/10, -{t['total_impact']:.2f}), "
+ f"{t['primary_biomarker']}: {t['primary_reason']}"
)
_render_opportunities_md(opportunities, plan_by_id)
_render_unattached_md(unattached)
diff --git a/packages/cli/src/repowise/cli/commands/health_cmd/summary.py b/packages/cli/src/repowise/cli/commands/health_cmd/summary.py
index 1c6c566ea..e02316eeb 100644
--- a/packages/cli/src/repowise/cli/commands/health_cmd/summary.py
+++ b/packages/cli/src/repowise/cli/commands/health_cmd/summary.py
@@ -92,7 +92,7 @@ def _render_split_line(kpis: dict) -> None:
return
console.print(
f"[dim]Of that deduction, [/dim]{structure:.2f}[dim] is code shape and [/dim]"
- f"{history:.2f}[dim] is history — history answers to time, not to editing.[/dim]"
+ f"{history:.2f}[dim] is history. History answers to time, not to editing.[/dim]"
)
@@ -132,7 +132,7 @@ def _render_badge(average_health: object, share: float | None = None) -> None:
)
if not isinstance(average_health, (int, float)):
- console.print("[yellow]No health score yet — run `repowise init` first.[/yellow]")
+ console.print("[yellow]No health score yet. Run `repowise init` first.[/yellow]")
return
band = headline_band(float(average_health), share)
# Neutral, not green, when too little of the repo was analysed for a band.
diff --git a/packages/cli/src/repowise/cli/commands/update_cmd/command.py b/packages/cli/src/repowise/cli/commands/update_cmd/command.py
index 73f36dc7c..330c8396d 100644
--- a/packages/cli/src/repowise/cli/commands/update_cmd/command.py
+++ b/packages/cli/src/repowise/cli/commands/update_cmd/command.py
@@ -430,7 +430,7 @@ def update_command(
progress: str = "rich",
include_working_tree: bool = False,
) -> None:
- """Incrementally update wiki pages for files changed since last sync.
+ """Incrementally update the index and pages for files changed since the last sync.
Auto-detects workspace mode when invoked from a workspace root or when a
workspace exists upstream of the working directory. Use --no-workspace to
@@ -498,7 +498,7 @@ def _render_full_upgrade_dry_run(
recorded_pages = state.get("total_pages")
page_label = f"{recorded_pages:,}" if isinstance(recorded_pages, int) else "unknown"
- console.print("[yellow]Dry run — full upgrade plan:[/yellow]")
+ console.print("[yellow]Dry run: full upgrade plan:[/yellow]")
console.print(f" Provider: [cyan]{planned_provider}[/cyan] / [cyan]{planned_model}[/cyan]")
console.print(f" Git tier: [cyan]{current_git_tier}[/cyan] -> [cyan]FULL[/cyan]")
console.print(f" Pages currently recorded: [cyan]{page_label}[/cyan]")
@@ -1225,7 +1225,7 @@ def _config_only_update(opts: UpdateOptions, run: UpdateRun) -> UpdateOutcome:
repo_path, head, config = run.repo_path, run.head, run.config
if opts.dry_run:
action = "health would be re-scored" if config.health_changed else "state would be updated"
- console.print(f"[yellow]Dry run — {action}. No changes made.[/yellow]")
+ console.print(f"[yellow]Dry run: {action}. No changes made.[/yellow]")
return _emit_done(run, UpdateOutcome.DRY_RUN)
if config.health_changed:
cfg = load_config(repo_path)
@@ -1369,7 +1369,7 @@ def _widen_for_full_render(run: UpdateRun) -> None:
split = load_cascade_overflow_split(run.repo_path, affected.regenerate)
if split and split[0]:
console.print(
- f" {split[0]} model-written pages are marked stale: run "
+ f" {split[0]} pages written by a model are marked stale: run "
"[cyan]repowise generate --stale[/cyan] to rewrite them "
"(it estimates the cost first)."
)
@@ -2144,7 +2144,7 @@ def run_update(
return _no_changed_files(opts, run)
if run.config.health_changed:
- console.print("[yellow]Config files changed — re-running health analysis.[/yellow]")
+ console.print("[yellow]Config files changed. Re-running health analysis.[/yellow]")
if _config_change_only(run):
return _config_only_update(opts, run)
@@ -2152,7 +2152,7 @@ def run_update(
_rebuild_index(run)
_plan_pages(opts, run)
if opts.dry_run:
- console.print("[yellow]Dry run — no pages regenerated.[/yellow]")
+ console.print("[yellow]Dry run: no pages regenerated.[/yellow]")
return _emit_done(run, UpdateOutcome.DRY_RUN)
_analyze_changes(run)
_refresh_knowledge_graph_stage(run)
diff --git a/packages/cli/src/repowise/cli/commands/update_cmd/workspace.py b/packages/cli/src/repowise/cli/commands/update_cmd/workspace.py
index 755df89e3..51503d0c9 100644
--- a/packages/cli/src/repowise/cli/commands/update_cmd/workspace.py
+++ b/packages/cli/src/repowise/cli/commands/update_cmd/workspace.py
@@ -90,7 +90,7 @@ def _workspace_update(
# but guard against misuse so the error message is clear.
raise click.ClickException("_workspace_update called without a workspace target.")
- console.print(f"[bold]repowise update[/bold] \u2014 workspace: {ws_root.name}")
+ console.print(f"[bold]repowise update[/bold]: workspace {ws_root.name}")
console.print()
# Staleness reads the workspace config, and an "up to date" repo has its DB
@@ -122,9 +122,7 @@ def _workspace_update(
return
if dry_run:
- console.print(
- f"[yellow]Dry run \u2014 {scan.stale_count} repo(s) would be updated.[/yellow]"
- )
+ console.print(f"[yellow]Dry run: {scan.stale_count} repo(s) would be updated.[/yellow]")
return
# Repos that want docs take the full single-repo docs path; an all
diff --git a/tests/unit/cli/test_mode_names.py b/tests/unit/cli/test_mode_names.py
index d697eae68..2c3e13215 100644
--- a/tests/unit/cli/test_mode_names.py
+++ b/tests/unit/cli/test_mode_names.py
@@ -79,6 +79,17 @@ _SURFACES = [
"commands/init_cmd/generation.py",
"commands/init_cmd/workspace.py",
"commands/update_cmd/reporting.py",
+ # Commands people run right after init.
+ "commands/coverage_cmd.py",
+ "commands/dead_code_cmd.py",
+ "commands/generate_cmd/command.py",
+ "commands/health_cmd/codegen.py",
+ "commands/health_cmd/command.py",
+ "commands/health_cmd/persist.py",
+ "commands/health_cmd/refactoring_targets.py",
+ "commands/health_cmd/summary.py",
+ "commands/update_cmd/command.py",
+ "commands/update_cmd/workspace.py",
]
_BANNED = [