Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions codewiki/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"""
CodeWiki: Transform codebases into comprehensive documentation using AI-powered analysis.

This package provides a CLI tool for generating documentation from code repositories.
This package provides a CLI tool for generating documentation from code repositories,
and an MCP server for IDE-driven documentation generation.
"""

__version__ = "1.0.1"
__author__ = "CodeWiki Contributors"
__license__ = "MIT"

from codewiki.cli.main import cli

__all__ = ["cli", "__version__"]
__all__ = ["__version__"]

7 changes: 5 additions & 2 deletions codewiki/cli/adapters/doc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def __init__(
output_dir: Path,
config: Dict[str, Any],
verbose: bool = False,
generate_html: bool = False
generate_html: bool = False,
commit_id: str = None,
):
"""
Initialize the CLI documentation generator.
Expand All @@ -48,12 +49,14 @@ def __init__(
config: LLM configuration
verbose: Enable verbose output
generate_html: Whether to generate HTML viewer
commit_id: Git commit SHA for incremental update tracking
"""
self.repo_path = repo_path
self.output_dir = output_dir
self.config = config
self.verbose = verbose
self.generate_html = generate_html
self.commit_id = commit_id
self.progress_tracker = ProgressTracker(total_stages=5, verbose=verbose)
self.job = DocumentationJob()

Expand Down Expand Up @@ -178,7 +181,7 @@ async def _run_backend_generation(self, backend_config: BackendConfig):
self.progress_tracker.update_stage(0.2, "Initializing dependency analyzer...")

# Create documentation generator
doc_generator = DocumentationGenerator(backend_config)
doc_generator = DocumentationGenerator(backend_config, commit_id=self.commit_id)

if self.verbose:
self.progress_tracker.update_stage(0.5, "Parsing source files...")
Expand Down
6 changes: 4 additions & 2 deletions codewiki/cli/commands/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ def generate_command(
agent_instructions_dict = config.agent_instructions.to_dict()

# Create generator
# Get commit_id early so it can be stored in metadata.json for --update support
commit_id = get_git_commit_hash(repo_path)
generator = CLIDocumentationGenerator(
repo_path=repo_path,
output_dir=output_dir,
Expand All @@ -545,7 +547,8 @@ def generate_command(
'max_depth': max_depth if max_depth is not None else config.max_depth,
},
verbose=verbose,
generate_html=github_pages
generate_html=github_pages,
commit_id=commit_id,
)

# Run generation
Expand All @@ -556,7 +559,6 @@ def generate_command(

# Get repository info
repo_url = None
commit_hash = get_git_commit_hash(repo_path)
current_branch = get_git_branch(repo_path)

if is_git_repository(repo_path):
Expand Down
Loading