summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShreya Keshive <[email protected]>2025-08-19 11:22:21 -0700
committerGitHub <[email protected]>2025-08-19 18:22:21 +0000
commit4828e4daf198a675ce118cec08dcfbd0bfbb28a6 (patch)
tree9a4441cea7a3aab3553175c9a9b310d4d5ffa732
parent9588aa6ef971918b8acfeefdad4f6a33f93349cf (diff)
feat: Add IDE client to /bug & /about if IDE mode is enabled (#6567)
-rw-r--r--packages/cli/src/ui/commands/aboutCommand.test.ts1
-rw-r--r--packages/cli/src/ui/commands/aboutCommand.ts3
-rw-r--r--packages/cli/src/ui/commands/bugCommand.test.ts10
-rw-r--r--packages/cli/src/ui/commands/bugCommand.ts9
4 files changed, 21 insertions, 2 deletions
diff --git a/packages/cli/src/ui/commands/aboutCommand.test.ts b/packages/cli/src/ui/commands/aboutCommand.test.ts
index 34f11e80..9e8be38e 100644
--- a/packages/cli/src/ui/commands/aboutCommand.test.ts
+++ b/packages/cli/src/ui/commands/aboutCommand.test.ts
@@ -28,6 +28,7 @@ describe('aboutCommand', () => {
config: {
getModel: vi.fn(),
getIdeClient: vi.fn(),
+ getIdeMode: vi.fn().mockReturnValue(true),
},
settings: {
merged: {
diff --git a/packages/cli/src/ui/commands/aboutCommand.ts b/packages/cli/src/ui/commands/aboutCommand.ts
index 2512fead..44bf00dd 100644
--- a/packages/cli/src/ui/commands/aboutCommand.ts
+++ b/packages/cli/src/ui/commands/aboutCommand.ts
@@ -29,7 +29,8 @@ export const aboutCommand: SlashCommand = {
context.services.settings.merged.selectedAuthType || '';
const gcpProject = process.env['GOOGLE_CLOUD_PROJECT'] || '';
const ideClient =
- context.services.config?.getIdeClient()?.getDetectedIdeDisplayName() ||
+ (context.services.config?.getIdeMode() &&
+ context.services.config?.getIdeClient()?.getDetectedIdeDisplayName()) ||
'';
const aboutItem: Omit<HistoryItemAbout, 'id'> = {
diff --git a/packages/cli/src/ui/commands/bugCommand.test.ts b/packages/cli/src/ui/commands/bugCommand.test.ts
index 89e3b561..2dfb3fe8 100644
--- a/packages/cli/src/ui/commands/bugCommand.test.ts
+++ b/packages/cli/src/ui/commands/bugCommand.test.ts
@@ -48,6 +48,10 @@ describe('bugCommand', () => {
config: {
getModel: () => 'gemini-pro',
getBugCommand: () => undefined,
+ getIdeClient: () => ({
+ getDetectedIdeDisplayName: () => 'VSCode',
+ }),
+ getIdeMode: () => true,
},
},
});
@@ -63,6 +67,7 @@ describe('bugCommand', () => {
* **Sandbox Environment:** test
* **Model Version:** gemini-pro
* **Memory Usage:** 100 MB
+* **IDE Client:** VSCode
`;
const expectedUrl =
'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title=A%20test%20bug&info=' +
@@ -79,6 +84,10 @@ describe('bugCommand', () => {
config: {
getModel: () => 'gemini-pro',
getBugCommand: () => ({ urlTemplate: customTemplate }),
+ getIdeClient: () => ({
+ getDetectedIdeDisplayName: () => 'VSCode',
+ }),
+ getIdeMode: () => true,
},
},
});
@@ -94,6 +103,7 @@ describe('bugCommand', () => {
* **Sandbox Environment:** test
* **Model Version:** gemini-pro
* **Memory Usage:** 100 MB
+* **IDE Client:** VSCode
`;
const expectedUrl = customTemplate
.replace('{title}', encodeURIComponent('A custom bug'))
diff --git a/packages/cli/src/ui/commands/bugCommand.ts b/packages/cli/src/ui/commands/bugCommand.ts
index 8529e12b..c5f559b6 100644
--- a/packages/cli/src/ui/commands/bugCommand.ts
+++ b/packages/cli/src/ui/commands/bugCommand.ts
@@ -37,8 +37,12 @@ export const bugCommand: SlashCommand = {
const modelVersion = config?.getModel() || 'Unknown';
const cliVersion = await getCliVersion();
const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
+ const ideClient =
+ (context.services.config?.getIdeMode() &&
+ context.services.config?.getIdeClient()?.getDetectedIdeDisplayName()) ||
+ '';
- const info = `
+ let info = `
* **CLI Version:** ${cliVersion}
* **Git Commit:** ${GIT_COMMIT_INFO}
* **Session ID:** ${sessionId}
@@ -47,6 +51,9 @@ export const bugCommand: SlashCommand = {
* **Model Version:** ${modelVersion}
* **Memory Usage:** ${memoryUsage}
`;
+ if (ideClient) {
+ info += `* **IDE Client:** ${ideClient}\n`;
+ }
let bugReportUrl =
'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title={title}&info={info}';