Files
clickthrough/examples/quickstart.py
Luna 4aa51e2d69
All checks were successful
python-syntax / syntax-check (push) Successful in 29s
feat: bootstrap clickthrough server, skill docs, and syntax CI
2026-04-05 19:59:39 +02:00

32 lines
662 B
Python

import os
import requests
BASE_URL = os.getenv("CLICKTHROUGH_URL", "http://127.0.0.1:8123")
TOKEN = os.getenv("CLICKTHROUGH_TOKEN", "")
headers = {}
if TOKEN:
headers["x-clickthrough-token"] = TOKEN
def main():
r = requests.get(f"{BASE_URL}/health", headers=headers, timeout=10)
r.raise_for_status()
print("health:", r.json())
s = requests.get(
f"{BASE_URL}/screen",
headers=headers,
params={"with_grid": True, "grid_rows": 12, "grid_cols": 12},
timeout=30,
)
s.raise_for_status()
payload = s.json()
print("screen meta:", payload.get("meta", {}))
if __name__ == "__main__":
main()