使用Codex CLI hook调用windows系统提示来实现任务结束提示和请求权限提示

使用codex的时候,经常长时间看其他文件,导致忘记继续codex的任务。所以通过简单配置hook调用windows右下角系统提示框来实现提醒。 首先在powershell里安装依赖: Install-Module -Name BurntToast -Scope CurrentUser -Force...
使用Codex CLI hook调用windows系统提示来实现任务结束提示和请求权限提示
使用Codex CLI hook调用windows系统提示来实现任务结束提示和请求权限提示

使用codex的时候,经常长时间看其他文件,导致忘记继续codex的任务。所以通过简单配置hook调用windows右下角系统提示框来实现提醒。

首先在powershell里安装依赖:

Install-Module -Name BurntToast -Scope CurrentUser -Force

然后在.codex/config.toml中进行以下配置:

[features]
hooks = true

[[hooks.Stop]]
[[hooks.Stop.hooks]]
type = "command"
command = '''powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Import-Module BurntToast; New-BurntToastNotification -Text 'Codex', '任务完成', '请检查结果' -Sound Reminder"'''
timeout = 30
statusMessage = "Codex Stop 通知"

[[hooks.PermissionRequest]]
[[hooks.PermissionRequest.hooks]]
type = "command"
command = '''powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Import-Module BurntToast; New-BurntToastNotification -Text 'Codex', '需要确认以继续' -Sound Reminder"'''
timeout = 30
statusMessage = "Codex 权限确认通知"

然后进入codex,使用/hook,对两个hook按t确认就可以使用了。

最终效果既有右下角弹窗又有声音。

1 个帖子 - 1 位参与者

阅读完整话题

来源: LinuxDo 最新话题查看原文