Harvv CLI

npx @harvv/cli from any project root. Auto-detects your stack, creates your account, installs the pixel in the right place. No signup form, no copy-paste, no manual file edits.

Quickstart

Run it directly with npx — no global install needed:

npx @harvv/cli@latest

The CLI walks you through:

  1. Detects your project type from package.json / config files (Next.js, Vite, Astro, Shopify CLI, WordPress, Rails, plain static)
  2. Prompts for your email if you don't have an account yet
  3. Creates account + site + pixel key on harvv.com
  4. Injects the pixel into the correct file for your stack (e.g. app/layout.tsx for Next.js, src/app.html for SvelteKit, index.html for Vite)
  5. Prints the dashboard URL for your new site

Non-interactive

For CI / Docker entrypoints / config-as-code workflows, skip the prompts by passing flags:

npx @harvv/cli@latest --key d1db1759f22827e4

If you already have your site key, this writes the pixel snippet without contacting the API. Useful for ephemeral previews where you don't want a new site per branch.

Global install (optional)

If you'll use it across many projects:

npm install -g @harvv/cli
harvv

Subcommands

harvv

Default — install the pixel in the current project. Same as harvv install.

harvv issues

Lists active issues for your site, sorted by impact. Needs an API key:

npx @harvv/cli issues --api-key hv_live_xxx

Or set HARVV_API_KEY in your shell:

export HARVV_API_KEY=hv_live_xxx
npx @harvv/cli issues

What it detects

The CLI looks for project signals in this order:

For each, the CLI knows where to inject the pixel snippet so it loads on every page. If detection fails, it falls back to printing the snippet and asking you to paste it in your layout file.

What gets sent to Harvv

That's the whole thing. No code, no env vars, no source files. The CLI source is auditable — github.com/AxiomState/harvv-cli.

Source