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.

fix(onboarding): drop --region from wizard subcommand commands (#73555)

Christiaan Hendriksenb922f9702fe0
diff --git a/frontend/src/scenes/onboarding/shared/useWizardCommand.ts b/frontend/src/scenes/onboarding/shared/useWizardCommand.ts
index b9f6316d552b..afc504fa367f 100644
--- a/frontend/src/scenes/onboarding/shared/useWizardCommand.ts
+++ b/frontend/src/scenes/onboarding/shared/useWizardCommand.ts
@@ -3,8 +3,6 @@ import { useValues } from 'kea'
import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { teamLogic } from 'scenes/teamLogic'
-import { Region } from '~/types'
-
const BASE_COMMAND = 'npx -y @posthog/wizard@latest'
export interface UseWizardCommandOptions {
@@ -17,25 +15,24 @@ export interface UseWizardCommandOptions {
}
/**
- * The canonical `npx @posthog/wizard` command for this region, with an optional
- * subcommand (e.g. `mcp-analytics`). Kept dependency-light so eagerly-loaded
- * surfaces (like the product empty-state gate) can use it without pulling in
- * heavy onboarding components.
+ * The canonical `npx @posthog/wizard` command, with an optional subcommand
+ * (e.g. `mcp-analytics`). The wizard resolves the cloud region from the OAuth
+ * login token, so no `--region` flag is added. Kept dependency-light so
+ * eagerly-loaded surfaces (like the product empty-state gate) can use it
+ * without pulling in heavy onboarding components.
*/
export function useWizardCommand(
subcommand?: string,
{ pinProjectId = false }: UseWizardCommandOptions = {}
): { wizardCommand: string; isCloudOrDev: boolean } {
- const { preflight, isCloudOrDev } = useValues(preflightLogic)
+ const { isCloudOrDev } = useValues(preflightLogic)
const { currentTeam } = useValues(teamLogic)
- const region = preflight?.region || Region.US
const subcommandPart = subcommand ? ` ${subcommand}` : ''
- const regionPart = region === Region.EU ? ' --region eu' : ''
const projectPart = pinProjectId && currentTeam?.id ? ` --project-id=${currentTeam.id}` : ''
return {
- wizardCommand: `${BASE_COMMAND}${subcommandPart}${regionPart}${projectPart}`,
+ wizardCommand: `${BASE_COMMAND}${subcommandPart}${projectPart}`,
isCloudOrDev: isCloudOrDev ?? false,
}
}
diff --git a/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx b/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx
index a522eb5f87c1..7b055bae8f9c 100644
--- a/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx
+++ b/products/data_warehouse/frontend/shared/components/WarehouseWizardHint.tsx
@@ -10,8 +10,6 @@ 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'
@@ -30,7 +28,7 @@ export function WarehouseWizardHint({
* two are mutually exclusive and never stack. */
fallback?: ReactNode
}): JSX.Element | null {
- const { preflight, isCloudOrDev } = useValues(preflightLogic)
+ const { 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
@@ -39,8 +37,7 @@ export function WarehouseWizardHint({
return fallback ? <>{fallback}</> : null
}
- const region = preflight?.region || Region.US
- const command = `npx -y @posthog/wizard@latest warehouse${region === Region.EU ? ' --region eu' : ''}`
+ const command = `npx -y @posthog/wizard@latest warehouse`
const handleDismiss = (): void => {
localStorage.setItem(DISMISSED_KEY, '1')