Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By griffinwork40v1.0.0MIT
CLI for the Google Analytics 4 Data API — pull aggregate traffic reports from any GA4 property. Read-only, aggregate-only (no PII). An agent-afk plugin.
Claude loads one when your task matches it, or you run it by name.
CLI for the Google Analytics 4 Data API — pull aggregate traffic reports from any GA4 property. Read-only, aggregate-only (no PII). An AFK plugin.
Wraps the GA Admin API (property discovery) and Data API (runReport / getMetadata) behind a Typer CLI. JSON by default (pipe into jq); --pretty for Rich tables. No hardcoded property — works with any GA4 property the authenticated Google account can see.
afk plugin install griffinwork40/ga-cli
This registers the ga skill, available in every AFK session. Install the Python dependencies once from the bundled requirements file:
pip install -r ~/.afk/plugins/ga-cli/skills/ga/scripts/requirements.txt
Requires Python 3.11+.
git clone https://github.com/griffinwork40/ga-cli.git
cd ga-cli/skills/ga/scripts
pip install -r requirements.txt
# Optional: put `ga` on your PATH
ln -s "$(pwd)/ga" /usr/local/bin/ga
ga --help
analytics.readonly only — no write operations.ga properties lists every GA4 property the authenticated account can see, with numeric IDs for use with --property.ga report --metrics … --dimensions … runs any runReport query.ga metadata dumps all available dimensions and metrics for a property.--pretty renders a Rich table for any command.ga uses user OAuth (a Desktop OAuth client), read-only scope only. Full setup walkthrough: skills/ga/references/auth-setup.md.
In short:
~/.config/ga-cli/client_secret.json
ga auth --reauth
A browser window opens. On the "Google hasn't verified this app" screen: Advanced → Go to <app> (unsafe) → allow read-only Analytics.~/.config/ga-cli/token.json (chmod 0600). Subsequent commands refresh silently.Token paths and overrides:
| Purpose | Default | Env override |
|---|---|---|
| OAuth client secret | ~/.config/ga-cli/client_secret.json | GA_CLIENT_SECRET |
| Cached refresh token | ~/.config/ga-cli/token.json | GA_TOKEN |
⚠️ Testing-mode tokens expire in ~7 days. If you plan to run
gain a scheduled/headless context, either publish the OAuth consent screen (Testing → In production) or switch to a service account. Seeauth-setup.mdfor details.
ga properties List accessible GA4 properties (account + property name + numeric ID)
ga auth [--reauth] Load/refresh OAuth creds; --reauth forces fresh browser consent
ga report --metrics … Generic runReport (any metrics × dimensions)
ga acquisition Sessions + users by default channel group
ga referrers Sessions + users by source / medium (top referrers)
ga top-pages Page views + sessions by page path + title, top N
ga geo Sessions + users by country
ga trend Sessions + users by date (daily), ascending
ga metadata Dump all dimensions & metrics for the property
All commands accept --property <ID> (or set GA_PROPERTY_ID in the environment). Run ga properties to find the numeric ID for your property. All commands support --pretty for a Rich table.
No property ID is hardcoded. Before running data commands:
# Discover your property IDs:
ga properties | jq -r '.rows[] | [.property_id, .account, .property] | @tsv'
# Set for the session:
export GA_PROPERTY_ID=123456789
# Or pass per-command:
ga acquisition --property 123456789 --days 28
# Acquisition channels — where traffic comes from:
ga acquisition --days 28 --pretty
# Total sessions + users across all channels:
ga acquisition --days 28 \
| jq '{sessions: ([.rows[].sessions|tonumber]|add), users: ([.rows[].totalUsers|tonumber]|add)}'
# Top referrers (source / medium):
ga referrers --days 28 --limit 10 \
| jq -r '.rows[] | [.sessions, .sessionSourceMedium] | @tsv'
# Top pages by view count:
ga top-pages --days 28 --limit 10 \
| jq -r '.rows[] | [.screenPageViews, .pagePath] | @tsv'
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (griffinwork40/ga-cli) — no native marketplace selected
npx claudepluginhub p/griffinwork40-ga-cliPlugins from other owners that cover similar ground