Download packages/cli/src/ui/contexts/AppContext.tsx from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 551 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/contexts/AppContext.tsx
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/contexts/AppContext.tsx
-
curl -L -o AppContext.tsx https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/contexts/AppContext.tsx
551 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { createContext, useContext } from 'react'; | |
| import type { StartupWarning } from '@google/gemini-cli-core'; | |
| export interface AppState { | |
| version: string; | |
| startupWarnings: StartupWarning[]; | |
| } | |
| export const AppContext = createContext<AppState | null>(null); | |
| export const useAppContext = () => { | |
| const context = useContext(AppContext); | |
| if (!context) { | |
| throw new Error('useAppContext must be used within an AppProvider'); | |
| } | |
| return context; | |
| }; | |