Check if Claude Code CLI is available and return the path.
()
| 62 | |
| 63 | |
| 64 | def check_claude_code_available() -> Optional[str]: |
| 65 | """Check if Claude Code CLI is available and return the path.""" |
| 66 | # Check common locations for Claude Code CLI |
| 67 | claude_paths = [ |
| 68 | "claude", # If in PATH |
| 69 | os.path.expanduser("~/.claude/local/claude"), # User home |
| 70 | ] |
| 71 | |
| 72 | for claude_path in claude_paths: |
| 73 | try: |
| 74 | result = subprocess.run( |
| 75 | [claude_path, "--version"], capture_output=True, text=True, check=False |
| 76 | ) |
| 77 | if result.returncode == 0: |
| 78 | return claude_path |
| 79 | except (subprocess.CalledProcessError, FileNotFoundError): |
| 80 | continue |
| 81 | |
| 82 | return None |
| 83 | |
| 84 | |
| 85 | def get_previous_version() -> Optional[str]: |
no outgoing calls
no test coverage detected