在 Show HN 发布 cmux
我们于 2 月 19 日在 Show HN 上发布了 cmux:
我同时运行大量 Claude Code 和 Codex 会话。之前我用 Ghostty 开了一堆分屏面板,靠 macOS 原生通知来判断哪个 agent 需要我。但 Claude Code 的通知内容永远只有「Claude is waiting for your input」,没有上下文,标签页多了之后连标题都看不全。
我试过一些 coding 编排工具,但大多是 Electron/Tauri 应用,性能让我不满意。而且我更喜欢终端,因为 GUI 编排工具会把你锁定在它们的工作流里。所以我用 Swift/AppKit 构建了 cmux 作为原生 macOS 应用。它使用 libghostty 进行终端渲染,并读取你现有的 Ghostty 配置来加载主题、字体、颜色等。
主要新增的是侧边栏和通知系统。侧边栏有垂直标签页,显示每个工作区的 git 分支、工作目录、监听端口和最新通知文本。通知系统可以捕获终端序列(OSC 9/99/777),还有一个 CLI(cmux notify)可以接入 Claude Code、OpenCode 等的 agent hooks。当 agent 等待时,它的面板会显示蓝色提醒环,标签页在侧边栏中亮起,这样我就能在分屏和标签页之间一眼看出哪个需要我。Cmd+Shift+U 跳转到最近的未读通知。
内置浏览器有一个可编程 API。Agent 可以获取无障碍树的快照、获取元素引用、点击、填写表单、执行 JS 和读取控制台日志。你可以在终端旁边分屏打开浏览器面板,让 Claude Code 直接与你的开发服务器交互。
所有功能都可以通过 CLI 和 socket API 编程控制:创建工作区/标签页、分屏、发送按键、在浏览器中打开 URL。
峰值时登上了 Hacker News 第二名。Mitchell Hashimoto 分享了它:
我最喜欢的 HN 帖子评论:
Hey, this looks seriously awesome. Love the ideas here, specifically: the programmability (I haven't tried it yet, but had been considering learning tmux partly for this), layered UI, browser w/ api. Looking forward to giving this a spin. Also want to add that I really appreciate Mitchell Hashimoto creating libghostty; it feels like an exciting time to be a terminal user.
Some feedback (since you were asking for it elsewhere in the thread!):
- It's not obvious/easy to open browser dev tools (cmd-alt-i didn't work), and when I did find it (right click page → inspect element) none of the controls were visible but I could see stuff happening when I moved my mouse over the panel
- Would be cool to borrow more of ghostty's behavior:
- hotkey overrides
- command palette (cmd-shift-p)
- cmd-z to "zoom in" to a pane
出乎意料的是,cmux 在日本走红了:
翻译:「这个看起来不错。一个基于 Ghostty 的终端应用,专为并行运行多个 Claude Code 等 CLI 时不迷失方向而设计。等待输入的面板会显示蓝色边框,还有自己的通知系统。」
在中国也引起了一定关注:
另一件令人兴奋的事是看到大家基于 cmux CLI 进行扩展开发。sasha 构建了一个 pi-cmux 扩展,在侧边栏显示模型信息、token 用量和 agent 状态:
cmux 中的一切都可以通过 CLI 编程控制:创建工作区、发送按键、控制浏览器、读取通知。cmux 的理念之一就是可编程和可组合,让开发者可以自定义与 coding agent 的协作方式。Coding agent 的前沿在快速变化,你不会想被锁定在一个跟不上节奏的僵化 GUI 编排工具里。
如果你在同时运行多个 coding agent,试试 cmux。
