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
Click to show internal directories.
Click to hide internal directories.