import React from 'react'; import { isDesktopShell, requestFileAccess, startDesktopWindowDrag } from '@/lib/desktop'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; import { Icon } from "@/components/icon/Icon"; import { updateDesktopSettings } from '@/lib/persistence'; import { copyTextToClipboard } from '@/lib/clipboard'; import { restartDesktopApp } from '@/lib/desktop'; import { useI18n } from '@/lib/i18n'; import { runtimeFetch } from '@/lib/runtime-fetch'; const INSTALL_COMMAND = 'curl -fsSL https://opencode.ai/install | bash'; const DOCS_URL = 'https://opencode.ai/docs'; type OnboardingPlatform = 'macos' | 'linux' | 'windows' | 'unknown'; type LocalSetupScreenProps = { /** Callback when user goes back */ onBack: () => void; /** Callback when CLI becomes available */ onCliAvailable?: () => void; /** Whether this screen was entered from recovery flow (shows "Connect to Remote" link) */ isFromRecovery?: boolean; /** Callback when user wants to switch to remote */ onSwitchToRemote?: () => void; }; function BashCommand({ onCopy, copyTitle }: { onCopy: () => void; copyTitle: string }) { return (
curl
-fsSL
https://opencode.ai/install
|
bash
{t('onboarding.localSetup.description')}
{t('onboarding.localSetup.helper.checkAndContinue')}
{t('onboarding.localSetup.remotePreference')}
{t('onboarding.localSetup.windows.hintDetectionFailed')}
> ) : ( <>{t('onboarding.localSetup.hint.ensurePath')}
{t('onboarding.localSetup.hint.setEnv')}
{t('onboarding.localSetup.hint.missingRuntime')}
> )}