fix: smart enhancement dispatcher — Gemini/API mode + root/Docker detection
Fixes issues #289 and #286 (agent switching and Docker/root failures). enhance_command.py (new smart dispatcher): - Routes skill-seekers enhance to API mode (Gemini/OpenAI/Claude API) when an API key is available, or LOCAL mode (Claude Code CLI) otherwise - Decision priority: --target flag > config default_agent > auto-detect from env vars (ANTHROPIC_API_KEY → claude, GOOGLE_API_KEY → gemini, OPENAI_API_KEY → openai) > LOCAL fallback - Blocks LOCAL mode when running as root (Docker/VPS) with clear error message + API mode instructions - Supports --dry-run, --target, --api-key as first-class flags arguments/enhance.py: - Added --target, --api-key, --dry-run, --interactive-enhancement to ENHANCE_ARGUMENTS (shared by unified CLI parser and standalone entry point) enhance_skill_local.py: - Error output no longer truncated at 200 chars (shows up to 20 lines) - Detects root/permission errors in stderr and prints actionable hint config_manager.py: - Added default_agent field to DEFAULT_CONFIG ai_enhancement section - Added get_default_agent() and set_default_agent() methods main.py: - enhance command routed to enhance_command (was enhance_skill_local) - _handle_analyze_command uses smart dispatcher for post-analysis enhancement pyproject.toml: - skill-seekers-enhance entry point updated to enhance_command:main Tests: 1977 passed, 0 failed (28 new tests in test_enhance_command.py) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -185,7 +185,7 @@ skill-seekers-scrape = "skill_seekers.cli.doc_scraper:main"
|
||||
skill-seekers-github = "skill_seekers.cli.github_scraper:main"
|
||||
skill-seekers-pdf = "skill_seekers.cli.pdf_scraper:main"
|
||||
skill-seekers-unified = "skill_seekers.cli.unified_scraper:main"
|
||||
skill-seekers-enhance = "skill_seekers.cli.enhance_skill_local:main"
|
||||
skill-seekers-enhance = "skill_seekers.cli.enhance_command:main"
|
||||
skill-seekers-enhance-status = "skill_seekers.cli.enhance_status:main"
|
||||
skill-seekers-package = "skill_seekers.cli.package_skill:main"
|
||||
skill-seekers-upload = "skill_seekers.cli.upload_skill:main"
|
||||
|
||||
Reference in New Issue
Block a user