MCPcopy Create free account
hub / github.com/Claw-AI-Lab/Claw-AI-Lab / _is_opencode_installed

Function _is_opencode_installed

backend/agent/researchclaw/cli.py:29–40  ·  view source on GitHub ↗

Check if the ``opencode`` CLI is available on PATH.

()

Source from the content-addressed store, hash-verified

27# ---------------------------------------------------------------------------
28
29def _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
43def _is_npm_installed() -> bool:

Callers 3

_prompt_opencode_installFunction · 0.85
cmd_runFunction · 0.85
cmd_setupFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected