Main menu with arrow keys.
(self)
| 77 | traceback.print_exc() |
| 78 | |
| 79 | def _show_main_menu(self) -> Optional[str]: |
| 80 | """Main menu with arrow keys.""" |
| 81 | |
| 82 | choices = [ |
| 83 | ('Optimize kernels - Find and optimize CUDA kernels with AI', 'optimize'), |
| 84 | ('Configuration - API key and settings', 'config'), |
| 85 | ('Exit', 'exit'), |
| 86 | ] |
| 87 | |
| 88 | questions = [ |
| 89 | inquirer.List('action', |
| 90 | message="What do you want to do?", |
| 91 | choices=choices, |
| 92 | carousel=True) |
| 93 | ] |
| 94 | |
| 95 | try: |
| 96 | answers = inquirer.prompt(questions, theme=GreenPassion()) |
| 97 | if answers: |
| 98 | return answers.get('action') |
| 99 | return None |
| 100 | except Exception as e: |
| 101 | console.print(f"[red]Menu error: {e}[/red]") |
| 102 | return None |
| 103 | |
| 104 | def _optimize_workflow(self): |
| 105 | """Optimization workflow - SIMPLE and CLEAR.""" |