Skip to content

Add configurable post-session hook for tests and lint#20

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

Add configurable post-session hook for tests and lint#20
dmoliveira merged 1 commit intomainfrom
my_opencode-post-session-hook

Conversation

@dmoliveira
Copy link
Owner

What changed

  • Added scripts/post_session_command.py to configure post-session behavior:
    • status, help
    • enable, disable
    • set command <shell-command>
    • set timeout <ms>
    • set run-on <exit|manual|idle> (comma-list)
  • Extended scripts/session_digest.py:
    • new --run-post option
    • loads config from ~/.config/opencode/opencode-session.json
    • executes configured post-session command with timeout
    • records post-session result inside digest JSON (attempted, exit_code, timed_out)
  • Updated scripts/opencode_session.sh to call digest with --run-post on exit/Ctrl+C
  • Added OpenCode command bindings:
    • /post-session, /post-session-help, /post-session-enable
    • /digest-run-post
  • Updated docs/install/test flows:
    • README usage and config docs
    • installer self-check and command hints
    • selftest coverage for post-session command execution
    • install-test smoke includes post-session status and digest run-post

Why

This provides a native way to run your preferred test/lint command automatically at session end (including Ctrl+C) and optionally on manual digest runs.

Validation

  • make validate
  • make selftest
  • make install-test

@dmoliveira dmoliveira merged commit b45946a into main Feb 12, 2026
1 check passed
@dmoliveira dmoliveira deleted the my_opencode-post-session-hook branch February 12, 2026 11:47
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