summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/commands/clearCommand.ts
blob: e5473b5bf2378cc931b90f6e57952abdec12058f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

import { SlashCommand } from './types.js';

export const clearCommand: SlashCommand = {
  name: 'clear',
  description: 'clear the screen and conversation history',
  action: async (context, _args) => {
    context.ui.setDebugMessage('Clearing terminal and resetting chat.');
    await context.services.config?.getGeminiClient()?.resetChat();
    context.ui.clear();
  },
};