Skip to content

Add session digest command and optional exit hook wrapper#18

Merged
dmoliveira merged 1 commit intomainfrom
my_opencode-session-digest
Feb 12, 2026
Merged

Add session digest command and optional exit hook wrapper#18
dmoliveira merged 1 commit intomainfrom
my_opencode-session-digest

Conversation

@dmoliveira
Copy link
Owner

What changed

  • Added scripts/session_digest.py with:
    • run mode to capture a session digest (timestamp, reason, cwd, git branch/status snapshot)
    • show mode to print the latest digest
    • optional post-digest hook command via --hook
  • Added scripts/opencode_session.sh wrapper:
    • launches opencode
    • traps process exit (including Ctrl+C) and writes digest automatically
    • optionally runs hook command after writing digest
  • Added OpenCode commands in opencode.json:
    • /digest
    • /digest-run
    • /digest-show
  • Updated installer to chmod and surface digest commands
  • Updated README with usage and exit-wrapper examples
  • Extended self-tests and install smoke tests to cover digest flows

Why

You asked for both manual and automatic session-end behavior. This provides:

  • manual on-demand command (/digest run)
  • automatic on process exit (opencode_session.sh) with optional hook command

Validation

  • make validate
  • make selftest
  • make install-test

@dmoliveira dmoliveira merged commit 3476cef into main Feb 12, 2026
1 check passed
@dmoliveira dmoliveira deleted the my_opencode-session-digest branch February 12, 2026 10:49
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