PostHog CLI

Query PostHog events and manage feature flags via CLI with JSON output.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Buckeyes22/weather-app --skill posthog-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: PostHog CLI
Source: https://github.com/Buckeyes22/weather-app/tree/main/docs/corpora/agent-cli-skills/skills/posthog-cli
Command: npx skills add https://github.com/Buckeyes22/weather-app --skill posthog-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables teams to query PostHog analytics events and manage feature flags using a lightweight CLI, reducing time-to-insight.

Core Features & Use Cases

  • Event queries: retrieve PostHog events such as page_view for selected time ranges.
  • Feature flag management: list, enable, or disable flags from the terminal.
  • Integration: outputs JSON suitable for piping to analytics tools and dashboards.

Quick Start

Run a PostHog CLI command to query events and toggle feature flags from your terminal.

Frequently Asked Questions about PostHog CLI

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query PostHog analytics events from the command line?

The CLI outputs JSON-formatted data suitable for piping into other analytics tools and dashboards. This format ensures compatibility with downstream data processing workflows and allows teams to integrate event queries seamlessly into existing data pipelines.

Can I manage PostHog feature flags via CLI?

The CLI requires API key authentication to manage flags securely. It provides straightforward commands for flag administration, reducing time-to-insight and enabling quick toggling of features across modern software teams.

Do I need an API key to use PostHog CLI commands?

This authentication requirement applies to all operations, including retrieving events like page_view and toggling flags. It ensures that only authorized users can access or modify analytics data and feature flag states.

What format does the PostHog CLI output for event queries?

By enforcing JSON-formatted output, the CLI ensures compatibility with a wide range of downstream analytics tools. Teams can easily parse and visualize the event data retrieved from PostHog in their preferred dashboards.

Are there limitations to managing feature flags from the terminal?

While suitable for quick flag toggling and administration, teams requiring complex feature flag workflows or detailed rollout strategies may need to supplement this CLI approach with the full PostHog web interface for comprehensive flag management.