~kris/dots

srice

ref: a4bfa48cdda924f7a77a81e8d8e93e326a01b8a0 srice/.local/bin/srht-repos -rwxr-xr-x 406 bytes
a4bfa48c — Kris Yotam mksh: reliable history hook via HISTFILE growth + binary record parse 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
#!/bin/sh
# srht-repos -- list all sr.ht repositories
set -eu

TOKEN=$(cat ~/.config/srht/token)

curl -s --oauth2-bearer "$TOKEN" -H 'Content-Type: application/json' \
  -d '{"query": "{ me { repositories { results { name visibility description updated } cursor } } }"}' \
  https://git.sr.ht/query | jq -r '.data.me.repositories.results[] | "\(.name)\t\(.visibility)\t\(.description // "")"' | column -t