diff --git a/src/skill_seekers/cli/arguments/create.py b/src/skill_seekers/cli/arguments/create.py index 3fb3b38..1b20329 100644 --- a/src/skill_seekers/cli/arguments/create.py +++ b/src/skill_seekers/cli/arguments/create.py @@ -145,6 +145,14 @@ UNIVERSAL_ARGUMENTS: dict[str, dict[str, Any]] = { "help": "Preview workflow stages without executing (requires --enhance-workflow)", }, }, + "local_repo_path": { + "flags": ("--local-repo-path",), + "kwargs": { + "type": str, + "help": "Path to local clone of a GitHub repository for unlimited C3.x analysis (bypasses GitHub API file limits)", + "metavar": "PATH", + }, + }, } # Merge RAG arguments from common.py into universal arguments diff --git a/src/skill_seekers/cli/arguments/github.py b/src/skill_seekers/cli/arguments/github.py index dfaec87..f0e1b0f 100644 --- a/src/skill_seekers/cli/arguments/github.py +++ b/src/skill_seekers/cli/arguments/github.py @@ -163,6 +163,14 @@ GITHUB_ARGUMENTS: dict[str, dict[str, Any]] = { "metavar": "NAME", }, }, + "local_repo_path": { + "flags": ("--local-repo-path",), + "kwargs": { + "type": str, + "help": "Path to local clone of the repository for unlimited C3.x analysis (bypasses GitHub API file limits)", + "metavar": "PATH", + }, + }, } diff --git a/src/skill_seekers/cli/create_command.py b/src/skill_seekers/cli/create_command.py index 6f62687..ca4ab00 100644 --- a/src/skill_seekers/cli/create_command.py +++ b/src/skill_seekers/cli/create_command.py @@ -209,6 +209,8 @@ class CreateCommand: argv.extend(["--max-issues", str(self.args.max_issues)]) if getattr(self.args, "scrape_only", False): argv.append("--scrape-only") + if getattr(self.args, "local_repo_path", None): + argv.extend(["--local-repo-path", self.args.local_repo_path]) # Call github_scraper with modified argv logger.debug(f"Calling github_scraper with argv: {argv}") diff --git a/src/skill_seekers/cli/github_scraper.py b/src/skill_seekers/cli/github_scraper.py index baf2c8f..cc554e3 100644 --- a/src/skill_seekers/cli/github_scraper.py +++ b/src/skill_seekers/cli/github_scraper.py @@ -212,7 +212,14 @@ class GitHubScraper: self.local_repo_path = local_repo_path or config.get("local_repo_path") if self.local_repo_path: self.local_repo_path = os.path.expanduser(self.local_repo_path) - logger.info(f"Local repository mode enabled: {self.local_repo_path}") + if not os.path.isdir(self.local_repo_path): + logger.warning( + f"local_repo_path does not exist or is not a directory: {self.local_repo_path}" + ) + logger.warning("Falling back to GitHub API mode (local_repo_path ignored)") + self.local_repo_path = None + else: + logger.info(f"Local repository mode enabled: {self.local_repo_path}") # Configure directory exclusions (smart defaults + optional customization) self.excluded_dirs = set(EXCLUDED_DIRS) # Start with smart defaults @@ -1405,6 +1412,7 @@ def main(): "max_issues": args.max_issues, "interactive": not args.non_interactive, "github_profile": args.profile, + "local_repo_path": getattr(args, "local_repo_path", None), } else: parser.error("Either --repo or --config is required") diff --git a/tests/test_create_arguments.py b/tests/test_create_arguments.py index a475c61..3553953 100644 --- a/tests/test_create_arguments.py +++ b/tests/test_create_arguments.py @@ -24,8 +24,8 @@ class TestUniversalArguments: """Test universal argument definitions.""" def test_universal_count(self): - """Should have exactly 17 universal arguments (after Phase 2 workflow integration).""" - assert len(UNIVERSAL_ARGUMENTS) == 17 + """Should have exactly 18 universal arguments (after Phase 2 workflow integration + local_repo_path).""" + assert len(UNIVERSAL_ARGUMENTS) == 18 def test_universal_argument_names(self): """Universal arguments should have expected names.""" @@ -48,6 +48,7 @@ class TestUniversalArguments: "enhance_stage", "var", "workflow_dry_run", + "local_repo_path", # GitHub local clone path for unlimited C3.x analysis } assert set(UNIVERSAL_ARGUMENTS.keys()) == expected_names @@ -128,7 +129,7 @@ class TestArgumentHelpers: """Should return set of universal argument names.""" names = get_universal_argument_names() assert isinstance(names, set) - assert len(names) == 17 # Phase 2: added 4 workflow arguments + assert len(names) == 18 # Phase 2: added 4 workflow arguments + local_repo_path assert "name" in names assert "enhance_level" in names # Phase 1: consolidated flag assert "enhance_workflow" in names # Phase 2: workflow support