posthog-clilisted
Install: claude install-skill arthjean/skills
# PostHog CLI
Operate PostHog through the official `@posthog/cli` agent API. Keep the bundled Bash helpers for REST gaps, deterministic pipelines, and HogQL file or tabular workflows.
## Operating contract
1. Set the absolute directory containing this `SKILL.md` as `POSTHOG_SKILL_DIR`. In a standard user installation:
```bash
POSTHOG_SKILL_DIR="${POSTHOG_SKILL_DIR:-$HOME/.agents/skills/posthog-cli}"
```
2. Keep the working directory in the user's project. The helpers discover the nearest `.env.local` or `.env` from `$PWD`; changing into the skill directory selects the wrong context.
3. Use `bunx --bun @posthog/cli@latest`. Do not install the CLI globally and do not use npm, npx, pnpm, or yarn.
4. Prefer `posthog-cli api` over raw REST. It exposes the current agent-oriented tool catalog, schemas, dry-run validation, and destructive-operation checks.
5. Keep credentials in the environment. Never print, log, commit, or return a personal API key, locally stored login token, authorization header, or secret-bearing response field.
6. Keep browser use opt-in. Do not run `login`, open dashboard URLs, or invoke browser authentication unless the user explicitly requested it.
7. Require explicit intent and an unambiguous organization, project, environment, and resource before any create, update, delete, rollout, experiment transition, cohort membership change, bulk operation, or other mutation. An exact user request is authorization; do not add a redundant confirmation.
8.