Run gghstats serve in the background on macOS with a LaunchAgent (user session, no root). Linux servers use systemd instead.
Default SQLite path for local macOS: the binary now uses ~/Library/Application Support/gghstats/gghstats.db when GGHSTATS_DB is unset. Set GGHSTATS_DB explicitly in your env file to override β the example below uses ~/Library/Application Support/gghstats/.
| File | Purpose |
|---|---|
gghstats-serve.sh |
Wrapper: loads ~/.gghstats.env, then exec gghstats serve |
com.github.hrodrig.gghstats.plist |
LaunchAgent template (edit REPLACE_WITH_HOME paths) |
mkdir -p ~/bin ~/Library/Application\ Support/gghstats ~/Library/Logs
cp contrib/gghstats.env.example ~/.gghstats.env
chmod 600 ~/.gghstats.env
# Edit token, filter, and paths β example local DB:
# GGHSTATS_DB=$HOME/Library/Application Support/gghstats/gghstats.db
cp contrib/launchd/gghstats-serve.sh ~/bin/
chmod +x ~/bin/gghstats-serve.sh
sed "s|REPLACE_WITH_HOME|$HOME|g" contrib/launchd/com.github.hrodrig.gghstats.plist \
> ~/Library/LaunchAgents/com.github.hrodrig.gghstats.plist
launchctl bootstrap "gui/$(id -u)" ~/Library/LaunchAgents/com.github.hrodrig.gghstats.plist
open http://127.0.0.1:8080Logs: ~/Library/Logs/gghstats.log and gghstats.error.log.
launchctl bootout "gui/$(id -u)" ~/Library/LaunchAgents/com.github.hrodrig.gghstats.plist
launchctl bootstrap "gui/$(id -u)" ~/Library/LaunchAgents/com.github.hrodrig.gghstats.plistAfter brew install hrodrig/gghstats/gghstats, gghstats is on PATH. The wrapper and plist above still apply; there is no brew services stanza in the cask yet β use LaunchAgent or run interactively:
export GGHSTATS_GITHUB_TOKEN=ghp_xxx
gghstats run --openrun is an alias for serve; --open (or GGHSTATS_OPEN_BROWSER=1) opens the default browser when the HTTP server is ready.
For TLS, reverse proxy, or multi-user hosting, use gghstats-selfhosted. This LaunchAgent is for local / single-user use on a Mac.
- contrib/systemd/README.md β Linux
.deb/.rpmandsystemctl enable --now gghstats - contrib/gghstats.env.example β all
GGHSTATS_*variables