Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const geminiSchema = apiModelIdProviderModelSchema.extend({

const geminiCliSchema = apiModelIdProviderModelSchema.extend({
geminiCliOAuthPath: z.string().optional(),
geminiCliDefaultProject: z.string().optional(),
geminiCliProjectId: z.string().optional(),
})

Expand Down
2 changes: 1 addition & 1 deletion src/api/providers/gemini-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export class GeminiCliHandler extends BaseProvider implements SingleCompletionHa
}

// Start with a default project ID (can be anything for personal OAuth)
const initialProjectId = "default"
const initialProjectId = this.options.geminiCliDefaultProject

// Prepare client metadata
const clientMetadata = {
Expand Down
12 changes: 12 additions & 0 deletions webview-ui/src/components/settings/providers/GeminiCli.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export const GeminiCli = ({ apiConfiguration, setApiConfigurationField }: Gemini
{t("settings:providers.geminiCli.oauthPathDescription")}
</div>

<VSCodeTextField
value={apiConfiguration?.geminiCliDefaultProject || ""}
onInput={handleInputChange("geminiCliDefaultProject")}
placeholder="default"
className="w-full">
<label className="block font-medium mb-1">{t("settings:providers.geminiCli.defaultProject")}</label>
</VSCodeTextField>

<div className="text-sm text-vscode-descriptionForeground -mt-2">
{t("settings:providers.geminiCli.defaultProjectDescription")}
</div>

<div className="text-sm text-vscode-descriptionForeground mt-3">
{t("settings:providers.geminiCli.description")}
</div>
Expand Down
2 changes: 2 additions & 0 deletions webview-ui/src/i18n/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@
},
"geminiCli": {
"description": "This provider uses OAuth authentication from the Gemini CLI tool and does not require API keys.",
"defaultProject": "Default Project (optional)",
"defaultProjectDescription": "Default Google Cloud Project Name (For paid Gemini Code Assist tiers, see https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/authentication.md)",
"oauthPath": "OAuth Credentials Path (optional)",
"oauthPathDescription": "Path to the OAuth credentials file. Leave empty to use the default location (~/.gemini/oauth_creds.json).",
"instructions": "If you haven't authenticated yet, please run",
Expand Down
Loading