MCPcopy
hub / github.com/di-sukharev/opencommit / selectProvider

Function selectProvider

src/commands/setup.ts:69–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67];
68
69async function selectProvider(): Promise<string | symbol> {
70 const primaryOptions = PRIMARY_PROVIDERS.map((provider) => ({
71 value: provider,
72 label: PROVIDER_DISPLAY_NAMES[provider] || provider
73 }));
74
75 primaryOptions.push({
76 value: 'other',
77 label: 'Other providers...'
78 });
79
80 const selection = await select({
81 message: 'Select your AI provider:',
82 options: primaryOptions
83 });
84
85 if (isCancel(selection)) return selection;
86
87 if (selection === 'other') {
88 const otherOptions = OTHER_PROVIDERS.map((provider) => ({
89 value: provider,
90 label: PROVIDER_DISPLAY_NAMES[provider] || provider
91 }));
92
93 return await select({
94 message: 'Select provider:',
95 options: otherOptions
96 });
97 }
98
99 return selection;
100}
101
102async function getApiKey(provider: string): Promise<string | symbol> {
103 const url =

Callers 1

runSetupFunction · 0.70

Calls 2

isCancelFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…