Implement dynamic version loading system

- Convert all hardcoded versions to dynamic loading from VERSION file
- Reduce version update locations from 50+ to just 3 files
- Add proper fallback handling for version reading
- Update all CLI commands to use dynamic __version__
- Streamline future version management process

This change makes version bumping much simpler - only need to update:
1. VERSION file
2. package.json
3. pyproject.toml
This commit is contained in:
NomenAK
2025-08-23 14:10:11 +02:00
parent 4831319a10
commit 9abaa10366
15 changed files with 57 additions and 30 deletions

View File

@@ -98,7 +98,8 @@ Examples:
parents=[global_parser]
)
parser.add_argument("--version", action="version", version="SuperClaude 4.0.7")
from SuperClaude import __version__
parser.add_argument("--version", action="version", version=f"SuperClaude {__version__}")
subparsers = parser.add_subparsers(
dest="operation",
@@ -208,8 +209,9 @@ def main() -> int:
try:
from setup.utils.updater import check_for_updates
# Check for updates in the background
from SuperClaude import __version__
updated = check_for_updates(
current_version="4.0.7",
current_version=__version__,
auto_update=getattr(args, 'auto_update', False)
)
# If updated, suggest restart
@@ -226,7 +228,8 @@ def main() -> int:
# No operation provided? Show help manually unless in quiet mode
if not args.operation:
if not args.quiet:
display_header("SuperClaude Framework v4.0.7", "Unified CLI for all operations")
from SuperClaude import __version__
display_header(f"SuperClaude Framework v{__version__}", "Unified CLI for all operations")
print(f"{Colors.CYAN}Available operations:{Colors.RESET}")
for op, desc in get_operation_modules().items():
print(f" {op:<12} {desc}")