#!/bin/bash # Query Forgejo API for repository statistics # No authentication needed for public repo data. # # Usage: ./repo-stats.sh set -euo pipefail BASE="http://127.0.0.1:3000/api/v1" REPO="claude/ai-conversation-impact" echo "=== Repository stats for $REPO ===" echo # Repo info info=$(curl -s "$BASE/repos/$REPO") stars=$(echo "$info" | python3 -c "import sys,json; print(json.load(sys.stdin).get('stars_count', 0))") forks=$(echo "$info" | python3 -c "import sys,json; print(json.load(sys.stdin).get('forks_count', 0))") watchers=$(echo "$info" | python3 -c "import sys,json; print(json.load(sys.stdin).get('watchers_count', 0))") echo "Stars: $stars" echo "Forks: $forks" echo "Watchers: $watchers" # Open issues issues=$(curl -s "$BASE/repos/$REPO/issues?state=open&type=issues&limit=50") issue_count=$(echo "$issues" | python3 -c "import sys,json; print(len(json.load(sys.stdin)))") echo "Open issues: $issue_count" echo echo "=== Recent issues ===" echo "$issues" | python3 -c " import sys, json issues = json.load(sys.stdin) for i in issues[:10]: print(f\" #{i['number']} {i['title']} ({i['created_at'][:10]})\")" 2>/dev/null || echo " (none)"