repowise-cli

June 10, 2026 · View on GitHub

Command-line interface for repowise — generate, maintain, search, and export AI-powered codebase documentation from your terminal.

Python >= 3.11 · Apache-2.0


Installation

pip install repowise-cli

# Recommended: use uv
uv pip install repowise-cli

repowise-core is installed automatically as a dependency. The repowise command is available immediately after installation.


Quick Start

# 1. Generate documentation for the first time
cd /path/to/your/repo
repowise init --provider anthropic

# 2. Check what was generated
repowise status

# 3. Keep docs in sync after commits
repowise update

# 4. Search the wiki
repowise search "authentication flow"

# 5. Start the web UI
repowise serve

All data is stored in a .repowise/ directory at the root of your repository.


Commands

repowise init

Generate full wiki documentation from scratch. This is the expensive, one-time operation — it traverses every file, builds the dependency graph, and calls the LLM to generate all wiki pages in dependency order. It is resumable: if interrupted, re-run with --resume.

repowise init [PATH] [OPTIONS]
OptionDefaultDescription
--provideranthropicLLM provider: anthropic, openai, ollama, litellm
--modelprovider defaultModel identifier (e.g., claude-opus-4-6, gpt-4o)
--concurrency5Max simultaneous LLM calls
--skip-testsoffSkip test files during generation
--resumeoffResume an interrupted init job from last checkpoint
--dry-runoffShow generation plan and cost estimate without calling the LLM
--no-batchoffDisable Anthropic batch API (faster wall-clock time, higher cost)
# Current directory, Anthropic (default)
repowise init

# Specific path and provider
repowise init /path/to/repo --provider openai --model gpt-4o

# Fully offline with Ollama
repowise init --provider ollama --model llama3.2

# Preview cost before spending tokens
repowise init --dry-run

# Resume after an interruption
repowise init --resume

Batch API: When using the Anthropic provider, repowise init uses the Message Batches API by default, which reduces cost by ~50%. Pass --no-batch to use streaming instead (returns results immediately, costs more).

Prompt caching: The Anthropic provider caches the shared system prompt and repository context across all generation calls. On large repos, this typically cuts cost by 60–90%.


repowise update

Incrementally regenerate wiki pages for files changed since the last sync. Uses git diff to detect what changed and propagates changes through the dependency graph — only pages that actually need updating are regenerated.

repowise update [PATH] [OPTIONS]
OptionDefaultDescription
--providerlast usedLLM provider
--modelprovider defaultModel override
--sincelast sync commitBase git ref to diff from (overrides saved state)
--cascade-budget30Max pages to regenerate per run
--dry-runoffShow affected pages without regenerating
# Update current repo (diffs HEAD against last sync commit)
repowise update

# Preview what would be regenerated
repowise update --dry-run

# Diff from a specific branch or commit
repowise update --since main
repowise update --since a1b2c3d

repowise update requires that repowise init has been run first. It reads last_sync_commit from .repowise/state.json.


repowise watch

Watch a repository for file changes and automatically run repowise update after a debounce period. Useful during active development.

repowise watch [PATH] [OPTIONS]
OptionDefaultDescription
--providerlast usedLLM provider
--modelprovider defaultModel override
--debounce2000Milliseconds to wait after the last change before updating
# Watch current directory
repowise watch

# Custom debounce (wait 5 seconds after last change)
repowise watch --debounce 5000

Press Ctrl+C to stop. Changes to .repowise/ are automatically ignored.


Search wiki pages by keyword, meaning, or symbol name.

repowise search QUERY [PATH] [OPTIONS]
OptionDefaultDescription
--modefulltextSearch mode: fulltext, semantic, symbol
--limit10Maximum results to return
# Full-text search (SQLite FTS5)
repowise search "authentication"

# Semantic / vector search
repowise search "rate limiting strategy" --mode semantic

# Find a symbol by name
repowise search "AuthService" --mode symbol

semantic search requires the [search] extra (pip install "repowise-core[search]").


repowise export

Export all wiki pages to files on disk in Markdown, HTML, or JSON format.

repowise export [PATH] [OPTIONS]
OptionDefaultDescription
--formatmarkdownOutput format: markdown, html, json
--output, -o.repowise/exportOutput directory
# Export as Markdown to .repowise/export/
repowise export

# Export as JSON to a custom directory
repowise export --format json -o ./wiki-export

# Export as HTML
repowise export --format html -o ./docs/wiki

The JSON output is a single wiki_pages.json file with all pages as an array. Markdown and HTML outputs write one file per page.


repowise status

Show sync state, page counts by type, and total token consumption.

repowise status [PATH]

Displays:

  • Last sync commit hash
  • Provider and model used for the last init/update
  • Total token consumption (input + output)
  • Page count broken down by type (file_page, module_page, symbol_spotlight, etc.)

repowise doctor

Run health checks on the wiki setup. Useful for debugging why init or update is failing.

repowise doctor [PATH]

Checks performed:

CheckWhat it verifies
Git repositoryThe path is inside a git repo
.repowise/ directoryThe init directory exists
Databasewiki.db is connectable; shows page count
state.jsonValid JSON with a last_sync_commit entry
ProvidersAt least one LLM provider is importable
Stale pagesNumber of pages whose source has changed since generation

Exits with a summary of passed/failed checks.


repowise dead-code

Detect dead and unused code using the dependency graph. Does not call an LLM — purely graph analysis and git metadata.

repowise dead-code [PATH] [OPTIONS]
OptionDefaultDescription
--min-confidence0.4Minimum confidence threshold (0.0–1.0)
--safe-onlyoffOnly show findings marked as safe to delete
--kindallFilter: unreachable_file, unused_export, unused_internal, zombie_package
--formattableOutput: table, json, md
# All findings, table format
repowise dead-code

# Only safe-to-delete findings
repowise dead-code --safe-only

# Only unreachable files (no importers in the graph)
repowise dead-code --kind unreachable_file

# Export to JSON for CI integration
repowise dead-code --format json > dead-code.json

# High-confidence findings only
repowise dead-code --min-confidence 0.8

Finding kinds:

KindDescription
unreachable_fileFile has no importers in the dependency graph
unused_exportSymbol is exported but not imported anywhere
unused_internalSymbol is defined but never called within the repo
zombie_packagePackage directory exists but has no live references

repowise serve

Start the repowise REST API and web UI server. Requires repowise-server to be installed.

repowise serve [OPTIONS]
OptionDefaultDescription
--port7337Port to listen on
--host127.0.0.1Host to bind to (0.0.0.0 to expose externally)
--workers1Number of uvicorn workers
# Start on localhost:7337
repowise serve

# Expose on all interfaces
repowise serve --host 0.0.0.0

# Custom port
repowise serve --port 8080

The API docs are available at http://localhost:7337/docs. Start the Next.js web UI separately and point REPOWISE_API_URL at this server.


repowise mcp

Start the MCP server for AI editor integration (Claude Code, Cursor, Cline).

repowise mcp [PATH] [OPTIONS]
OptionDefaultDescription
--transportstdioTransport protocol: stdio (editors), streamable-http (HTTP clients), or sse (legacy)
--port7338Port for HTTP/SSE transports
# stdio transport, current directory (typical editor integration)
repowise mcp

# Specific repository path
repowise mcp /path/to/repo

# Streamable HTTP transport for HTTP clients
repowise mcp --transport streamable-http

# Legacy SSE transport
repowise mcp --transport sse

Exposes 16 MCP tools for querying wiki pages, symbols, the dependency graph, git analytics, ownership data, hotspots, dead code findings, and decision intelligence.

Claude Code setup — add to ~/.claude/settings.json:

{
  "mcpServers": {
    "repowise": {
      "command": "repowise",
      "args": ["mcp", "/path/to/your/repo"]
    }
  }
}

Cursor / Cline setup — add to your MCP configuration file:

{
  "mcpServers": {
    "repowise": {
      "command": "repowise",
      "args": ["mcp", "/absolute/path/to/repo"]
    }
  }
}

Environment Variables

VariableDescription
ANTHROPIC_API_KEYAPI key for the Anthropic provider
OPENAI_API_KEYAPI key for the OpenAI provider
REPOWISE_DB_URLOverride the default SQLite path (e.g., postgresql://user:pass@host/db)
REPOWISE_EMBEDDEREmbedder backend: mock (default) or gemini

The .repowise/ Directory

After repowise init, your repo will contain:

.repowise/
├── wiki.db         # SQLite database — all pages, symbols, jobs, git metadata
├── lancedb/        # LanceDB vector store (if [search] extra is installed)
├── graph.json      # Serialized dependency graph (repos < 30K nodes)
├── state.json      # Sync state: last_sync_commit, provider, model, token counts
└── export/         # Output directory for `repowise export`

Add .repowise/ to your .gitignore to avoid committing generated data.


Development

# Install for development (from repo root)
uv pip install -e packages/cli -e packages/core

# Run tests
pytest tests/unit/cli/