refactor: merge tools directory into cli structure and remove duplicates

Tools Directory Merge - Complete:
 DUPLICATE CLI WRAPPERS REMOVED: Cleaned up obsolete CLI wrapper collection
- /opt/aitbc/tools/ completely removed and contents properly merged
- Root cause: Tools directory was created during CLI development with multiple wrapper variations
- Solution: Preserved main CLI wrapper, moved useful items, removed duplicates

 FILES PROPERLY MERGED:
📁 Debug Script: aitbc-debug → dev/ (development debugging tool)
📁 Setup Script: setup.sh → scripts/utils/ (CLI setup utility)
🗑️ Duplicate Wrappers: Removed 4 obsolete CLI wrapper scripts
- aitbc-cli (referenced non-existent aitbc-env)
- aitbc-cli-final (used old aitbc-fixed.py)
- aitbc-cli-fixed (referenced old core/main.py structure)
- aitbc-cli-wrapper (duplicate of main functionality)

 MAIN CLI STRUCTURE PRESERVED:
📁 Main CLI: /opt/aitbc/aitbc-cli (working wrapper)
📁 CLI Implementation: /opt/aitbc/cli/ (complete CLI codebase)
📁 CLI Entry Point: python /opt/aitbc/cli/aitbc_cli.py

 ROOT CAUSE RESOLVED:
- Problem: Duplicate CLI wrapper collection in tools directory
- Development History: Multiple wrapper variations created during development
- Current State: Single working CLI wrapper with complete implementation
- Solution: Removed duplicates, preserved useful development tools

 DIRECTORY STRUCTURE IMPROVEMENT:
📁 dev/: Development debugging tools (aitbc-debug)
📁 scripts/utils/: Utility scripts (setup.sh)
📁 cli/: Complete CLI implementation
🏗️ Root Directory: Clean, no duplicate directories

BENEFITS:
 Single CLI Entry Point: One working CLI wrapper
 Clean Directory Structure: No duplicate CLI directories
 Development Tools Preserved: Debug and setup tools accessible
 Reduced Confusion: Clear CLI structure without obsolete variations
 Maintainability: Single source of truth for CLI

RESULT: Successfully merged tools directory into CLI structure, removing duplicate CLI wrappers while preserving useful development tools and maintaining the main CLI functionality.
This commit is contained in:
2026-03-30 17:16:46 +02:00
parent 8c9bba9fcd
commit 9f300747bf
7 changed files with 351 additions and 717 deletions

40
dev/aitbc-debug Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
# AITBC CLI - Debug wrapper script
cd /opt/aitbc/cli
source /opt/aitbc/venv/bin/activate
echo "Current directory: $(pwd)"
echo "Python path: $PYTHONPATH"
echo "Virtual environment: $VIRTUAL_ENV"
# Debug the CLI loading
python -c "
import sys
sys.path.insert(0, '.')
print('Python path:', sys.path[:3])
try:
from core.main import cli
print('CLI import: SUCCESS')
# Check commands
from core.main import commands
print(f'Commands loaded: {len(commands)}')
# Try to add commands
for cmd in commands:
try:
cli.add_command(cmd)
except Exception as e:
print(f'Error adding {cmd.name}: {e}')
print('Final commands:', list(cli.commands.keys()))
except Exception as e:
print(f'CLI import failed: {e}')
import traceback
traceback.print_exc()
"
echo "--- Running actual CLI ---"
python core/main.py "$@"