分享下 WSL内Claude Code & Codex Cli 给Win发送消息通知

分享下 WSL内Claude Code & Codex Cli 给Win发送消息通知
分享下 WSL内Claude Code & Codex Cli 给Win发送消息通知

codex config.toml 配置:

[features]
hooks = true

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

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

说明: pwsh 是windows中powershell7

claude code setting.json配置

  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command \"Import-Module BurntToast; New-BurntToastNotification -Text 'Claude Code', '任务完成' -Sound Reminder\"",
            "timeout": 30000
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "pwsh.exe -NoProfile -ExecutionPolicy Bypass -Command \"Import-Module BurntToast; New-BurntToastNotification -Text 'Claude Code', '需要确认以继续' -Sound Reminder\"",
            "timeout": 30000
          }
        ]
      }
    ]
  }

1 个帖子 - 1 位参与者

阅读完整话题

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