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

Method showDayNotes

cli/memory_command.go:100–125  ·  view source on GitHub ↗
(date time.Time)

Source from the content-addressed store, hash-verified

98}
99
100func (cli *ChatCLI) showDayNotes(date time.Time) {
101 dateStr := date.Format("2006-01-02")
102 dir := filepath.Dir(cli.memoryStore.TodayNotePath())
103 memDir := filepath.Dir(dir) // go up from YYYYMM to memory/
104 path := filepath.Join(memDir, date.Format("200601"), date.Format("20060102")+".md")
105
106 data, err := os.ReadFile(path) //#nosec G304 -- path supplied by user/agent through validated tool surface (boundary check upstream)
107 if err != nil {
108 fmt.Printf(" %s %s\n", colorize(i18n.T("memory.no_notes_for"), ColorGray), colorize(dateStr, ColorCyan))
109 return
110 }
111
112 content := strings.TrimSpace(string(data))
113 if content == "" {
114 fmt.Printf(" %s %s\n", colorize(i18n.T("memory.no_notes_for"), ColorGray), colorize(dateStr, ColorCyan))
115 return
116 }
117
118 fmt.Println()
119 fmt.Printf(" %s %s\n", colorize(i18n.T("memory.notes_for"), ColorCyan+ColorBold), colorize(dateStr, ColorYellow))
120 fmt.Println(colorize(" ─────────────────────────────────────────", ColorGray))
121 for _, line := range strings.Split(content, "\n") {
122 fmt.Printf(" %s\n", line)
123 }
124 fmt.Println()
125}
126
127func (cli *ChatCLI) showWeekNotes() {
128 notes := cli.memoryStore.GetRecentDailyNotes(7)

Callers 1

handleMemoryCommandMethod · 0.95

Calls 4

TFunction · 0.92
colorizeFunction · 0.85
DirMethod · 0.45
TodayNotePathMethod · 0.45

Tested by

no test coverage detected