Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,20 @@ codex mcp add barkeep \
Restart ChatGPT desktop, Codex, or the IDE extension after adding the server.
Use `/mcp` to confirm that `barkeep` is connected.

For the same automatic task-finished and needs-input signals as Claude Code,
merge [`hooks/codex-hooks.json`](hooks/codex-hooks.json) into
`~/.codex/hooks.json`, restart Codex/ChatGPT desktop, then open `/hooks` and
trust the three BarKeep commands. Codex and ChatGPT desktop share these hooks.
To notify the Busy Bar whenever Codex or ChatGPT desktop finishes a turn and
waits for you, add this top-level setting to `~/.codex/config.toml`:

```toml
notify = ["/opt/homebrew/opt/barkeep-cli/share/barkeep-cli/hooks/codex-notify.sh"]
```

The notifier also forwards the event to Codex Computer Use when that helper is
installed. Restart Codex/ChatGPT desktop after changing the setting.

For permission-request signals and long-task timing, merge
[`hooks/codex-hooks.json`](hooks/codex-hooks.json) into
`~/.codex/hooks.json`, restart the app, then open `/hooks` and trust the three
BarKeep commands.

## Permissions

Expand Down
32 changes: 32 additions & 0 deletions hooks/codex-notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
# External Codex notifier. Codex passes one JSON payload as the final argument
# when a turn completes or needs approval.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
payload="${1:-{}}"

# Preserve the desktop Computer Use notifier when it is installed. BarKeep's
# setup can therefore replace Codex's single `notify` command without disabling
# the helper that keeps remote-control sessions in sync.
computer_use_notifier="$HOME/.codex/computer-use/Codex Computer Use.app/Contents/SharedSupport/SkyComputerUseClient.app/Contents/MacOS/SkyComputerUseClient"
if [ -x "$computer_use_notifier" ]; then
"$computer_use_notifier" turn-ended "$payload" >/dev/null 2>&1 &
fi

message=$(printf '%s' "$payload" | /usr/bin/python3 -c '
import json, sys

try:
data = json.load(sys.stdin)
except Exception:
data = {}

event = data.get("type", "")
if event == "approval-requested":
print("needs your approval")
else:
print("is waiting for your response")
' 2>/dev/null)
[ -n "$message" ] || message="is waiting for your response"

printf '{"message":"%s"}' "$message" |
BARKEEP_AGENT=Codex "$SCRIPT_DIR/agent-notification.sh"
2 changes: 1 addition & 1 deletion packaging/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.11</string>
<string>1.0.12</string>
<key>LSMinimumSystemVersion</key>
<string>14.0</string>
<key>LSUIElement</key>
Expand Down
Loading