Update ccstat to the latest version. Checks current vs latest version, asks user to confirm, then downloads the update. Cross-platform, no curl dependency. Trigger: /ccstat-update, "update ccstat", "ccstat update".
Run this Python script to check versions:
python3 - <<'PYEOF'
import urllib.request, os, sys
script = os.path.join(os.path.expanduser("~"), ".claude", "statusline.py")
url = "https://raw.githubusercontent.com/Nipeno/ccstat/main/statusline.py"
# Get current version
current = None
if os.path.exists(script):
with open(script, encoding='utf-8') as f:
for line in f:
if line.startswith("VERSION"):
current = line.split('"')[1]
break
if not current:
print("ccstat is not installed. Run /ccstat-setup first.")
sys.exit(0)
# Get latest version
latest = None