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.ts27
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts2
2 files changed, 19 insertions, 10 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index f7f93b9d..89649810 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -30,18 +30,10 @@ export const useSlashCommandProcessor = (
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
setDebugMessage: React.Dispatch<React.SetStateAction<string>>,
getNextMessageId: (baseTimestamp: number) => number,
+ openThemeDialog: () => void,
) => {
const slashCommands: SlashCommand[] = [
{
- name: 'clear',
- description: 'clear the screen',
- action: (_value: PartListUnion) => {
- // This just clears the *UI* history, not the model history.
- setDebugMessage('Clearing terminal.');
- setHistory((_) => []);
- },
- },
- {
name: 'help',
description: 'for help on gemini-code',
action: (_value: PartListUnion) => {
@@ -57,6 +49,22 @@ export const useSlashCommandProcessor = (
},
},
{
+ name: 'clear',
+ description: 'clear the screen',
+ action: (_value: PartListUnion) => {
+ // This just clears the *UI* history, not the model history.
+ setDebugMessage('Clearing terminal.');
+ setHistory((_) => []);
+ },
+ },
+ {
+ name: 'theme',
+ description: 'change the theme',
+ action: (_value: PartListUnion) => {
+ openThemeDialog();
+ },
+ },
+ {
name: 'exit',
description: '',
action: (_value: PartListUnion) => {
@@ -85,7 +93,6 @@ export const useSlashCommandProcessor = (
process.exit(0);
},
},
- // Removed /theme command, handled in App.tsx
];
// Checks if the query is a slash command and executes the command if it is.
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index 89cd5223..9e2901ec 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -49,6 +49,7 @@ const addHistoryItem = (
export const useGeminiStream = (
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
config: Config,
+ openThemeDialog: () => void,
) => {
const toolRegistry = config.getToolRegistry();
const [streamingState, setStreamingState] = useState<StreamingState>(
@@ -74,6 +75,7 @@ export const useGeminiStream = (
setHistory,
setDebugMessage,
getNextMessageId,
+ openThemeDialog,
);
const { handleShellCommand } = useShellCommandProcessor(