2025-05-23 10:34:15 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2025-08-26 00:04:53 +02:00
|
|
|
import type React from 'react';
|
2025-05-23 10:34:15 -07:00
|
|
|
import { Box, Text } from 'ink';
|
2025-09-10 10:57:07 -07:00
|
|
|
import { theme } from '../semantic-colors.js';
|
2025-05-28 00:04:26 -07:00
|
|
|
import { GIT_COMMIT_INFO } from '../../generated/git-commit.js';
|
2026-01-28 16:26:33 -05:00
|
|
|
import { useSettings } from '../contexts/SettingsContext.js';
|
2025-05-23 10:34:15 -07:00
|
|
|
|
|
|
|
|
interface AboutBoxProps {
|
|
|
|
|
cliVersion: string;
|
|
|
|
|
osVersion: string;
|
|
|
|
|
sandboxEnv: string;
|
|
|
|
|
modelVersion: string;
|
2025-06-27 08:46:27 -07:00
|
|
|
selectedAuthType: string;
|
|
|
|
|
gcpProject: string;
|
2025-08-15 12:32:15 -04:00
|
|
|
ideClient: string;
|
2025-11-19 19:46:21 -08:00
|
|
|
userEmail?: string;
|
2026-01-23 16:03:53 -05:00
|
|
|
tier?: string;
|
2025-05-23 10:34:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const AboutBox: React.FC<AboutBoxProps> = ({
|
|
|
|
|
cliVersion,
|
|
|
|
|
osVersion,
|
|
|
|
|
sandboxEnv,
|
|
|
|
|
modelVersion,
|
2025-06-27 08:46:27 -07:00
|
|
|
selectedAuthType,
|
|
|
|
|
gcpProject,
|
2025-08-15 12:32:15 -04:00
|
|
|
ideClient,
|
2025-11-19 19:46:21 -08:00
|
|
|
userEmail,
|
2026-01-23 16:03:53 -05:00
|
|
|
tier,
|
2026-01-28 16:26:33 -05:00
|
|
|
}) => {
|
|
|
|
|
const settings = useSettings();
|
|
|
|
|
const showUserIdentity = settings.merged.ui.showUserIdentity;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box
|
|
|
|
|
borderStyle="round"
|
|
|
|
|
borderColor={theme.border.default}
|
|
|
|
|
flexDirection="column"
|
|
|
|
|
padding={1}
|
|
|
|
|
marginY={1}
|
|
|
|
|
width="100%"
|
|
|
|
|
>
|
|
|
|
|
<Box marginBottom={1}>
|
|
|
|
|
<Text bold color={theme.text.accent}>
|
|
|
|
|
About Gemini CLI
|
2025-05-23 14:54:54 -07:00
|
|
|
</Text>
|
2025-05-23 10:34:15 -07:00
|
|
|
</Box>
|
2025-05-28 00:04:26 -07:00
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
2025-09-10 10:57:07 -07:00
|
|
|
<Text bold color={theme.text.link}>
|
2026-01-28 16:26:33 -05:00
|
|
|
CLI Version
|
2025-05-28 00:04:26 -07:00
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
2026-01-28 16:26:33 -05:00
|
|
|
<Text color={theme.text.primary}>{cliVersion}</Text>
|
2025-05-28 00:04:26 -07:00
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2026-01-28 16:26:33 -05:00
|
|
|
{GIT_COMMIT_INFO && !['N/A'].includes(GIT_COMMIT_INFO) && (
|
|
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
|
|
|
|
<Text bold color={theme.text.link}>
|
|
|
|
|
Git Commit
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
|
|
|
|
<Text color={theme.text.primary}>{GIT_COMMIT_INFO}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
2025-11-19 19:46:21 -08:00
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
|
|
|
|
<Text bold color={theme.text.link}>
|
2026-01-28 16:26:33 -05:00
|
|
|
Model
|
2025-11-19 19:46:21 -08:00
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
2026-01-28 16:26:33 -05:00
|
|
|
<Text color={theme.text.primary}>{modelVersion}</Text>
|
2025-11-19 19:46:21 -08:00
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2025-06-27 08:46:27 -07:00
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
2025-09-10 10:57:07 -07:00
|
|
|
<Text bold color={theme.text.link}>
|
2026-01-28 16:26:33 -05:00
|
|
|
Sandbox
|
2025-06-27 08:46:27 -07:00
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
2026-01-28 16:26:33 -05:00
|
|
|
<Text color={theme.text.primary}>{sandboxEnv}</Text>
|
2025-06-27 08:46:27 -07:00
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2025-08-15 12:32:15 -04:00
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
2025-09-10 10:57:07 -07:00
|
|
|
<Text bold color={theme.text.link}>
|
2026-01-28 16:26:33 -05:00
|
|
|
OS
|
2025-08-15 12:32:15 -04:00
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
2026-01-28 16:26:33 -05:00
|
|
|
<Text color={theme.text.primary}>{osVersion}</Text>
|
2025-08-15 12:32:15 -04:00
|
|
|
</Box>
|
|
|
|
|
</Box>
|
2026-01-28 16:26:33 -05:00
|
|
|
{showUserIdentity && (
|
|
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
|
|
|
|
<Text bold color={theme.text.link}>
|
|
|
|
|
Auth Method
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
|
|
|
|
<Text color={theme.text.primary}>
|
|
|
|
|
{selectedAuthType.startsWith('oauth')
|
|
|
|
|
? userEmail
|
|
|
|
|
? `Logged in with Google (${userEmail})`
|
|
|
|
|
: 'Logged in with Google'
|
|
|
|
|
: selectedAuthType}
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
|
|
|
|
{showUserIdentity && tier && (
|
|
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
|
|
|
|
<Text bold color={theme.text.link}>
|
|
|
|
|
Tier
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
|
|
|
|
<Text color={theme.text.primary}>{tier}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
|
|
|
|
{gcpProject && (
|
|
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
|
|
|
|
<Text bold color={theme.text.link}>
|
|
|
|
|
GCP Project
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
|
|
|
|
<Text color={theme.text.primary}>{gcpProject}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
|
|
|
|
{ideClient && (
|
|
|
|
|
<Box flexDirection="row">
|
|
|
|
|
<Box width="35%">
|
|
|
|
|
<Text bold color={theme.text.link}>
|
|
|
|
|
IDE Client
|
|
|
|
|
</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box>
|
|
|
|
|
<Text color={theme.text.primary}>{ideClient}</Text>
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
)}
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|