MCPcopy Index your code
hub / github.com/anomalyco/opencode / promptProvider

Function promptProvider

packages/opencode/src/cli/cmd/github.handler.ts:227–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

225 }
226
227 async function promptProvider() {
228 const priority: Record<string, number> = {
229 opencode: 0,
230 anthropic: 1,
231 openai: 2,
232 google: 3,
233 }
234 let provider = await prompts.select({
235 message: "Select provider",
236 maxItems: 8,
237 options: pipe(
238 providers,
239 values(),
240 sortBy(
241 (x) => priority[x.id] ?? 99,
242 (x) => x.name ?? x.id,
243 ),
244 map((x) => ({
245 label: x.name,
246 value: x.id,
247 hint: priority[x.id] === 0 ? "recommended" : undefined,
248 })),
249 ),
250 })
251
252 if (prompts.isCancel(provider)) throw new UI.CancelledError()
253
254 return provider
255 }
256
257 async function promptModel() {
258 const providerData = providers[provider]!

Callers 1

github.handler.tsFile · 0.85

Calls 4

pipeFunction · 0.85
valuesFunction · 0.50
mapFunction · 0.50
selectMethod · 0.45

Tested by

no test coverage detected