Skip to content

feat: add session-aware history commands (ghistory, lhistory) - #111

Merged
oguyon merged 1 commit into
framework-devfrom
feat/session-history-commands
Mar 21, 2026
Merged

feat: add session-aware history commands (ghistory, lhistory)#111
oguyon merged 1 commit into
framework-devfrom
feat/session-history-commands

Conversation

@oguyon

@oguyon oguyon commented Mar 21, 2026

Copy link
Copy Markdown
Member

Summary

Add two new CLI commands for session-aware command history:

  • ghistory — global history across all sessions, with session metadata
  • lhistory — local history filtered to the current session

Changes

  • Added session_id, session_tty, session_start fields to DATA struct
  • Created ~/.milk_history_log — append-only TSV file recording every command with timestamp, session ID, terminal, and command text
  • Session ID format: <processname>-<PID> (e.g., milk-12345)
  • Log runs automatically alongside readline history (no opt-in needed)
  • Existing ~/.milk_history remains unchanged

Usage

ghistory          # last 20 entries (all sessions)
ghistory 50       # last 50 entries
ghistory -s milk-12345   # filter by session ID
lhistory          # all commands in current session
lhistory 10       # last 10 in current session

Prompt Summary

User requested two CLI commands: one for global history and one for local (session) history, with each entry identifying the session by name, start time, and terminal.

AI Authorship

  • Model: Claude Opus 4 (claude-opus-4-20250514, Anthropic)
  • User edits: None — all code authored by agent

Add two new CLI commands for command history with session metadata:

- ghistory: global history across all sessions
  - ghistory N: show last N entries
  - ghistory -s <session_id>: filter by session

- lhistory: local history for current session only
  - lhistory N: show last N entries

Implementation details:
- Add session identity fields (session_id, session_tty, session_start)
  to DATA struct in CLIcore.h and CLIcore_standalone.h
- Create ~/.milk_history_log as append-only TSV file recording
  every command with: timestamp, session_id, terminal, command
- Session ID format: <processname>-<PID> (e.g., milk-12345)
- Structured log runs alongside readline history (no opt-in needed)
- Existing ~/.milk_history (readline) remains unchanged
@oguyon
oguyon merged commit 69e30f7 into framework-dev Mar 21, 2026
2 of 3 checks passed
@oguyon
oguyon deleted the feat/session-history-commands branch March 21, 2026 06:16
oguyon added a commit that referenced this pull request May 21, 2026
Add two new CLI commands for command history with session metadata:

- ghistory: global history across all sessions
  - ghistory N: show last N entries
  - ghistory -s <session_id>: filter by session

- lhistory: local history for current session only
  - lhistory N: show last N entries

Implementation details:
- Add session identity fields (session_id, session_tty, session_start)
  to DATA struct in CLIcore.h and CLIcore_standalone.h
- Create ~/.milk_history_log as append-only TSV file recording
  every command with: timestamp, session_id, terminal, command
- Session ID format: <processname>-<PID> (e.g., milk-12345)
- Structured log runs alongside readline history (no opt-in needed)
- Existing ~/.milk_history (readline) remains unchanged
oguyon added a commit that referenced this pull request May 21, 2026
Add two new CLI commands for command history with session metadata:

- ghistory: global history across all sessions
  - ghistory N: show last N entries
  - ghistory -s <session_id>: filter by session

- lhistory: local history for current session only
  - lhistory N: show last N entries

Implementation details:
- Add session identity fields (session_id, session_tty, session_start)
  to DATA struct in CLIcore.h and CLIcore_standalone.h
- Create ~/.milk_history_log as append-only TSV file recording
  every command with: timestamp, session_id, terminal, command
- Session ID format: <processname>-<PID> (e.g., milk-12345)
- Structured log runs alongside readline history (no opt-in needed)
- Existing ~/.milk_history (readline) remains unchanged
oguyon added a commit that referenced this pull request May 22, 2026
Add two new CLI commands for command history with session metadata:

- ghistory: global history across all sessions
  - ghistory N: show last N entries
  - ghistory -s <session_id>: filter by session

- lhistory: local history for current session only
  - lhistory N: show last N entries

Implementation details:
- Add session identity fields (session_id, session_tty, session_start)
  to DATA struct in CLIcore.h and CLIcore_standalone.h
- Create ~/.milk_history_log as append-only TSV file recording
  every command with: timestamp, session_id, terminal, command
- Session ID format: <processname>-<PID> (e.g., milk-12345)
- Structured log runs alongside readline history (no opt-in needed)
- Existing ~/.milk_history (readline) remains unchanged
DasVinch pushed a commit that referenced this pull request May 29, 2026
Add two new CLI commands for command history with session metadata:

- ghistory: global history across all sessions
  - ghistory N: show last N entries
  - ghistory -s <session_id>: filter by session

- lhistory: local history for current session only
  - lhistory N: show last N entries

Implementation details:
- Add session identity fields (session_id, session_tty, session_start)
  to DATA struct in CLIcore.h and CLIcore_standalone.h
- Create ~/.milk_history_log as append-only TSV file recording
  every command with: timestamp, session_id, terminal, command
- Session ID format: <processname>-<PID> (e.g., milk-12345)
- Structured log runs alongside readline history (no opt-in needed)
- Existing ~/.milk_history (readline) remains unchanged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant