diff options
| author | Seth Troisi <[email protected]> | 2025-04-29 23:38:26 +0000 |
|---|---|---|
| committer | Seth Troisi <[email protected]> | 2025-04-29 17:20:38 -0700 |
| commit | fb23321514dbc8d1c0243457e8d5d8d953bb3985 (patch) | |
| tree | 1600685a1ab5aad8361701122d9212e91131fb60 /packages/cli/src/ui/components/Intro.tsx | |
| parent | bf659f19776ddc4eb9825bd5376c66288aed06c8 (diff) | |
Add Intro text with list of /commands
Diffstat (limited to 'packages/cli/src/ui/components/Intro.tsx')
| -rw-r--r-- | packages/cli/src/ui/components/Intro.tsx | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/packages/cli/src/ui/components/Intro.tsx b/packages/cli/src/ui/components/Intro.tsx index 04dac134..d99e5993 100644 --- a/packages/cli/src/ui/components/Intro.tsx +++ b/packages/cli/src/ui/components/Intro.tsx @@ -7,28 +7,35 @@ import React from 'react'; import { Box, Newline, Text } from 'ink'; import { Colors } from '../colors.js'; +import { SlashCommand } from '../hooks/slashCommandProcessor.js'; -export const Intro: React.FC = () => ( +interface Intro { + commands: SlashCommand[]; +} + +export const Intro: React.FC<Intro> = ({ commands }) => ( <Box flexDirection="column" marginBottom={1}> - <Text bold color={Colors.Foreground}>Abilities:</Text> - <Text color={Colors.Foreground}> * Use tools to read and write files</Text> - <Text color={Colors.Foreground}> * Semantically search and understand code</Text> - <Text color={Colors.Foreground}> * Execute bash commands</Text> - <Newline/> - <Text bold color={Colors.Foreground}>Commands:</Text> - <Text color={Colors.SubtleComment}> - <Text bold color={Colors.AccentPurple}> /help</Text> - {' '}- prints this help - </Text> - <Text color={Colors.SubtleComment}> - <Text bold color={Colors.AccentPurple}> /clear</Text> - {' '}- clear the screen + <Text bold color={Colors.Foreground}> + Abilities: </Text> - <Text color={Colors.SubtleComment}> - <Text bold color={Colors.AccentPurple}> /exit</Text> + <Text color={Colors.Foreground}> * Use tools to read and write files</Text> + <Text color={Colors.Foreground}> + {' '} + * Semantically search and explain code </Text> - <Text color={Colors.SubtleComment}> - <Text bold color={Colors.AccentPurple}> /quit</Text> + <Text color={Colors.Foreground}> * Execute bash commands</Text> + <Newline /> + <Text bold color={Colors.Foreground}> + Commands: </Text> + {commands.map((command: SlashCommand) => ( + <Text key={command.name} color={Colors.SubtleComment}> + <Text bold color={Colors.AccentPurple}> + {' '} + /{command.name} + </Text> + {command.description && ' - ' + command.description} + </Text> + ))} </Box> ); |
