feat: implement OpenCode authentication and provider setup

- Added OpenCode authentication status check to the OpencodeProvider class.
- Introduced OpenCodeAuthStatus interface to manage authentication states.
- Updated detectInstallation method to include authentication status in the response.
- Created ProvidersSetupStep component to consolidate provider setup UI, including Claude, Cursor, Codex, and OpenCode.
- Refactored setup view to streamline navigation and improve user experience.
- Enhanced OpenCode CLI integration with updated installation paths and authentication checks.

This commit enhances the setup process by allowing users to configure and authenticate multiple AI providers, improving overall functionality and user experience.
This commit is contained in:
webdevcody
2026-01-09 09:39:46 -05:00
parent 41b4869068
commit 89248001e4
9 changed files with 1485 additions and 105 deletions

View File

@@ -38,6 +38,11 @@ interface ClaudeSetupStepProps {
onSkip: () => void;
}
interface ClaudeSetupContentProps {
/** Hide header and navigation for embedded use */
embedded?: boolean;
}
type VerificationStatus = 'idle' | 'verifying' | 'verified' | 'error';
// Claude Setup Step

View File

@@ -2,8 +2,11 @@
export { WelcomeStep } from './welcome-step';
export { ThemeStep } from './theme-step';
export { CompleteStep } from './complete-step';
export { ProvidersSetupStep } from './providers-setup-step';
export { GitHubSetupStep } from './github-setup-step';
// Legacy individual step exports (kept for backwards compatibility)
export { ClaudeSetupStep } from './claude-setup-step';
export { CursorSetupStep } from './cursor-setup-step';
export { CodexSetupStep } from './codex-setup-step';
export { OpencodeSetupStep } from './opencode-setup-step';
export { GitHubSetupStep } from './github-setup-step';

View File

@@ -96,7 +96,7 @@ export function OpencodeSetupStep({ onNext, onBack, onSkip }: OpencodeSetupStepP
try {
// Copy login command to clipboard and show instructions
const loginCommand = opencodeCliStatus?.loginCommand || 'opencode login';
const loginCommand = opencodeCliStatus?.loginCommand || 'opencode auth login';
await navigator.clipboard.writeText(loginCommand);
toast.info('Login command copied! Paste in terminal to authenticate.');
@@ -297,13 +297,13 @@ export function OpencodeSetupStep({ onNext, onBack, onSkip }: OpencodeSetupStepP
</p>
<div className="flex items-center gap-2">
<code className="flex-1 bg-muted px-3 py-2 rounded text-sm font-mono text-foreground">
{opencodeCliStatus?.loginCommand || 'opencode login'}
{opencodeCliStatus?.loginCommand || 'opencode auth login'}
</code>
<Button
variant="ghost"
size="icon"
onClick={() =>
copyCommand(opencodeCliStatus?.loginCommand || 'opencode login')
copyCommand(opencodeCliStatus?.loginCommand || 'opencode auth login')
}
>
<Copy className="w-4 h-4" />

File diff suppressed because it is too large Load Diff