원클릭으로
codex-tmux-echo
用 tmux 稳定驱动交互式 CLI:启动 session、发送按键、等待输出就绪,并支持 worker 向 controller pane 回传结果(backchannel)。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
用 tmux 稳定驱动交互式 CLI:启动 session、发送按键、等待输出就绪,并支持 worker 向 controller pane 回传结果(backchannel)。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
指导编码智能体以 capability-runtime 为业务落地入口,交付基于 capability-runtime 的 skills / agents / workflows,并在 Greenfield 或 Legacy Convergence 场景下优先使用 Runtime public surface、structured output、NodeReport、host summary 与 service/session surfaces。只要任务目标是用 capability-runtime / capability_runtime 落地业务代码、收敛下游 runtime boundary,或涉及 Runtime.run / Runtime.run_stream / run_structured / run_structured_stream / AgentSpec / PromptRenderMode / prompt_render_mode / _runtime_prompt / precomposed_messages / multimodal / vision / image input / 多图输入 / 视频抽帧输入 / OpenAI-compatible messages / image_url content parts / WorkflowSpec / NodeReport / RuntimeServiceFacade / describe_capability / summarize_host_run,就应优先使用本技能。不要用于普通通用编码、prompt-only 任务、直接学习上游原生框架 API,或任何明确要求“直接用 skills-runtime-sdk / Agently / provider SDK,不走 capability-runtime”的任务;若已触发但随后识别出这是反目标,必须立即退出,并停止提供任何上游实现细节、伪代码或 API 猜测。
Turn vague ideas into a validated design/spec through structured brainstorming. Use before any creative work - new features, UI/components, behavior changes, refactors, architecture decisions. Trigger whenever a user asks to brainstorm, define requirements, propose approaches, write a design doc, or says something like 'I want to build X' or 'how should we approach Y'. Even seemingly simple tasks benefit from a quick design pass.
用 Skills Runtime SDK(Python)开发复杂业务 agent、skills、workflow 的编码智能体指南。用户一旦提到 skills_runtime、Skills Runtime SDK、overlay YAML、FakeChatBackend、AgentBuilder、Coordinator、skill_ref_read、skill_exec、approvals/sandbox、WAL/replay、exec sessions、spawn_agent/send_input/wait、waiting_human/resume、examples/apps/workflows,或要在本仓上落地复杂业务开发/修复/回归,就应优先使用本技能。不要用于与本框架无关的通用编码或纯文案任务。
Trace and document the complete call chain / data flow of any feature or process in a codebase. Use this skill whenever the user asks to understand how a feature works end-to-end, trace a call chain, analyze code flow, map data flow across layers, reverse-engineer a process, or asks questions like "how does X call Y", "what happens when the user clicks Z", "trace the request from frontend to database". Also use it when the user wants the analysis exported to a file for offline reading.
Use only when the user explicitly wants to build with the Agently framework (mentions Agently/agently/OpenAICompatible/TriggerFlow/ToolExtension/ChromaCollection, or says “用 Agently 做/用 agently 做”). Deliver runnable code plus regression tests validating schema/ensure_keys and streaming (delta/instant/streaming_parse), with optional tools (Search/Browse/MCP), TriggerFlow orchestration, KB (ChromaDB), and serviceization (SSE/WS/HTTP). Do not use for generic streaming/testing questions that are not about Agently, or for prompt-only writing without tests/structure.
Send a critical mobile push through Day.app (Bark) with one GET request. Use when a task finishes, fails, is blocked, or needs immediate alerting, and you should summarize task name and summary from current task context before sending.
| name | codex-tmux-echo |
| version | 0.1.13 |
| author | 肆〇柒/ForOhZen |
| description | 用 tmux 稳定驱动交互式 CLI:启动 session、发送按键、等待输出就绪,并支持 worker 向 controller pane 回传结果(backchannel)。 |
这个 skill 提供一套“通用的 tmux 交互编排工具链”,用于稳定控制任意交互式 CLI(Codex/Claude Code/REPL/TUI 等):
Tab/Enter/Escape+Enter 等)sleep N 猜时序)注意:本 skill 不默认为 Codex 附加
--yolo/--full-auto等参数;是否开启由调用方传入--cmd决定。
本 skill 的核心能力是 tmux send-keys:它可以把文本/按键“打到”任意 tmux pane。这个能力非常强,也意味着一旦 target 选错,就可能在错误窗口里执行命令。
请在使用前理解并接受以下风险与边界:
--report-submit keys(尤其带 Enter)可能直接触发 shell 执行;只有在你明确知道 controller 是什么、并且明确指定 --scheduler-target 时才建议使用。--report-submit 会覆盖 --report-mode 的安全策略;请把它当成“高级/危险开关”。capture-pane 用于探测 Codex pane/等待输出;避免在 controller pane 里显示 secrets(token、私钥、敏感日志)。--cmd 是任意命令(高):dispatch.sh 会在 worker session 里执行你传入的 --cmd(默认是 codex --no-alt-screen)。如果你传入了高权限/破坏性命令,风险由你承担。risk-gate 只做简单模式匹配,不是安全沙盒;它只能“提醒/挡第一道”,不能保证绝对安全。--report-mode auto(Codex controller 自动发送;非 Codex 自动降级为仅注入草稿)。CODEX_TMUX_ECHO_CONTROLLER_TARGET;或直接传 --scheduler-target %<pane_id>。--report-submit keys --report-keys Enter。--socket auto(默认):
TMUX):复用当前 tmux server(这样 worker 才能回传到你的 pane)${TMPDIR:-/tmp} 下),避免污染系统 tmuxscripts/tmuxctl.sh:tmux 控制器(new/send/wait/capture/report/whoami)scripts/interactive_runner.sh:通用 runner(启动 worker → 发送 prompt → 自动提交 → 等待 done)scripts/start_scheduler.sh:一键启动“调度侧 Codex”(system tmux)scripts/dispatch.sh:一键派发自然语言任务到 worker,并回传到调度侧(对话式协同;支持自动识别 scheduler/controller pane)scripts/codex-tmux-echo:更短的 wrapper(直接把参数当成自然语言任务)scripts/selftest.sh:离线自测(不依赖网络/账号)tmuxbashpython3(wait 子命令用 Python regex 匹配,规避 grep 差异)bash scripts/selftest.sh
bash scripts/tmuxctl.sh whoami
SESSION=demo
bash scripts/tmuxctl.sh --session "$SESSION" new --dir "$(pwd)" --cmd "bash --noprofile --norc"
bash scripts/tmuxctl.sh --target "$SESSION" send --text 'echo READY' --keys 'Enter'
bash scripts/tmuxctl.sh --target "$SESSION" wait --pattern 'READY' --timeout 10
bash scripts/interactive_runner.sh \
--session tmtest \
--workdir "$PWD" \
--cmd 'codex --dangerously-bypass-approvals-and-sandbox --no-alt-screen' \
--prompt 'hello,你好呀。请在完成后回传 DONE。' \
--wait-pattern 'DONE' \
--timeout 120
bash scripts/start_scheduler.sh --socket system --session scheduler --workdir "$PWD"
tmux attach -t scheduler
bash scripts/codex-tmux-echo 'hello,你好呀'
如果你的 Skill Runner 会扫描某个 skills 目录,可以在仓库根目录执行(复制安装,不使用软链接):
SKILLS_DIR=<skills-scan-dir>
mkdir -p "$SKILLS_DIR"
cp -R "$(pwd)/agent/skills/codex-tmux-echo" "$SKILLS_DIR/codex-tmux-echo"
如果你还希望把派发命令变成一个全局 CLI(codex-tmux-echo),可以把 wrapper 复制到 PATH(例如 ~/.local/bin):
mkdir -p ~/.local/bin
cp -f "$SKILLS_DIR/codex-tmux-echo/scripts/codex-tmux-echo" ~/.local/bin/codex-tmux-echo
dispatch.sh 默认会自动识别调度侧 controller pane(优先使用 TMUX_PANE / CODEX_TMUX_ECHO_CONTROLLER_TARGET),因此 通常不需要指定 session 名称。
回传有两种常见语义:
默认行为为 --report-mode auto:
你可以显式指定:
# 强制仅注入草稿(不自动发送)
bash scripts/codex-tmux-echo --report-mode draft '...'
# 强制提交为对话消息(仅当 controller 是 Codex)
bash scripts/codex-tmux-echo --report-mode send '...'
回传文本会带上来源信息(便于调度侧二次对话定位来源):
ECHO-REPORT: from=<worker_session> | result=<ok|fail|blocked> | details=<one-line>
为避免把“调度层元指令”原封不动传给 worker(导致 worker 去“再启动一个 codex”),dispatch.sh 默认会:
--normalize auto:尽量把“自然语言/元指令”改写成 worker 可直接执行的具体步骤,并在 prompt 中加入 [我的理解] 段落。--risk auto:遇到高风险操作(如 sudo、写系统目录、rm -rf / 等)会先回传给调度者并阻断执行。
--risk allow如果 runner 注入了下面这些环境变量:
CODEX_TMUX_ECHO_CONTROLLER_TARGETCODEX_TMUX_ECHO_HOME那么 worker 可以在任务结束时回传(推荐 --submit codex,会尝试提交并检测调度侧开始处理):
"$CODEX_TMUX_ECHO_HOME/scripts/tmuxctl.sh" report \
--to "$CODEX_TMUX_ECHO_CONTROLLER_TARGET" \
--text 'DONE: ok' \
--submit codex
如果你只想“写入+按键提交”(不等待检测),可以用 --submit keys + --keys "Tab":
"$CODEX_TMUX_ECHO_HOME/scripts/tmuxctl.sh" report \
--to "$CODEX_TMUX_ECHO_CONTROLLER_TARGET" \
--text 'DONE: ok' \
--submit keys \
--keys "Tab"