Detect existing PostHog setup and serve a menu of skills instead of re-running instrumentation
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- cli, developer-experience
Direzione di ricerca
Inizia con src/lib/programs/posthog-integration/steps.ts e PostHogIntegrationIntroScreen.tsx, poi leggi package-scanning.ts, posthog-integration/index.ts e program-registry.ts. Traccia il rilevamento delle dipendenze esistente e i programmi di sottocomando disponibili. Il lavoro è completo quando una configurazione esistente riceve un menu di skills con routing e un modo esplicito per rieseguire l'integrazione, senza modificare il flusso predefinito attuale per le nuove configurazioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
When you run npx @posthog/wizard (the default integration flow) on a project that already has PostHog set up, the wizard doesn't notice. It walks you straight into the full instrumentation program — detect → intro ("Continue") → health check → setup → auth → run (plan event tracking, install posthog, instrument events) → outro.
From a user who tried this on an already-instrumented project:
It seemed like it didn't know I'd already set up PostHog. I feel like it should notice that and say something like "Looks like you already have PostHog set up, what can we help you with?" (with a list of skills) — instead I clicked Continue and it started the whole instrumentation process. I would've been worried it was about to start changing whatever I had set up previously.
Once I finished the wizard, it wasn't clear to me how to interact with it again. If I wanted to audit my events or run the product tours skill, where would I go?
The skills are runnable (npx @posthog/wizard audit, npx @posthog/wizard events-audit, etc.), but nothing surfaces them — so re-running the wizard on an existing project is both confusing and a little scary (looks like it might overwrite existing setup).
Proposed behavior
When the default flow detects PostHog is already installed in the target project, intervene instead of starting instrumentation: show a menu of available wizard skills/programs and ask what the user wants to do, e.g.
Looks like you already have PostHog set up. What can we help you with?
› Audit my events
Events audit
Revenue analytics setup
Error tracking source maps
SDK doctor
...
Re-run integration anyway
Selecting an option routes into that program. "Re-run integration anyway" preserves the current behavior for anyone who genuinely wants it.
Relevant code
- Default program steps:
src/lib/programs/posthog-integration/steps.ts(detect→intro→ ...). - PostHog-installed detection already exists in pieces and could be reused/centralized:
src/lib/programs/shared/package-scanning.ts—findPackageJsons()scans forPOSTHOG_SDKS(posthog-js,posthog-node, etc.).hasDeclaredDependency(...)insrc/lib/programs/posthog-integration/index.ts(currently only logs a warning and continues).hasPostHogSdk(...)used by the source-maps / revenue prerequisite gates.
- Intro screen that currently just offers "Continue":
src/ui/tui/screens/PostHogIntegrationIntroScreen.tsx. - Program registry (the source of truth for a skills menu):
src/lib/programs/program-registry.ts(getSubcommandPrograms()).
Notes / open questions
- "Already installed" should probably be more than just a dependency in
package.json— ideally an actual init/API key — to avoid false positives on half-finished setups. - This also addresses discoverability: the menu doubles as the answer to "how do I run a skill again later?" Worth coordinating with the docs update in PostHog/posthog.com#17438.
- Keep an escape hatch to force the integration flow (menu option and/or a flag) for users who explicitly want to re-instrument.
Filed from team triage of a wizard run-through on an existing PostHog project.
- Lingua principale
- TypeScript
- Stelle
- 208
- Fork
- 58
- Merge medio
- 2g 7h
- PR unite (30g)
- 76
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PostHog/wizard
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
wizard --version prints unknown when run through npxForse già presa @bryanlundberg l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
PostHog/wizard#1460 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni
-
Self-driving setup: checkbox labels and Confirm button overlap wrapped description textForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
PostHog/wizard#986 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di PostHog/wizard
Issue simili
-
bug Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
scottbenton/Iron-Link#541 ·
I maintainer di solito rispondono entro 1 giorno
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH userAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
prime-radiant-inc/evener#8161 ·
I maintainer di solito rispondono entro 1 giorno
-
Ignore Rules is not workingApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nicobailon/pi-subagents#3420 ·
I maintainer di solito rispondono entro 1 giorno
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yAperta01 type: bug 99 tag: UX Accessibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 2 giorni