mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-10 06:20:13 +00:00
fix(api): skip API key prompt for local Ollama using noApiKey flag
Local Ollama doesn't require an API key, but the CLI was still prompting for one. This adds a `noApiKey` flag to provider presets to mark providers that don't need authentication. - Add `noApiKey?: boolean` property to ProviderPreset interface - Set `noApiKey: true` for local Ollama (no key needed) - All other presets unchanged (default to requiring API key) - Skip API key prompt and show info message when noApiKey is true Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -181,11 +181,10 @@ async function handleCreate(args: string[]): Promise<void> {
|
||||
console.log(dim('Note: For OpenRouter, ANTHROPIC_API_KEY should be empty.'));
|
||||
}
|
||||
|
||||
// Step 3: API Key (skip if preset doesn't require one)
|
||||
// Step 3: API Key (skip if preset has noApiKey flag)
|
||||
let apiKey = parsedArgs.apiKey;
|
||||
const requiresApiKey = preset?.requiresApiKey !== false;
|
||||
|
||||
if (!requiresApiKey) {
|
||||
if (preset?.noApiKey) {
|
||||
// Preset doesn't require API key (e.g., local Ollama)
|
||||
console.log(info('No API key required for local Ollama'));
|
||||
apiKey = ''; // Empty string for local providers
|
||||
|
||||
Reference in New Issue
Block a user