Overview
Use the Day.app interface to send mobile alert push notifications. When calling, first extract from the current task context taskname and tasksummary, then directly trigger the GET request.
Workflow
- Extract parameters from the current task context:
taskname: no more than 6 Chinese characters (for English scenarios, no more than 12 letters is recommended)tasksummary: no more than 25 Chinese characters, or no more than 50 English characters
- Read
config.json'sdeviceid、app_nameandquiet_hours。 - If
deviceidis empty, immediately prompt the user and stop:- Configuration location:
./config.json - Configuration method: write
deviceidinto{"deviceid":"你的值"} - How to obtain: install
Barkfrom the App Store, open the App and you will see and be able to copydeviceid
- Configuration location:
- Generate the request URL:
- The title prefix is not hardcoded as
Codex-, but rather{应用名}-{taskname} groupThe parameter is also not a hardcoded value, but is kept consistent with{应用名}Keep consistentapp_name=autoauto-detected atCodex-: in a Codex environment useClaude-- If the current time is within the silent period: remove
sound、level、volume - If not within the silent period: keep
sound=alarm&level=critical&volume=5
- The title prefix is not hardcoded as
- Send a GET request.
Rules
- Send only one GET request; do not create a retry storm.
- If
config.jsonis missingdeviceid, first prompt the user to configure it, then stop. app_nameDefaultauto; it can also be hardcoded manually, for exampleCodex、Claude。quiet_hoursis optional; when not configured, treat it as not silent.- Length constraints must be applied before sending; overly long content should be automatically truncated by the script.
- Do not write sensitive information (tokens, passwords, cookies, internal network addresses, etc.) into the message.
Config
Edit config.json:
{
"deviceid": "YOUR_DEVICE_ID",
"app_name": "auto",
"quiet_hours": {
"start": "23:00",
"end": "08:00"
}
}
Description:
app_nameauto: automatically detect the current application (Codex / Claude)- Other values: manually specify the prefix (it will be normalized, for example
Claude Code->Claude)
quiet_hours.start/quiet_hours.endusesHH:MM(24-hour format)- Supports crossing days (e.g.
23:00to08:00) - Within the silent window,
sound、level、volume
Command Reference
python3 scripts/send_dayapp_push.py --task-name "构建完成" --task-summary "CLI 构建与测试全部通过"
python3 scripts/send_dayapp_push.py --task-name "部署阻塞" --task-summary "生产发布被权限策略拦截" --dry-run