Skip to content

IHistoryProvider

Provides command history storage for interactive sessions.

public interface IHistoryProvider

Persists one interactive command line.

ValueTask AddAsync(string entry, CancellationToken cancellationToken = default)
  • entry (string): Raw command line as typed by the user.
  • cancellationToken (CancellationToken): Cancellation token.

ValueTask - An awaitable operation.

Reads the most recent history entries.

ValueTask<IReadOnlyList<string>> GetRecentAsync(int maxCount, CancellationToken cancellationToken = default)
  • maxCount (int): Maximum number of entries to return.
  • cancellationToken (CancellationToken): Cancellation token.

ValueTask<IReadOnlyList<string>> - Most recent entries ordered from oldest to newest within the returned window.