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.

docs(init): document --resume and expand its help text (#113) (#2030)

Nehal kanak kuniyil thottathil9a3bbcf11737
diff --git a/README.md b/README.md
index be1fc6c2d..81c4a1393 100644
--- a/README.md
+++ b/README.md
@@ -604,6 +604,21 @@ already rendered from structure at index time.
Or pick the provider for the first index directly with `repowise init --provider
gemini|anthropic|openai`.
+**Resuming an interrupted index.** If `init` is interrupted (timeout, crash,
+Ctrl+C), re-run it with `--resume` and it continues from where it stopped —
+pages already written to the vector store are skipped, and only the missing
+ones are generated:
+
+```bash
+repowise init . --resume
+```
+
+`--resume` is a safe no-op on a fully indexed repo, so it is the right thing to
+reach for whenever a long run is cut short. It works because pages are written
+to LanceDB incrementally, while the SQL `generation_jobs` row only finalizes at
+the end — a hard interrupt can leave LanceDB ahead of SQL, and `--resume` is
+the supported recovery path (`repowise doctor` flags the drift).
+
**3. Connect your agent.** Step 2 already did this for Claude Code: `init`
writes a repo-root `.mcp.json` unconditionally and, unless you passed
`--no-editor-setup`, also registers repowise with `~/.claude/settings.json`.
diff --git a/packages/cli/src/repowise/cli/commands/init_cmd/command.py b/packages/cli/src/repowise/cli/commands/init_cmd/command.py
index 55b853d81..49b8fd5d8 100644
--- a/packages/cli/src/repowise/cli/commands/init_cmd/command.py
+++ b/packages/cli/src/repowise/cli/commands/init_cmd/command.py
@@ -440,7 +440,15 @@ def _run_generation_phase(
"--dry-run", is_flag=True, default=False, help="Show generation plan without running."
)
@click.option("--yes", "-y", is_flag=True, default=False, help="Skip cost confirmation prompt.")
[email protected]("--resume", is_flag=True, default=False, help="Resume from last checkpoint.")
+ "--resume",
+ is_flag=True,
+ default=False,
+ help=(
+ "Skip pages already generated in the vector store and continue from "
+ "where a previous run stopped. Safe no-op on a fully indexed repo."
+ ),
+)
@click.option(
"--force", is_flag=True, default=False, help="Regenerate all pages, ignoring existing."
)