summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.ts
diff options
context:
space:
mode:
authorHarold Mciver <[email protected]>2025-07-16 21:46:35 -0400
committerGitHub <[email protected]>2025-07-17 01:46:35 +0000
commit01e66bb12392c3e8cd0222dc495c8dc61ebe4fba (patch)
tree68c73d9e67ecb782b8903b34dab18c1173438aee /packages/cli/src/ui/hooks/slashCommandProcessor.ts
parent0c76affe6dee2577aa072ee690f38906eecdf2d1 (diff)
update `/bug` to new slash command arch (#4246)
Co-authored-by: Abhi <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Abhi <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts68
1 files changed, 1 insertions, 67 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 237356fa..35371265 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -6,7 +6,6 @@
import { useCallback, useMemo, useEffect, useState } from 'react';
import { type PartListUnion } from '@google/genai';
-import open from 'open';
import process from 'node:process';
import { UseHistoryManagerReturn } from './useHistoryManager.js';
import { useStateAndRef } from './useStateAndRef.js';
@@ -21,9 +20,7 @@ import {
} from '../types.js';
import { promises as fs } from 'fs';
import path from 'path';
-import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
-import { formatDuration, formatMemoryUsage } from '../utils/formatters.js';
-import { getCliVersion } from '../../utils/version.js';
+import { formatDuration } from '../utils/formatters.js';
import { LoadedSettings } from '../../config/settings.js';
import {
type CommandContext,
@@ -206,69 +203,6 @@ export const useSlashCommandProcessor = (
},
},
{
- name: 'bug',
- description: 'submit a bug report',
- action: async (_mainCommand, _subCommand, args) => {
- let bugDescription = _subCommand || '';
- if (args) {
- bugDescription += ` ${args}`;
- }
- bugDescription = bugDescription.trim();
-
- const osVersion = `${process.platform} ${process.version}`;
- let sandboxEnv = 'no sandbox';
- if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
- sandboxEnv = process.env.SANDBOX.replace(/^gemini-(?:code-)?/, '');
- } else if (process.env.SANDBOX === 'sandbox-exec') {
- sandboxEnv = `sandbox-exec (${
- process.env.SEATBELT_PROFILE || 'unknown'
- })`;
- }
- const modelVersion = config?.getModel() || 'Unknown';
- const cliVersion = await getCliVersion();
- const memoryUsage = formatMemoryUsage(process.memoryUsage().rss);
-
- const info = `
-* **CLI Version:** ${cliVersion}
-* **Git Commit:** ${GIT_COMMIT_INFO}
-* **Operating System:** ${osVersion}
-* **Sandbox Environment:** ${sandboxEnv}
-* **Model Version:** ${modelVersion}
-* **Memory Usage:** ${memoryUsage}
-`;
-
- let bugReportUrl =
- 'https://github.com/google-gemini/gemini-cli/issues/new?template=bug_report.yml&title={title}&info={info}';
- const bugCommand = config?.getBugCommand();
- if (bugCommand?.urlTemplate) {
- bugReportUrl = bugCommand.urlTemplate;
- }
- bugReportUrl = bugReportUrl
- .replace('{title}', encodeURIComponent(bugDescription))
- .replace('{info}', encodeURIComponent(info));
-
- addMessage({
- type: MessageType.INFO,
- content: `To submit your bug report, please open the following URL in your browser:\n${bugReportUrl}`,
- timestamp: new Date(),
- });
- (async () => {
- try {
- await open(bugReportUrl);
- } catch (error) {
- const errorMessage =
- error instanceof Error ? error.message : String(error);
- addMessage({
- type: MessageType.ERROR,
- content: `Could not open URL in browser: ${errorMessage}`,
- timestamp: new Date(),
- });
- }
- })();
- },
- },
-
- {
name: 'quit',
altName: 'exit',
description: 'exit the cli',