1
0

feat: Introduce a /reset command to clear the chat session and token tracking, and update documentation.

This commit is contained in:
2026-03-04 22:24:05 +01:00
parent d7a94436d1
commit ed897aeb01
9 changed files with 777 additions and 387 deletions

21
Commands/ResetCommand.cs Normal file
View File

@@ -0,0 +1,21 @@
using Microsoft.Extensions.AI;
using Spectre.Console;
using AnchorCli.OpenRouter;
namespace AnchorCli.Commands;
internal class ResetCommand(ChatSession session, TokenTracker tokenTracker) : ICommand
{
public string Name => "reset";
public string Description => "Reset the chat session (clear history and token count)";
public Task ExecuteAsync(string[] args, CancellationToken ct)
{
session.Reset();
tokenTracker.Reset();
AnsiConsole.MarkupLine("[green]Chat session reset.[/]");
return Task.CompletedTask;
}
}