73 lines
2.5 KiB
Python
Raw Normal View History

2025-08-14 08:56:04 +05:30
"""
SuperClaude CLI Base Module
2025-08-14 08:56:04 +05:30
Base class for all CLI operations providing common functionality
2025-08-14 08:56:04 +05:30
"""
Fix component validation and bump version to 4.0.6 (#292) * ✨ Enhance documentation with advanced markdown formatting Major improvements to documentation presentation and usability: README.md: - Added centered hero section with framework statistics dashboard - Created visual support section with donation cards - Enhanced What's New section with feature grid layout - Reorganized documentation links into categorized table - Added professional badges and visual separators installation.md: - Centered title with platform badges and quick navigation - Consolidated 4 installation methods into unified table - Created visual requirement cards (Required vs Optional) - Added collapsible troubleshooting sections - Removed 3 duplicate "What's Next" sections - Enhanced learning journey with progression tables quick-start.md: - Added visual framework architecture flow diagram - Created component statistics dashboard (21|14|6|6) - Built comparison table for SuperClaude vs Standard Claude - Added 4-week learning timeline with milestones - Enhanced workflow patterns with step-by-step tables - Created key insights cards explaining framework philosophy All documents now feature consistent styling with centered titles, organized tables, emojis for visual scanning, and improved navigation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * 🔥 Remove outdated publishing and release instruction files Cleaned up repository by removing: - PUBLISHING.md: Outdated publishing guidelines - RELEASE_INSTRUCTIONS.md: Old release process documentation These files are no longer needed as the project has evolved and the processes have been streamlined or moved elsewhere. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * 🐛 Fix component validation to check metadata file instead of settings.json Resolves #291 - Validation errors after V4 upgrade ## Changes - Fixed validation logic to check .superclaude-metadata.json instead of settings.json - Standardized all component versions to 4.0.4 across the framework - Fixed agent validation to check for correct filenames (architect vs specialist/engineer) - Cleaned up metadata file structure for consistency ## Technical Details The issue was caused by components registering in .superclaude-metadata.json but validation checking settings.json for component registration. This mismatch caused false validation errors even though components were properly installed. ## Testing All components now validate successfully with the corrected logic. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * 🔖 Bump version to 4.0.6 across entire project ## Summary Comprehensive version update from 4.0.4 to 4.0.6 with validation fixes ## Changes - Updated VERSION file, pyproject.toml, and package.json - Updated all Python __version__ declarations (8 occurrences) - Updated all component metadata versions (6 components, 25+ occurrences) - Updated documentation and README version badges (11 files) - Fixed package.json inconsistency (was 4.0.5) - Updated legacy backup.py version reference (was 3.0.0) - Added CHANGELOG entry for version 4.0.6 ## Files Modified (26 total) - Core: VERSION, pyproject.toml, package.json - Python: SuperClaude/__init__.py, __main__.py, setup/__init__.py, cli/base.py - Components: core.py, commands.py, agents.py, mcp.py, mcp_docs.py, modes.py - Docs: README.md, CONTRIBUTING.md, SECURITY.md, installation.md, quick-start.md - Config: features.json, backup.py, update.py - User: ~/.claude/.superclaude-metadata.json ## Verification All version references now consistently show 4.0.6 Historical references in CHANGELOG preserved as intended 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * 📝 Update README.md installation instructions --------- Signed-off-by: NomenAK <39598727+NomenAK@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
2025-08-23 12:08:09 +02:00
__version__ = "4.0.6"
2025-08-14 08:56:04 +05:30
def get_command_info():
"""Get information about available commands"""
2025-08-14 08:56:04 +05:30
return {
"install": {
"name": "install",
"description": "Install SuperClaude framework components",
"module": "setup.cli.commands.install"
2025-08-14 08:56:04 +05:30
},
"update": {
"name": "update",
"description": "Update existing SuperClaude installation",
"module": "setup.cli.commands.update"
2025-08-14 08:56:04 +05:30
},
"uninstall": {
"name": "uninstall",
"description": "Remove SuperClaude framework installation",
"module": "setup.cli.commands.uninstall"
2025-08-14 08:56:04 +05:30
},
"backup": {
"name": "backup",
"description": "Backup and restore SuperClaude installations",
"module": "setup.cli.commands.backup"
2025-08-14 08:56:04 +05:30
}
}
class OperationBase:
"""Base class for all operations providing common functionality"""
def __init__(self, operation_name: str):
self.operation_name = operation_name
self.logger = None
def setup_operation_logging(self, args):
"""Setup operation-specific logging"""
from ..utils.logger import get_logger
self.logger = get_logger()
self.logger.info(f"Starting {self.operation_name} operation")
def validate_global_args(self, args):
"""Validate global arguments common to all operations"""
errors = []
# Validate install directory
if hasattr(args, 'install_dir') and args.install_dir:
from ..utils.security import SecurityValidator
is_safe, validation_errors = SecurityValidator.validate_installation_target(args.install_dir)
if not is_safe:
errors.extend(validation_errors)
# Check for conflicting flags
if hasattr(args, 'verbose') and hasattr(args, 'quiet'):
if args.verbose and args.quiet:
errors.append("Cannot specify both --verbose and --quiet")
return len(errors) == 0, errors
def handle_operation_error(self, operation: str, error: Exception):
"""Standard error handling for operations"""
if self.logger:
self.logger.exception(f"Error in {operation} operation: {error}")
else:
print(f"Error in {operation} operation: {error}")
return 1