Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

posthog-cli-queries

Skill by debugtheworldbot

Queries PostHog event and dashboard data from the terminal using posthog-cli and helper scripts. Meant for people who want repeatable analytics commands instead of clicking through the PostHog UI.

  • Score 88
  • 1.5k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install posthog-cli-queries

Built from the published package, never by AI.

git clone --depth 1 https://github.com/debugtheworldbot/keyStats /tmp/keyStats && mkdir -p ~/.claude/skills && cp -r /tmp/keyStats/.agents/skills/posthog-cli-queries ~/.claude/skills/posthog-cli-queries

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install posthog-cli-queries in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill lets an AI assistant query a project's PostHog data from the terminal. For event data it runs HogQL through the posthog-cli exp query run command, with example queries for recent events, top events, pageviews, clicks, app versions, OS breakdowns and hourly volume. The CLI has no dedicated dashboard command, so dashboard metadata and cached insight results are read with bundled shell scripts.

The skill tells the assistant to check auth first with a simple SELECT, to return the exact command used, and to note caveats such as partial-day data, test-account filtering and missing properties. It also includes jq snippets for pulling tile names and breakdown rows from a fetched dashboard. It is intended for developers and analysts who work with PostHog data from the command line.

Written from the project's SKILL.md and checked against it.

What it can do

  • HogQL event queriesRuns HogQL queries through posthog-cli exp query run for events, breakdowns and volumes.
  • Common query examplesProvides ready commands for recent events, top events, pageviews, clicks and OS breakdowns.
  • List dashboardsLists dashboards using the dashboard_list.sh script.
  • Fetch dashboard JSONFetches a dashboard as JSON using the dashboard_fetch.sh script.
  • Dashboard summaryFetches a dashboard summary with the --summary option of dashboard_fetch.sh.
  • Dashboard analysis notesGuides checks on last_refresh, partial days, test-account filtering and null buckets.
  • jq snippetsExtracts tile names and top breakdown rows from fetched dashboard JSON.

What you need

  • posthog-cli installed and authenticated
  • Personal API key with query:read scope
  • ~/.posthog/credentials.json with host, token and env_id for dashboard scripts
  • A PostHog project

Try asking

  • Show me the top 15 events from the last 7 days in PostHog
  • Fetch the summary of PostHog dashboard 1075953
  • Break down active users by OS for the past week

Good to know

  • The posthog-cli has no dedicated dashboard command, so dashboard access uses helper scripts.
  • Dashboard results are usually cached insight payloads, so last_refresh matters.
  • Long queries may time out and need a narrower date range or more aggregation.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .agents/skills/posthog-cli-queries/SKILL.md, .agents/skills/posthog-cli-queries/scripts/dashboard_fetch.sh, .agents/skills/posthog-cli-queries/scripts/dashboard_list.sh. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB
  • scripts/dashboard_fetch.sh1 KB
  • scripts/dashboard_list.sh829 B

Alternatives to posthog-cli-queries

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

posthog-cli-queries: common questions

Does this skill need a special PostHog API key?

Query commands need a personal API key with the query:read scope. If the CLI reports a missing scope, the key scopes must be fixed first.

Can it read PostHog dashboards?

Yes. Helper scripts list dashboards, fetch dashboard JSON and fetch summaries, because the CLI has no dashboard command.

Why should partial-day data be checked?

The skill says not to compare a partial current day against a full previous day without saying so. It also advises checking the filterTestAccounts setting before comparing tiles.

How do I install posthog-cli-queries?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is posthog-cli-queries free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is posthog-cli-queries safe to use?

It scores 88 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to posthog-cli-queries?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

posthog-cli-queries Install

Add to stack

Loading.