LaunchKit · 2026
Back to Skills

posthog-query

Run SQL queries against PostHog product analytics data using the PostHog CLI.

0
0 downloads
by @quinlanjager

Setup & Installation

openclaw skills install @quinlanjager/posthog-query

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install posthog-query

What This Skill Does

Runs HogQL (ClickHouse-compatible SQL) queries against PostHog product analytics data via the CLI. Returns results as JSON lines to stdout. Supports filtering by event type, URL, timestamp, and any stored event properties.

Queries analytics data from the terminal without opening the PostHog dashboard, making it straightforward to pipe results into scripts or agents.

When to use it

  • Count pageviews for a specific URL over the past week
  • Check which browsers users are on for a given event
  • Pull the 10 most recent events from your PostHog project
  • Track daily signups or feature-click trends over a date range
  • Audit event volume around a product change or deploy

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: How many pageviews did we get per day over the last 7 days?

AGENT
  1. 1Authenticate with PostHog using posthog-cli login
  2. 2Construct a HogQL query grouping pageview events by date over the last 7 days
  3. 3Run the query with posthog-cli exp query run
  4. 4Parse the JSON lines output and format the daily counts
OUTPUT

A list of dates with corresponding pageview counts, e.g. {"date": "2026-03-11", "pageviews": 4821}

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

PostHog accountPostHog API key with query:read scopeposthog-cli installed globally via npm install -g posthog-cli