summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/hooks')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts12
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts4
2 files changed, 7 insertions, 9 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 5e10a245..33b59b68 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -29,6 +29,7 @@ const addHistoryItem = (
export const useSlashCommandProcessor = (
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
refreshStatic: () => void,
+ setShowHelp: React.Dispatch<React.SetStateAction<boolean>>,
setDebugMessage: React.Dispatch<React.SetStateAction<string>>,
getNextMessageId: (baseTimestamp: number) => number,
openThemeDialog: () => void,
@@ -38,15 +39,8 @@ export const useSlashCommandProcessor = (
name: 'help',
description: 'for help on gemini-code',
action: (_value: PartListUnion) => {
- const helpText =
- 'I am an interactive CLI tool assistant designed to ' +
- 'help with software engineering tasks. I can use tools to read ' +
- 'and write files, search code, execute bash commands, and more ' +
- 'to assist with development workflows. I will explain commands ' +
- 'and ask for permission before running them and will not ' +
- 'commit changes unless explicitly instructed.';
- const timestamp = getNextMessageId(Date.now());
- addHistoryItem(setHistory, { type: 'info', text: helpText }, timestamp);
+ setDebugMessage('Opening help.');
+ setShowHelp(true);
},
},
{
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 2931bbc3..1761563b 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -48,6 +48,7 @@ const addHistoryItem = (
export const useGeminiStream = (
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
refreshStatic: () => void,
+ setShowHelp: React.Dispatch<React.SetStateAction<boolean>>,
config: Config,
openThemeDialog: () => void,
) => {
@@ -74,6 +75,7 @@ export const useGeminiStream = (
const { handleSlashCommand, slashCommands } = useSlashCommandProcessor(
setHistory,
refreshStatic,
+ setShowHelp,
setDebugMessage,
getNextMessageId,
openThemeDialog,
@@ -154,6 +156,8 @@ export const useGeminiStream = (
messageIdCounterRef.current = 0; // Reset counter for this new submission
let queryToSendToGemini: PartListUnion | null = null;
+ setShowHelp(false);
+
if (typeof query === 'string') {
const trimmedQuery = query.trim();
setDebugMessage(`User query: '${trimmedQuery}'`);