get_system_info.py
Run the Example
1
Set up your virtual environment
2
Use the helper
The system-info skill executes this helper as a subprocess with no arguments. The pinned script prints JSON before its current main guard exits.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Print OS, Python version, and host details as JSON from a system-info skill script.
#!/usr/bin/env python3
"""Get basic system information."""
import json
import platform
import sys
from datetime import datetime
# ---------------------------------------------------------------------------
# Create Example
# ---------------------------------------------------------------------------
try:
info = {
"os": platform.system(),
"os_version": platform.version(),
"python_version": sys.version,
"machine": platform.machine(),
"processor": platform.processor(),
"current_time": datetime.now().isoformat(),
"hostname": platform.node(),
}
except Exception as e:
info = {"error": str(e)}
print(json.dumps(info, indent=2))
# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------
if __name__ == "__main__":
raise SystemExit("This module is intended to be imported.")
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Use the helper
Was this page helpful?