Check if the ``opencode`` CLI is available on PATH.
()
| 27 | # --------------------------------------------------------------------------- |
| 28 | |
| 29 | def _is_opencode_installed() -> bool: |
| 30 | """Check if the ``opencode`` CLI is available on PATH.""" |
| 31 | if shutil.which("opencode") is None: |
| 32 | return False |
| 33 | try: |
| 34 | r = subprocess.run( |
| 35 | ["opencode", "--version"], |
| 36 | capture_output=True, text=True, timeout=15, |
| 37 | ) |
| 38 | return r.returncode == 0 |
| 39 | except Exception: # noqa: BLE001 |
| 40 | return False |
| 41 | |
| 42 | |
| 43 | def _is_npm_installed() -> bool: |
no test coverage detected