/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; import { SlashCommand } from '../commands/types.js'; interface Help { commands: readonly SlashCommand[]; } export const Help: React.FC = ({ commands }) => ( {/* Basics */} Basics: Add context : Use{' '} @ {' '} to specify files for context (e.g.,{' '} @src/myFile.ts ) to target specific files or folders. Shell mode : Execute shell commands via{' '} ! {' '} (e.g.,{' '} !npm run start ) or use natural language (e.g.{' '} start server ). {/* Commands */} Commands: {commands .filter((command) => command.description) .map((command: SlashCommand) => ( {' '} /{command.name} {command.description && ' - ' + command.description} {command.subCommands && command.subCommands.map((subCommand) => ( {' '} {subCommand.name} {subCommand.description && ' - ' + subCommand.description} ))} ))} {' '} !{' '} - shell command {/* Shortcuts */} Keyboard Shortcuts: Alt+Left/Right {' '} - Jump through words in the input Ctrl+C {' '} - Quit application {process.platform === 'win32' ? 'Ctrl+Enter' : 'Ctrl+J'} {' '} {process.platform === 'linux' ? '- New line (Alt+Enter works for certain linux distros)' : '- New line'} Ctrl+L {' '} - Clear the screen {process.platform === 'darwin' ? 'Ctrl+X / Meta+Enter' : 'Ctrl+X'} {' '} - Open input in external editor Ctrl+Y {' '} - Toggle YOLO mode Enter {' '} - Send message Esc {' '} - Cancel operation Shift+Tab {' '} - Toggle auto-accepting edits Up/Down {' '} - Cycle through your prompt history For a full list of shortcuts, see{' '} docs/keyboard-shortcuts.md );