2025-09-26 15:08:54 +02:00
|
|
|
"""
|
|
|
|
|
CLI framework core.
|
|
|
|
|
|
|
|
|
|
Provides the main CLI framework and command delegation.
|
|
|
|
|
"""
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
from typing import Any
|
2025-09-29 00:18:27 +02:00
|
|
|
from .commands import WorkspaceCommands, IssueCommands, ProjectCommands, ExportCommands, ConfigCommands
|
2025-09-26 15:08:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class CLIFramework:
|
|
|
|
|
"""Main CLI framework that delegates to command classes."""
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def __init__(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
self.workspace = WorkspaceCommands()
|
|
|
|
|
self.issues = IssueCommands()
|
|
|
|
|
self.project = ProjectCommands()
|
|
|
|
|
self.export = ExportCommands()
|
2025-09-29 00:18:27 +02:00
|
|
|
self.config = ConfigCommands()
|
2025-09-26 15:08:54 +02:00
|
|
|
|
|
|
|
|
# Workspace operations
|
2025-09-27 09:02:31 +02:00
|
|
|
def workspace_status(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.workspace.status()
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def start_issue(self, issue_number: int) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.workspace.start_issue(issue_number)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def finish_issue(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.workspace.finish_issue()
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def add_test_guidance(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.workspace.add_test_guidance()
|
|
|
|
|
|
|
|
|
|
# Issue operations
|
2025-09-27 09:02:31 +02:00
|
|
|
def list_issues(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.list_issues()
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def list_open_issues(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.list_open_issues()
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def show_issue(self, issue_number: int) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.show_issue(issue_number)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def create_issue(self, title: str, body: str, issue_type: str = "enhancement") -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.create_issue(title, body, issue_type)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def create_enhancement_issue(self, title: str, use_case: str, **kwargs: Any) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.create_enhancement_issue(title, use_case, **kwargs)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def create_from_template(self, template_file: str, **kwargs: Any) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.create_from_template(template_file, **kwargs)
|
|
|
|
|
|
feat: Complete CLI consolidation - fix redundancy and missing interfaces
🎯 MAJOR CLI ARCHITECTURE CONSOLIDATION:
✅ Added Missing CLI Entry Points:
• tddai = "tddai_cli:main" - TDD workflow management
• issue = "cli.issue_cli:main" - Pure issue management
• All three CLIs now properly installed: markitect, tddai, issue
🧹 Eliminated Functionality Redundancy:
• Removed issue commands from markitect/cli.py (clean separation)
• MarkiTect now focuses purely on document processing
• TDD workflow in tddai CLI, issue management in issue CLI
🏗️ Clean Architecture Implementation:
• Created cli/issue_cli.py - Dedicated pure issue management
• Enhanced cli/commands/export.py with export_issues_csv/json
• Updated cli/core.py with proper export method delegation
• Fixed pyproject.toml to include all required packages
🧪 Comprehensive Testing:
• Added tests/test_cli_consolidation.py - Prevents CLI regression
• Tests ensure all CLIs are installed and functional
• Tests verify no functionality duplication
• Regression protection against missing CLI commands
📋 Clear Separation of Concerns:
• markitect CLI - Document processing, templates, performance
• tddai CLI - TDD workflow, workspace management, coverage
• issue CLI - Pure issue operations, project management, export
🔧 Package Configuration:
• Updated pyproject.toml to include cli*, tddai*, services*, etc.
• Added py-modules for tddai_cli standalone module
• Fixed import paths and dependencies
This consolidation resolves the major redundancy identified in issues
functionality and ensures proper CLI interfaces are available and tested.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 23:04:57 +02:00
|
|
|
def close_issue(self, issue_number: int, comment: str = "") -> None:
|
|
|
|
|
return self.issues.close_issue(issue_number, comment)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def analyze_coverage(self, issue_number: int) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.issues.analyze_coverage(issue_number)
|
|
|
|
|
|
|
|
|
|
# Project management operations
|
2025-09-27 09:02:31 +02:00
|
|
|
def setup_project_management(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.setup_project_management()
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def move_issue_to_state(self, issue_number: int, state: str) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.move_issue_to_state(issue_number, state)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def set_issue_priority(self, issue_number: int, priority: str) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.set_issue_priority(issue_number, priority)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def create_milestone(self, title: str, description: str = "") -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.create_milestone(title, description)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def list_milestones(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.list_milestones()
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def assign_issue_to_milestone(self, issue_number: int, milestone_id: int) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.assign_issue_to_milestone(issue_number, milestone_id)
|
|
|
|
|
|
2025-09-27 09:02:31 +02:00
|
|
|
def project_overview(self) -> None:
|
2025-09-26 15:08:54 +02:00
|
|
|
return self.project.project_overview()
|
|
|
|
|
|
|
|
|
|
# Export operations
|
2025-09-27 09:02:31 +02:00
|
|
|
def issue_index(self, **kwargs: Any) -> None:
|
2025-09-29 00:18:27 +02:00
|
|
|
return self.export.issue_index(**kwargs)
|
|
|
|
|
|
feat: Complete CLI consolidation - fix redundancy and missing interfaces
🎯 MAJOR CLI ARCHITECTURE CONSOLIDATION:
✅ Added Missing CLI Entry Points:
• tddai = "tddai_cli:main" - TDD workflow management
• issue = "cli.issue_cli:main" - Pure issue management
• All three CLIs now properly installed: markitect, tddai, issue
🧹 Eliminated Functionality Redundancy:
• Removed issue commands from markitect/cli.py (clean separation)
• MarkiTect now focuses purely on document processing
• TDD workflow in tddai CLI, issue management in issue CLI
🏗️ Clean Architecture Implementation:
• Created cli/issue_cli.py - Dedicated pure issue management
• Enhanced cli/commands/export.py with export_issues_csv/json
• Updated cli/core.py with proper export method delegation
• Fixed pyproject.toml to include all required packages
🧪 Comprehensive Testing:
• Added tests/test_cli_consolidation.py - Prevents CLI regression
• Tests ensure all CLIs are installed and functional
• Tests verify no functionality duplication
• Regression protection against missing CLI commands
📋 Clear Separation of Concerns:
• markitect CLI - Document processing, templates, performance
• tddai CLI - TDD workflow, workspace management, coverage
• issue CLI - Pure issue operations, project management, export
🔧 Package Configuration:
• Updated pyproject.toml to include cli*, tddai*, services*, etc.
• Added py-modules for tddai_cli standalone module
• Fixed import paths and dependencies
This consolidation resolves the major redundancy identified in issues
functionality and ensures proper CLI interfaces are available and tested.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 23:04:57 +02:00
|
|
|
def export_issues_csv(self, output_file: str = None) -> None:
|
|
|
|
|
return self.export.export_issues_csv(output_file)
|
|
|
|
|
|
|
|
|
|
def export_issues_json(self, output_file: str = None) -> None:
|
|
|
|
|
return self.export.export_issues_json(output_file)
|
|
|
|
|
|
|
|
|
|
def export_issue_index(self, output_file: str = None) -> None:
|
|
|
|
|
return self.export.issue_index(format_type="tsv", output_file=output_file)
|
|
|
|
|
|
2025-09-29 00:18:27 +02:00
|
|
|
# Configuration operations
|
|
|
|
|
def show_config(self, show_sensitive: bool = False) -> None:
|
|
|
|
|
return self.config.show_config(show_sensitive)
|
|
|
|
|
|
|
|
|
|
def validate_config(self, verbose: bool = False) -> None:
|
|
|
|
|
return self.config.validate_config(verbose)
|
|
|
|
|
|
|
|
|
|
def troubleshoot_config(self) -> None:
|
|
|
|
|
return self.config.troubleshoot_config()
|
|
|
|
|
|
|
|
|
|
def check_config_files(self) -> None:
|
|
|
|
|
return self.config.check_config_files()
|