-
Notifications
You must be signed in to change notification settings - Fork 61
fix: check for claude install first #1261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -570,9 +570,26 @@ def _display_dashboard_tab(self): | |
|
|
||
| def _display_claude_tab(self): | ||
| """Display the Claude Code interface tab.""" | ||
| print(" \033[37m→ Run Claude Code\033[0m") | ||
| print() | ||
| print("Press Enter to launch Claude Code with session tracking.") | ||
| # Check if Claude Code is installed | ||
| from codegen.cli.commands.claude.utils import resolve_claude_path | ||
|
|
||
| claude_path = resolve_claude_path() | ||
| if not claude_path: | ||
| # Display error message when Claude is not installed | ||
| print(" \033[31m✗ Claude Code Not Installed\033[0m") | ||
| print() | ||
| print("\033[33m⚠ Claude Code CLI is not installed or cannot be found.\033[0m") | ||
| print() | ||
| print("To install Claude Code:") | ||
| print(" • Install globally: \033[36mnpm install -g @anthropic-ai/claude-code\033[0m") | ||
| print(" • Or run: \033[36mclaude /migrate-installer\033[0m for local installation") | ||
| print() | ||
| print("Once installed, restart this CLI to use Claude Code.") | ||
| else: | ||
| print(" \033[37m→ Run Claude Code\033[0m") | ||
| print() | ||
| print("Press Enter to launch Claude Code with session tracking.") | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Claude Tab Layout Inconsistent Across InstallationsThe |
||
| # The claude tab main content area should be a fixed 10 lines | ||
| self._pad_to_lines(7) | ||
|
|
||
|
|
@@ -892,6 +909,15 @@ def _handle_dashboard_tab_keypress(self, key: str): | |
| def _handle_claude_tab_keypress(self, key: str): | ||
| """Handle keypresses in the claude tab.""" | ||
| if key == "\r" or key == "\n": # Enter - run Claude Code | ||
| # Check if Claude is installed before attempting to run | ||
| from codegen.cli.commands.claude.utils import resolve_claude_path | ||
|
|
||
| claude_path = resolve_claude_path() | ||
| if not claude_path: | ||
| # Claude is not installed, don't try to launch | ||
| logger.warning("Attempted to launch Claude Code but it's not installed", extra={"operation": "tui.launch_claude", "error": "not_installed"}) | ||
| return | ||
|
|
||
| self._run_claude_code() | ||
|
|
||
| def _run_claude_code(self): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.