commandhistory

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package commandhistory provides command history management

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryEntry

type HistoryEntry struct {
	ID        string
	Command   string
	Args      []string
	Output    string
	ExitCode  int
	Duration  time.Duration
	Timestamp time.Time
	User      string
	Tags      []string
}

HistoryEntry represents a command history entry

type HistoryManager

type HistoryManager struct {
	// contains filtered or unexported fields
}

HistoryManager manages command history

func NewHistoryManager

func NewHistoryManager(maxSize int) *HistoryManager

NewHistoryManager creates a new history manager

func (*HistoryManager) AddEntry

func (hm *HistoryManager) AddEntry(entry HistoryEntry)

AddEntry adds a command to history

func (*HistoryManager) GetByTag

func (hm *HistoryManager) GetByTag(tag string) []HistoryEntry

GetByTag returns entries with a specific tag

func (*HistoryManager) GetRecent

func (hm *HistoryManager) GetRecent(count int) []HistoryEntry

GetRecent returns recent history entries

func (*HistoryManager) GetStats

func (hm *HistoryManager) GetStats() HistoryStats

GetStats returns history statistics

func (*HistoryManager) Search

func (hm *HistoryManager) Search(query string) []HistoryEntry

Search searches history by command

type HistoryStats

type HistoryStats struct {
	TotalCommands int
	SuccessRate   float64
	AvgDuration   time.Duration
	OldestCommand time.Time
	NewestCommand time.Time
}

HistoryStats represents history statistics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL