Download projects/gemini-cli/packages/cli/src/ui/components/ContextUsageDisplay.tsx from LevelUp2x/adaptai: direct link, hf CLI and curl.
- Browser
- Download file 518 Bytes
-
https://huggingface.co/datasets/LevelUp2x/adaptai/resolve/2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/ui/components/ContextUsageDisplay.tsx
- Command line
-
hf download hf://datasets/LevelUp2x/adaptai@2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/ui/components/ContextUsageDisplay.tsx
-
curl -L -o ContextUsageDisplay.tsx https://huggingface.co/datasets/LevelUp2x/adaptai/resolve/2147bc06c2ccf123b96f98eace2e6bf6486e7f0e/projects/gemini-cli/packages/cli/src/ui/components/ContextUsageDisplay.tsx
518 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { Text } from 'ink'; | |
| import { Colors } from '../colors.js'; | |
| import { tokenLimit } from '@google/gemini-cli-core'; | |
| export const ContextUsageDisplay = ({ | |
| promptTokenCount, | |
| model, | |
| }: { | |
| promptTokenCount: number; | |
| model: string; | |
| }) => { | |
| const percentage = promptTokenCount / tokenLimit(model); | |
| return ( | |
| <Text color={Colors.Gray}> | |
| ({((1 - percentage) * 100).toFixed(0)}% context left) | |
| </Text> | |
| ); | |
| }; | |