当前位置: 首页 > Skill >

Codecast

Codecast

Codecast

将编码代理会话(如 Claude Code、Codex、Gemini CLI 等)实时流式传输到 Discord 频道,使用 webhook。在调用编码代理并希望…时使用。

4.1.0 2026.11.26 740
获取Skill文件查看使用说明
作 者:陈舟 许可证: 更新时间:2026.11.26
本文目录展开

Codecast

Live-stream coding agent sessions to Discord. Zero AI tokens burned.

Setup

First-time setup: see references/setup.md for webhook creation, unbuffer install, bot token, and smoke test.

Invocation

Launch with exec background:true. Background exec sessions survive agent turns and OpenClaw fires notifyOnExit automatically when the process ends.

exec background:true command:"{baseDir}/scripts/dev-relay.sh -w ~/projects/myapp -- claude -p --dangerously-skip-permissions --output-format stream-json --verbose 'Your task here'"

Note the session ID from the response — use it to monitor via process.

Options

Flag Description Default
-w <dir> Working directory Current dir
-t <sec> Timeout 1800
-h <sec> Hang threshold 120
-n <name> Agent display name Auto-detected
-r <n> Rate limit (posts/60s) 25
--thread Post into a Discord thread Off
--skip-reads Hide Read tool events Off
--review <url> PR review mode —
--parallel <file> Parallel tasks mode —
--resume <dir> Replay session —

For PR review, parallel tasks, Discord bridge, and Codex structured output: see references/advanced-modes.md.

Agent Launch Checklist

  1. Start background session → note session ID and PID from response
  2. Post to dev channel → announce agent name, workdir, task
  3. Write breadcrumb for completion routing:
    echo '{"channel":"<invoking-channel-id>","relayDir":"<relay-dir>","pid":<PID>}' > /tmp/codecast-pending-<PID>.json
    
  4. Log to daily memory → session ID, relay dir, invoking channel

The breadcrumb file tells the heartbeat precheck where to post results when the session completes. It auto-detects completion by checking if the PID is still alive.

That's it. When the process ends, OpenClaw's notifyOnExit fires a system event + heartbeat request. The heartbeat handler reads the result from the relay dir's stream.jsonl and posts to the invoking channel.

Completion Detection

OpenClaw handles this natively:

  • tools.exec.notifyOnExit: true (default) — system event + heartbeat on process exit
  • Heartbeat precheck script detects completed sessions via /tmp/dev-relay-sessions/
  • No cron watcher needed

Backup: Append this to the inner agent's prompt for an additional signal:

When completely finished, run: openclaw system event --text "Done: <brief summary>" --mode now

Monitoring

process poll sessionId:<id>        # Check status
process log sessionId:<id>         # View recent output
process kill sessionId:<id>        # Stop session

Agent Support

Agent Output Mode Status
Claude Code stream-json Full support
Codex --json JSONL Full support
Any CLI Raw ANSI Basic support

Session Tracking

  • Active sessions: /tmp/dev-relay-sessions/<PID>.json (auto-removed on end)
  • Event logs: /tmp/dev-relay.XXXXXX/stream.jsonl (7-day auto-cleanup)
  • Interactive input: process submit sessionId:<id> data:"message"

Reference Docs

  • Setup guide — first-time install, webhook, bot token
  • Advanced modes — PR review, parallel tasks, Discord bridge, Codex
  • Discord output — message formats, architecture, env vars, troubleshooting

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • Codecast
    • Setup
    • Invocation
      • Options
    • Agent Launch Checklist
    • Completion Detection
    • Monitoring
    • Agent Support
    • Session Tracking
    • Reference Docs
  • 项目或源文件

相关 Skill

更多
Gemini Web Search Gemini Web Search 使用 Gemini CLI(@google/gemini-cli)进行网络搜索或事实查找,并返回有来源的摘要。当用户询问“今天X发生了什么”“最新消息是什么”“搜索网页”“查找来源/链接”,或任何需要最新信息的任务时使用。若 Gemini 可用但速度较慢,优先选择此工具;请在 TTY 环境中运行,等待更长时间,并核实来源质量。
Vibe-Switch Vibe-Switch AI 代理的 tmux — 一条命令并行编排多个 AI 编码代理。同时运行 Claude Code、Codex CLI 和 Gemini CLI...
Agents Plugin Marketplace Agents Plugin Marketplace 84个生产级代理插件,192个代理,156项技能和102条命令,适用于 Claude Code、Codex CLI、Cursor、OpenCode 与 Gemini CLI
ACP Background Runs ACP Background Runs 将ACP或外部编码代理(如Codex、Claude Code、Gemini CLI、OpenCode)的请求路由至非阻塞的OpenClaw后台ACP运行...
Skill Port Skill Port Skill Port 对跨 Claude Code、Codex、Gemini CLI 及 Agent Skills 兼容运行时的 AI agent 技能进行审计和移植。检查可移植性、目标 agent 兼容性、风险脚本/钩子/MCP 配置,在不安装或运行源码的情况下构建安全目标布局。