
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@posthog/cli
Advanced tools
> posthog-cli --help
The command line interface for PostHog 🦔
Usage: posthog-cli [OPTIONS] <COMMAND>
Commands:
login Interactively authenticate with PostHog, storing a personal API token locally. You can also use the environment variables `POSTHOG_CLI_API_KEY`, `POSTHOG_CLI_PROJECT_ID` and `POSTHOG_CLI_HOST`
query Run a SQL query against any data you have in posthog. This is mostly for fun, and subject to change
sourcemap Upload a directory of bundled chunks to PostHog
exp Contains a set of experimental commands
help Print this message or the help of the given subcommand(s)
Options:
--host <HOST> The PostHog host to connect to [default: https://us.posthog.com]
-h, --help Print help
-V, --version Print version
You can authenticate with PostHog interactively for using the CLI locally, but if you'd like to use it in a CI/CD pipeline, we recommend using these environment variables:
POSTHOG_CLI_HOST: The PostHog host to connect to [default: https://us.posthog.com]POSTHOG_CLI_API_KEY: A posthog personal API key. (also accepts POSTHOG_CLI_TOKEN for backward compatibility)POSTHOG_CLI_PROJECT_ID: The ID number of the project/environment to connect to. E.g. the "2" in https://us.posthog.com/project/2 (also accepts POSTHOG_CLI_ENV_ID for backward compatibility)Commands require different API scopes. Make sure to set these scopes on your personal API key:
| Command | Required Scopes |
|---|---|
query | query:read |
sourcemap | error_tracking:write |
exp endpoints list/get/pull | endpoint:read |
exp endpoints push | endpoint:write, insight_variable:write |
exp endpoints run | query:read |
exp tasks | task:read |
FAQs
The command line interface for PostHog 🦔
The npm package @posthog/cli receives a total of 206,152 weekly downloads. As such, @posthog/cli popularity was classified as popular.
We found that @posthog/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 17 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.