Add Epic Progress Bars & Smart Auto-completion! - 6 progress bar styles with animations - Smart fuzzy command completion - Interactive demos and feature showcase - Enhanced shell with suggestion system - Progress tracking for code execution - Multiple spinner animations - Package installation simulation

This commit is contained in:
2025-09-23 23:13:08 +02:00
parent 837cf48b8e
commit 862ff07cc9
6 changed files with 1049 additions and 7 deletions

View File

@@ -30,6 +30,7 @@ from commands.cmd_stubs import (
ExitCommand, WdirCommand, FormatCommand, DebugCommand,
PackageCommand, AsciiCommand, StatsCommand, BenchmarkCommand, EncryptCommand
)
from commands.cmd_demo import DemoCommand, SuggestCommand
# Try Discord RPC (optional)
try:
@@ -38,6 +39,15 @@ try:
except ImportError:
RPC_AVAILABLE = False
# Import auto-completion and progress bars
try:
from utils.autocomplete import AutoComplete, setup_autocomplete
from utils.progress import SpinnerProgress, simulate_progress
UTILS_AVAILABLE = True
except ImportError:
UTILS_AVAILABLE = False
print("Utils not available - some features disabled")
CLIENT_ID = '1414669512158220409'
class Theme:
@@ -138,6 +148,12 @@ class OverCodeShell(cmd.Cmd):
if RPC_AVAILABLE:
self._connect_rpc()
# Set up auto-completion
if UTILS_AVAILABLE:
self.autocomplete = setup_autocomplete(self)
else:
self.autocomplete = None
self.update_prompt()
def _connect_rpc(self):
@@ -242,7 +258,7 @@ class OverCodeShell(cmd.Cmd):
return stop
def default(self, line):
"""Handle unknown commands"""
"""Handle unknown commands with smart suggestions"""
# Check for aliases
parts = line.split()
if parts and parts[0] in self.aliases:
@@ -258,8 +274,17 @@ class OverCodeShell(cmd.Cmd):
c = self.theme.colors
print(c['error'] + f"✗ Unknown command: '{line}'")
print(c['warning'] + "→ Type 'help' for available commands")
print(c['info'] + "→ Type 'suggest' for command suggestions")
# Show smart suggestions if auto-completion is available
if self.autocomplete:
suggestion = self.autocomplete.smart_suggest(line)
if suggestion:
print(suggestion)
else:
print(c['warning'] + "→ Type 'help' for available commands")
else:
print(c['warning'] + "→ Type 'help' for available commands")
print(c['info'] + "→ Type 'suggest' for command suggestions")
def emptyline(self):
"""Do nothing on empty line"""
@@ -326,6 +351,10 @@ class OverCodeShell(cmd.Cmd):
("server", "Start local server"),
("share", "Share files online"),
],
"🎭 Demos & Features": [
("demo", "Feature demonstrations"),
("suggest", "Smart command suggestions"),
],
" Information": [
("fastfetch", "System information"),
("credits", "Show credits"),
@@ -389,6 +418,16 @@ class OverCodeShell(cmd.Cmd):
"""Show session statistics"""
StatsCommand(self.stats).run()
def do_demo(self, arg):
"""Run feature demonstrations"""
if self.rpc_active:
self._set_presence("Demo Mode", f"Testing: {arg or 'Features'}")
DemoCommand(arg.strip()).run()
def do_suggest(self, arg):
"""Show command suggestions"""
SuggestCommand(self).run()
def do_clear(self, arg):
"""Clear the screen"""
os.system('cls' if os.name == 'nt' else 'clear')