noz-cli/NozCli/Commands/SyncCommand.cs
2026-05-16 19:25:39 +02:00

24 lines
696 B
C#

using NozCli.Repl;
using Spectre.Console;
namespace NozCli.Commands;
/// sync = push + rebuild index
public class SyncCommand : ICommand
{
public string Name => "sync";
public string Description => "Push notes and rebuild the server index";
public string Usage => "sync <local-path>";
private readonly PushCommand _push = new();
public async Task ExecuteAsync(string[] args, ReplContext ctx)
{
await _push.ExecuteAsync(args, ctx);
await AnsiConsole.Status().StartAsync("Triggering index rebuild…", async _ =>
await ctx.Api.RebuildIndexAsync());
AnsiConsole.MarkupLine("[green]✓ Index rebuild queued[/]");
}
}