#!/usr/bin/env python3 """ Project Tamagotchi - Browser Terminal Single launcher for the browser-based terminal tamagotchi """ import os import sys import subprocess def main(): print("=" * 60) print("🐣 PROJECT TAMAGOTCHI - BROWSER TERMINAL") print("=" * 60) print("Features:") print(" • Terminal interface in your browser") print(" • Real-time file monitoring (every 2 seconds)") print(" • ASCII display (no emojis)") print(" • Activity detection when you edit files") print(" • Command history (use arrow keys)") print(" • Terminal effects and animations") print() print("šŸŽ® Controls in browser:") print(" • f - Feed the tamagotchi") print(" • p - Play with the tamagotchi") print(" • r - Refresh stats (automatic)") print(" • q - Quit session") print() print("šŸ”§ How it works:") print(" • Scans your project for code files") print(" • Detects file changes in real-time") print(" • Updates tamagotchi mood based on activity") print(" • Shows project statistics") print() # Check dependencies script_dir = os.path.dirname(os.path.abspath(__file__)) venv_python = os.path.join(script_dir, 'tamagotchi_env', 'bin', 'python') if not os.path.exists(venv_python): print("šŸ“¦ Setting up environment...") try: subprocess.run([sys.executable, '-m', 'venv', 'tamagotchi_env'], cwd=script_dir, check=True, capture_output=True) print("āœ… Virtual environment created") except subprocess.CalledProcessError: print("āŒ Failed to create virtual environment") return 1 # Install dependencies if needed print("šŸ“¦ Checking dependencies...") try: venv_pip = os.path.join(script_dir, 'tamagotchi_env', 'bin', 'pip') result = subprocess.run([venv_pip, 'install', 'flask', 'flask-socketio'], cwd=script_dir, check=True, capture_output=True) print("āœ… Dependencies ready") except subprocess.CalledProcessError: print("āœ… Dependencies already installed") # Get project name project_name = "MyClub" if len(sys.argv) > 1: project_name = sys.argv[1] print(f"šŸ“Š Project: {project_name}") print("🌐 Starting browser terminal...") print("-" * 60) print("🌐 OPEN YOUR BROWSER TO: http://localhost:5000") print("āŒØļø Terminal interface with real-time updates!") print("šŸ”„ Edit files to see activity detection!") print("šŸ“± Works on mobile too!") print("šŸ›‘ Press Ctrl+C to stop the server") print("=" * 60) # Launch browser terminal terminal_script = os.path.join(script_dir, 'browser_terminal_tamagotchi.py') if os.path.exists(terminal_script): try: subprocess.run([venv_python, terminal_script, project_name]) except KeyboardInterrupt: print("\nšŸ‘‹ Browser terminal stopped! Thanks for playing!") return 0 else: print(f"āŒ Error: {terminal_script} not found!") return 1 if __name__ == '__main__': exit(main()) # Testing file tracking Mon Jan 12 17:44:15 CET 2026 # Testing stable terminal Mon Jan 12 17:46:45 CET 2026 # Testing bigger terminal Mon Jan 12 17:50:30 CET 2026 # Testing much bigger UI Mon Jan 12 17:51:32 CET 2026