MCPcopy
hub / github.com/PromtEngineer/localGPT / _command_exists

Method _command_exists

run_system.py:213–220  ·  view source on GitHub ↗

Check if a command exists in PATH.

(self, command: str)

Source from the content-addressed store, hash-verified

211 return True
212
213 def _command_exists(self, command: str) -> bool:
214 """Check if a command exists in PATH."""
215 try:
216 subprocess.run([command, '--version'],
217 capture_output=True, check=True, timeout=5)
218 return True
219 except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError):
220 return False
221
222 def ensure_models(self):
223 """Ensure required Ollama models are available."""

Callers 1

check_prerequisitesMethod · 0.95

Calls 1

runMethod · 0.45

Tested by

no test coverage detected