opencode go copy

pull/14767/head^2
Dax Raad 2026-02-25 01:54:28 -05:00
parent 3c6c74457d
commit 561f9f5f05
1 changed files with 29 additions and 13 deletions

View File

@ -16,10 +16,11 @@ import { useToast } from "../ui/toast"
const PROVIDER_PRIORITY: Record<string, number> = { const PROVIDER_PRIORITY: Record<string, number> = {
opencode: 0, opencode: 0,
anthropic: 1, openai: 1,
"github-copilot": 2, "github-copilot": 2,
openai: 3, "opencode-go": 3,
google: 4, anthropic: 4,
google: 5,
} }
export function createDialogProviderOptions() { export function createDialogProviderOptions() {
@ -37,6 +38,7 @@ export function createDialogProviderOptions() {
opencode: "(Recommended)", opencode: "(Recommended)",
anthropic: "(Claude Max or API key)", anthropic: "(Claude Max or API key)",
openai: "(ChatGPT Plus/Pro or API key)", openai: "(ChatGPT Plus/Pro or API key)",
"opencode-go": "(Low cost)",
}[provider.id], }[provider.id],
category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other", category: provider.id in PROVIDER_PRIORITY ? "Popular" : "Other",
async onSelect() { async onSelect() {
@ -214,16 +216,30 @@ function ApiMethod(props: ApiMethodProps) {
title={props.title} title={props.title}
placeholder="API key" placeholder="API key"
description={ description={
props.providerID === "opencode" ? ( {
<box gap={1}> opencode: (
<text fg={theme.textMuted}> <box gap={1}>
OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API key. <text fg={theme.textMuted}>
</text> OpenCode Zen gives you access to all the best coding models at the cheapest prices with a single API
<text fg={theme.text}> key.
Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key </text>
</text> <text fg={theme.text}>
</box> Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> to get a key
) : undefined </text>
</box>
),
"opencode-go": (
<box gap={1}>
<text fg={theme.textMuted}>
OpenCode Go is a $10 per month subscription that provides reliable access to popular open coding models
with generous usage limits.
</text>
<text fg={theme.text}>
Go to <span style={{ fg: theme.primary }}>https://opencode.ai/zen</span> and enable OpenCode Go
</text>
</box>
),
}[props.providerID] ?? undefined
} }
onConfirm={async (value) => { onConfirm={async (value) => {
if (!value) return if (!value) return