mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-07 03:40:36 -07:00
feat(cli): Add /model command for interactive model selection (#8940)
Co-authored-by: Miguel Solorio <miguel.solorio07@gmail.com>
This commit is contained in:
31
packages/cli/src/ui/hooks/useModelCommand.ts
Normal file
31
packages/cli/src/ui/hooks/useModelCommand.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { useState, useCallback } from 'react';
|
||||
|
||||
interface UseModelCommandReturn {
|
||||
isModelDialogOpen: boolean;
|
||||
openModelDialog: () => void;
|
||||
closeModelDialog: () => void;
|
||||
}
|
||||
|
||||
export const useModelCommand = (): UseModelCommandReturn => {
|
||||
const [isModelDialogOpen, setIsModelDialogOpen] = useState(false);
|
||||
|
||||
const openModelDialog = useCallback(() => {
|
||||
setIsModelDialogOpen(true);
|
||||
}, []);
|
||||
|
||||
const closeModelDialog = useCallback(() => {
|
||||
setIsModelDialogOpen(false);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
isModelDialogOpen,
|
||||
openModelDialog,
|
||||
closeModelDialog,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user