Bear → Canvas → BlueBubbles Sync
Detect #share-tagged Bear notes, update a JSON Canvas knowledge map, and push a preview to a work group via BlueBubbles.
Prerequisites
- Bear app running with
grizzlyCLI installed - Bear API token at
~/.config/grizzly/token - BlueBubbles channel configured in gateway (for iMessage distribution)
jqavailable
Workflow
- Detect — Run
scripts/sync_share_notes.shto query Bear for#sharenotes viagrizzly open-tag --name share. - Dedup — The script tracks processed note IDs in
~/.local/share/bear-share-sync/state.json; only new notes are handled. - Canvas update — Each new note becomes a green
textnode appended tocanvases/agent_capabilities.canvas. See canvas-schema.md for node structure. - Preview — The script outputs a preview summary. If
BB_TARGETis set, it signals that a BlueBubbles send is needed. - Distribute — When the script signals
BB_SEND_REQUIRED=1, use themessagetool withchannel="bluebubbles"andtarget=$BB_TARGETto send the preview text.
Running
# One-shot sync
BB_TARGET="+15551234567" bash scripts/sync_share_notes.sh
# Then send preview (if script output includes BB_SEND_REQUIRED=1)
# Use the message tool: action=send, channel=bluebubbles, target=<target>, message=<preview>
Scheduled sync (cron)
Set up a cron job to check periodically:
{
"schedule": { "kind": "every", "everyMs": 300000 },
"payload": {
"kind": "agentTurn",
"message": "Run bear-share-sync: execute scripts/sync_share_notes.sh with BB_TARGET set to the work group, then send any preview via BlueBubbles if needed."
}
}
Configuration
| Variable | Default | Purpose |
|---|---|---|
CANVAS_DIR | /root/.openclaw/workspace/canvases | Directory for canvas files |
CANVAS_FILE | $CANVAS_DIR/agent_capabilities.canvas | Target canvas file |
BB_TARGET | (empty — skip iMessage) | BlueBubbles target (phone/chat) |
TOKEN_FILE | ~/.config/grizzly/token | Bear API token path |
STATE_FILE | ~/.local/share/bear-share-sync/state.json | Processed-note dedup state |