Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): nudge the wizard CLI from the new-source catalog (#66219)

Tom Owers74261eae674a
diff --git a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
index 8d6f9db96463..4ff3660d5bd4 100644
--- a/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
+++ b/frontend/src/scenes/data-warehouse/editor/OutputPane.tsx
@@ -63,6 +63,8 @@ import {
type ExportContext,
} from '~/types'
+import { WarehouseWizardHint } from 'products/data_warehouse/frontend/shared/components/WarehouseWizardHint'
+
import {
copyTableToCsv,
copyTableToExcel,
@@ -1109,10 +1111,15 @@ const Content = ({
Query results will be visualized here. Press <KeyboardShortcut command enter /> to run the
query.
</span>
- <MCPUseCaseCard
- surfaceKey="sql.execute"
- expiresAfterMs={ONE_DAY_IN_MILLISECONDS}
+ <WarehouseWizardHint
className="max-w-140"
+ fallback={
+ <MCPUseCaseCard
+ surfaceKey="sql.execute"
+ expiresAfterMs={ONE_DAY_IN_MILLISECONDS}
+ className="max-w-140"
+ />
+ }
/>
</div>
)
@@ -1163,10 +1170,15 @@ const Content = ({
{msg} Press <KeyboardShortcut command enter /> to run the query at your cursor. Separate multiple
statements with <code>;</code> to run them independently.
</span>
- <MCPUseCaseCard
- surfaceKey="sql.execute"
- expiresAfterMs={ONE_DAY_IN_MILLISECONDS}
+ <WarehouseWizardHint
className="max-w-140"
+ fallback={
+ <MCPUseCaseCard
+ surfaceKey="sql.execute"
+ expiresAfterMs={ONE_DAY_IN_MILLISECONDS}
+ className="max-w-140"
+ />
+ }
/>
</div>
)
diff --git a/products/data_warehouse/frontend/scenes/NewSourceScene/SourceCatalog.tsx b/products/data_warehouse/frontend/scenes/NewSourceScene/SourceCatalog.tsx
index d417a0baab01..63bd69588ad2 100644
--- a/products/data_warehouse/frontend/scenes/NewSourceScene/SourceCatalog.tsx
+++ b/products/data_warehouse/frontend/scenes/NewSourceScene/SourceCatalog.tsx
@@ -11,6 +11,7 @@ import { AccessControlLevel, AccessControlResourceType } from '~/types'
import { SourceIcon } from '../../shared/components/SourceIcon'
import { SourceReleaseTag } from '../../shared/components/SourceReleaseTag'
+import { WarehouseWizardHint } from '../../shared/components/WarehouseWizardHint'
import { CatalogItem, sourceCatalogLogic } from './sourceCatalogLogic'
// Horizontal card: logo on the left, name/status/action stacked on the right. `min-h` (not a fixed
@@ -140,6 +141,7 @@ export function SourceCatalog({ allowedSources }: SourceCatalogProps): JSX.Eleme
</div>
<div className="flex flex-col gap-4 flex-1">
+ <WarehouseWizardHint />
<LemonInput type="search" placeholder="Search sources..." value={search} onChange={setSearch} />
{filteredItems.length === 0 && (
diff --git a/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx b/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx
new file mode 100644
index 000000000000..a522eb5f87c1
--- /dev/null
+++ b/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx
@@ -0,0 +1,89 @@
+import { useValues } from 'kea'
+import posthog from 'posthog-js'
+import { ReactNode, useState } from 'react'
+
+import { IconSparkles, IconX } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { CommandBlock } from 'lib/components/CommandBlock/CommandBlock'
+import { AgentBadgeRotator } from 'lib/components/MCPHint/AgentBadgeRotator'
+import { cn } from 'lib/utils/css-classes'
+import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
+
+import { Region } from '~/types'
+
+// Persist dismissal so the hint doesn't nag a user who has seen it. Mirrors the MCP hint cards.
+const DISMISSED_KEY = 'warehouse-wizard-hint-dismissed'
+
+/**
+ * Agent-flavored nudge shown above the new-source catalog, mirroring the MCP hint card style:
+ * pushes the `npx @posthog/wizard warehouse` CLI, which auto-detects and connects a user's
+ * databases/APIs straight from their codebase instead of filling in the forms by hand.
+ */
+export function WarehouseWizardHint({
+ className,
+ fallback,
+}: {
+ className?: string
+ /** Rendered in place of the hint when it can't show (self-hosted or already dismissed). Lets a
+ * host surface another nudge there — e.g. the SQL editor falls back to its MCP hint — so the
+ * two are mutually exclusive and never stack. */
+ fallback?: ReactNode
+}): JSX.Element | null {
+ const { preflight, isCloudOrDev } = useValues(preflightLogic)
+ const [dismissed, setDismissed] = useState(() => localStorage.getItem(DISMISSED_KEY) === '1')
+
+ // The wizard CLI only targets cloud (US/EU) and dev instances — self-hosted has no
+ // preconfigured endpoint, so hide it rather than show a command that can't work.
+ if (!isCloudOrDev || dismissed) {
+ return fallback ? <>{fallback}</> : null
+ }
+
+ const region = preflight?.region || Region.US
+ const command = `npx -y @posthog/wizard@latest warehouse${region === Region.EU ? ' --region eu' : ''}`
+
+ const handleDismiss = (): void => {
+ localStorage.setItem(DISMISSED_KEY, '1')
+ setDismissed(true)
+ posthog.capture('warehouse wizard hint dismissed')
+ }
+
+ return (
+ <div
+ className={cn(
+ 'relative rounded-lg border border-dashed border-primary bg-bg-light p-4 flex flex-col gap-3',
+ className
+ )}
+ >
+ <LemonButton
+ icon={<IconX />}
+ size="xsmall"
+ onClick={handleDismiss}
+ className="absolute top-2 right-2"
+ tooltip="Dismiss"
+ aria-label="Dismiss"
+ />
+ <div className="flex items-center gap-2 pr-6">
+ <IconSparkles className="size-4 shrink-0" />
+ <h4 className="m-0 text-sm font-semibold">
+ Let <AgentBadgeRotator /> connect your sources for you
+ </h4>
+ </div>
+ <div className="text-sm text-default">
+ Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and
+ connects them to PostHog.
+ </div>
+ <div className="pt-1">
+ <CommandBlock
+ command={command}
+ copyLabel="Data warehouse wizard command"
+ ariaLabel="Copy data warehouse wizard command"
+ size="sm"
+ decoration="rainbow"
+ className="bg-surface-secondary border border-primary !m-0 hover:border-accent"
+ onCopy={() => posthog.capture('warehouse wizard hint command copied')}
+ />
+ </div>
+ </div>
+ )
+}