接入外部工具
把 AI 编程工具的状态自动同步到灯牌 · 配置一次,长期生效
C
Claude Code
~/.claude/settings.json
已配置
通过 HTTP hook 直接上报,不需要写脚本。
▸ 查看 JSON 配置
{
"hooks": {
"UserPromptSubmit": [{ "hooks": [{ "type": "http", "url": "http://127.0.0.1:47800/hook", "body": "{\"source\":\"claude-code\",\"event\":\"state_change\",\"state\":\"WORKING\",\"session\":\"${session_id}\"}" }] }],
"Stop": [{ "hooks": [{ "type": "http", "url": "http://127.0.0.1:47800/hook", "body": "{\"source\":\"claude-code\",\"event\":\"state_change\",\"state\":\"SUCCESS\",\"session\":\"${session_id}\"}" }] }],
"StopFailure": [{ "hooks": [{ "type": "http", "url": "http://127.0.0.1:47800/hook", "body": "{\"source\":\"claude-code\",\"event\":\"state_change\",\"state\":\"ERROR\",\"session\":\"${session_id}\"}" }] }],
"Notification": [{ "matcher": "idle_prompt|permission_prompt", "hooks": [{ "type": "http", "url": "http://127.0.0.1:47800/hook", "body": "{\"source\":\"claude-code\",\"event\":\"state_change\",\"state\":\"WAITING\",\"session\":\"${session_id}\"}" }] }]
}
}
X
Codex
~/.codex/hooks.json + config.toml
未配置
需要同时配置 hooks 和 notify;Codex Desktop 会重写 notify。
▸ 查看配置步骤
[
{ "event": "UserPromptSubmit", "command": "curl -s -X POST http://127.0.0.1:47800/hook -H 'Content-Type: application/json' -d '{\"source\":\"codex\",\"state\":\"WORKING\"}'" },
{ "event": "Stop", "command": "curl -s -X POST http://127.0.0.1:47800/hook -H 'Content-Type: application/json' -d '{\"source\":\"codex\",\"state\":\"SUCCESS\"}'" }
]
Q
Qoder
事件与 Claude Code 同构,配置方式一致
预留
这些配置在做什么?
每个工具在自己的关键时刻(开始干活、完成任务、出错、等你回复)调用
AI-Light 的本地 HTTP 端点,把状态传过来。AI-Light
按当前主题映射到具体灯效,下发给灯牌。配置一次即可。