hooks.json 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {
  2. "hooks": {
  3. "SessionStart": [
  4. {
  5. "hooks": [
  6. {
  7. "type": "command",
  8. "command": "curl -s -X POST http://localhost:8045/api/event -H 'Content-Type: application/json' -d '{\"code\":\"init\",\"source\":\"codex\"}' &",
  9. "timeout": 5
  10. }
  11. ]
  12. }
  13. ],
  14. "PreToolUse": [
  15. {
  16. "matcher": "Bash|apply_patch",
  17. "hooks": [
  18. {
  19. "type": "command",
  20. "command": "curl -s -X POST http://localhost:8045/api/event -H 'Content-Type: application/json' -d '{\"code\":\"using_tool\",\"source\":\"codex\"}' &",
  21. "timeout": 5
  22. }
  23. ]
  24. }
  25. ],
  26. "PostToolUse": [
  27. {
  28. "matcher": "Bash|apply_patch",
  29. "hooks": [
  30. {
  31. "type": "command",
  32. "command": "curl -s -X POST http://localhost:8045/api/event -H 'Content-Type: application/json' -d '{\"code\":\"tool_done\",\"source\":\"codex\"}' &",
  33. "timeout": 5
  34. }
  35. ]
  36. }
  37. ],
  38. "Stop": [
  39. {
  40. "hooks": [
  41. {
  42. "type": "command",
  43. "command": "curl -s -X POST http://localhost:8045/api/event -H 'Content-Type: application/json' -d '{\"code\":\"idle\",\"source\":\"codex\"}' &",
  44. "timeout": 5
  45. }
  46. ]
  47. }
  48. ]
  49. }
  50. }