Add Intro text with list of /commands

This commit is contained in:
Seth Troisi
2025-04-29 23:38:26 +00:00
parent bf659f1977
commit fb23321514
4 changed files with 46 additions and 28 deletions

View File

@@ -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 bold color={Colors.Foreground}>
Abilities:
</Text>
<Text color={Colors.SubtleComment}>
<Text bold color={Colors.AccentPurple}> /clear</Text>
{' '}- clear the screen
<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}> /exit</Text>
</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>
);