MCPcopy Create free account
hub / github.com/diillson/chatcli / RecordCommand

Method RecordCommand

cli/workspace/memory/profile.go:393–407  ·  view source on GitHub ↗

RecordCommand increments command usage counter.

(cmd string)

Source from the content-addressed store, hash-verified

391
392// RecordCommand increments command usage counter.
393func (ps *UserProfileStore) RecordCommand(cmd string) {
394 cmd = strings.TrimSpace(cmd)
395 if cmd == "" {
396 return
397 }
398
399 ps.mu.Lock()
400 defer ps.mu.Unlock()
401
402 if ps.profile.TopCommands == nil {
403 ps.profile.TopCommands = make(map[string]int)
404 }
405 ps.profile.TopCommands[cmd]++
406 ps.persist()
407}
408
409// FormatForPrompt returns a concise summary for system prompt injection,
410// with every scoped directive visible (labeled). Prefer FormatForPromptScoped

Callers 4

TestUserProfile_IsEmptyFunction · 0.95
HandleCommandMethod · 0.80
RecordInteractionMethod · 0.80

Calls 3

persistMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80

Tested by 2

TestUserProfile_IsEmptyFunction · 0.76