65 lines
2.0 KiB
Python
65 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Verify the Hermes Agent CLI environment.
|
|
|
|
This script checks:
|
|
1. Python version and sys.path
|
|
2. Available CLI tools (git, curl, jq)
|
|
3. Python packages that are actually installed
|
|
|
|
Output format: JSON
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
import subprocess
|
|
import json
|
|
|
|
def main():
|
|
results = {}
|
|
|
|
# Python info
|
|
results['python_version'] = f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}"
|
|
results['python_executable'] = sys.executable
|
|
|
|
# Check pip list
|
|
pip_result = subprocess.run(['pip', 'list', '--format=freeze'], capture_output=True, text=True)
|
|
packages = [line.split('==')[0].lower() for line in pip_result.stdout.strip().split('\n') if line]
|
|
results['total_packages'] = len(packages)
|
|
|
|
# Check for specific packages
|
|
pkg_checks = {
|
|
'aiohttp': 'aiohttp' in packages,
|
|
'fastapi': 'fastapi' in packages,
|
|
'websocket-client': 'websocket-client' in packages,
|
|
'cdp-use': 'cdp-use' in packages,
|
|
'browser-harness': 'browser-harness' in packages,
|
|
'hermes-tools': any('hermes' in p for p in packages),
|
|
}
|
|
results['packages'] = pkg_checks
|
|
|
|
# Check CLI tools
|
|
cli_tools = ['python3', 'pip', 'git', 'curl']
|
|
cli_results = {}
|
|
for tool in cli_tools:
|
|
result = subprocess.run(['which', tool], capture_output=True)
|
|
cli_results[tool] = result.returncode == 0
|
|
results['cli_tools'] = cli_results
|
|
|
|
# Check jq
|
|
jq_result = subprocess.run(['which', 'jq'], capture_output=True)
|
|
results['jq_available'] = jq_result.returncode == 0
|
|
|
|
# Check directories
|
|
dirs = {
|
|
'hermes_profile': os.path.isdir(os.path.expanduser('~/.hermes/profiles/spark/')),
|
|
'wizard_outputs': os.path.isdir('/root/.hermes/wizard-outputs/spark/'),
|
|
'troupe_standup': os.path.isdir('/root/troupe-standup/'),
|
|
}
|
|
results['directories'] = dirs
|
|
|
|
# Output results
|
|
print(json.dumps(results, indent=2))
|
|
return 0
|
|
|
|
if __name__ == '__main__':
|
|
sys.exit(main()) |