summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/Intro.tsx
blob: d99e59937427d11662cb0212b8d1aaa2e0f860d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

import React from 'react';
import { Box, Newline, Text } from 'ink';
import { Colors } from '../colors.js';
import { SlashCommand } from '../hooks/slashCommandProcessor.js';

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 explain code
    </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>
);