Detect existing PostHog setup and serve a menu of skills instead of re-running instrumentation
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- cli, developer-experience
Hướng nghiên cứu
Bắt đầu với src/lib/programs/posthog-integration/steps.ts và PostHogIntegrationIntroScreen.tsx, sau đó đọc package-scanning.ts, posthog-integration/index.ts và program-registry.ts. Truy vết cơ chế phát hiện dependency hiện có và các chương trình subcommand khả dụng. Hoàn thành khi một thiết lập hiện có nhận được menu skills có routing và một cách rõ ràng để chạy lại integration, mà không thay đổi flow mặc định hiện tại cho các thiết lập mới.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 208
- Fork
- 58
- Merge trung bình
- 2 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 76
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của PostHog/wizard
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 2 ngày
-
wizard --version prints unknown when run through npxCó thể đã có người làm @bryanlundberg đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
PostHog/wizard#1460 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Self-driving setup: checkbox labels and Confirm button overlap wrapped description textCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
PostHog/wizard#986 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của PostHog/wizard
Issue tương tự
-
bug Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
scottbenton/Iron-Link#541 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
hosts settings: the SSH address field and the separate User field are two ways to name one SSH userĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
prime-radiant-inc/evener#8161 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ignore Rules is not workingĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nicobailon/pi-subagents#3420 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Edit content TabList: selected tab's icon/label are hidden by its own selection indicator - a11yĐang mở01 type: bug 99 tag: UX Accessibility
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 2 ngày