summaryrefslogtreecommitdiff
path: root/packages/cli/src
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-05-24 12:06:44 -0700
committerN. Taylor Mullen <[email protected]>2025-05-24 12:40:06 -0700
commite297b56390e81dcad4c87154ea50c2a995e633c3 (patch)
tree90b8b7c6442f26389e5eecd5928712e60f785137 /packages/cli/src
parentb4c16d1f56f4e19fffd3d7608b410570f35045f9 (diff)
feat: Add GEMINI.md tip to UI
- Display a tip to create a GEMINI.md file if one doesn't exist. - Pass config to Tips component so it can inspect the initial GEMINI.md count.
Diffstat (limited to 'packages/cli/src')
-rw-r--r--packages/cli/src/ui/App.tsx2
-rw-r--r--packages/cli/src/ui/components/Tips.tsx51
2 files changed, 36 insertions, 17 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 5860e36e..727450c0 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -296,7 +296,7 @@ export const App = ({
items={[
<Box flexDirection="column" key="header">
<Header />
- <Tips />
+ <Tips config={config} />
</Box>,
...history.map((h) => (
<HistoryItemDisplay
diff --git a/packages/cli/src/ui/components/Tips.tsx b/packages/cli/src/ui/components/Tips.tsx
index 581ba128..b0207246 100644
--- a/packages/cli/src/ui/components/Tips.tsx
+++ b/packages/cli/src/ui/components/Tips.tsx
@@ -7,20 +7,39 @@
import React from 'react';
import { Box, Text } from 'ink';
import { Colors } from '../colors.js';
+import { type Config } from '@gemini-code/server';
-export const Tips: React.FC = () => (
- <Box flexDirection="column" marginBottom={1}>
- <Text color={Colors.Foreground}>Tips for getting started:</Text>
- <Text color={Colors.Foreground}>
- 1.{' '}
- <Text bold color={Colors.AccentPurple}>
- /help
- </Text>{' '}
- for more information.
- </Text>
- <Text color={Colors.Foreground}>
- 2. Ask coding questions, edit code or run commands.
- </Text>
- <Text color={Colors.Foreground}>3. Be specific for the best results.</Text>
- </Box>
-);
+interface TipsProps {
+ config: Config;
+}
+
+export const Tips: React.FC<TipsProps> = ({ config }) => {
+ const geminiMdFileCount = config.getGeminiMdFileCount();
+ return (
+ <Box flexDirection="column" marginBottom={1}>
+ <Text color={Colors.Foreground}>Tips for getting started:</Text>
+ <Text color={Colors.Foreground}>
+ 1.{' '}
+ <Text bold color={Colors.AccentPurple}>
+ /help
+ </Text>{' '}
+ for more information.
+ </Text>
+ <Text color={Colors.Foreground}>
+ 2. Ask coding questions, edit code or run commands.
+ </Text>
+ <Text color={Colors.Foreground}>
+ 3. Be specific for the best results.
+ </Text>
+ {geminiMdFileCount === 0 && (
+ <Text color={Colors.Foreground}>
+ 4. Create{' '}
+ <Text bold color={Colors.AccentPurple}>
+ GEMINI.md
+ </Text>{' '}
+ files to customize your interactions with Gemini.
+ </Text>
+ )}
+ </Box>
+ );
+};