在 Show HN 上發布 cmux

我們在 2 月 19 日將 cmux 發布到 Show HN

我同時執行很多 Claude Code 和 Codex 工作階段。我之前用 Ghostty 搭配大量分割窗格,依賴原生 macOS 通知來知道代理何時需要我。但 Claude Code 的通知內容永遠只有「Claude is waiting for your input」而沒有上下文,而且分頁開太多時,我連標題都看不到了。

我試了幾個程式碼編排工具,但大多數是 Electron/Tauri 應用程式,效能讓我不滿意。我也更喜歡終端機,因為 GUI 編排工具會把你鎖在它們的工作流程裡。所以我用 Swift/AppKit 建立了 cmux 作為原生 macOS 應用程式。它使用 libghostty 進行終端機渲染,並讀取你現有的 Ghostty 設定來套用主題、字型、顏色等。

主要新增的是側邊欄和通知系統。側邊欄有垂直分頁,顯示每個工作區的 git 分支、工作目錄、監聽的連接埠和最新通知文字。通知系統會擷取終端機序列(OSC 9/99/777),並提供 CLI(cmux notify)讓你連接到 Claude Code、OpenCode 等代理的 hooks。當代理在等待時,其窗格會出現藍色環圈,分頁在側邊欄中會亮起,這樣我就能在分割和分頁之間看出哪個需要我。Cmd+Shift+U 會跳到最近的未讀通知。

內建瀏覽器有可編寫腳本的 API。代理可以擷取無障礙樹快照、取得元素參考、點擊、填寫表單、執行 JS 和讀取主控台日誌。你可以在終端機旁邊分割一個瀏覽器窗格,讓 Claude Code 直接與你的開發伺服器互動。

一切都可以透過 CLI 和 socket API 編寫腳本:建立工作區/分頁、分割窗格、傳送按鍵、在瀏覽器中開啟 URL。

最高時登上 Hacker News 第 2 名。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

johnthedebs

出乎意料地,cmux 在日本爆紅:

翻譯:「這看起來不錯。一個基於 Ghostty 的終端機應用程式,設計成讓你在平行執行多個像 Claude Code 這樣的 CLI 時不會迷失。等待輸入的面板會有藍色邊框,而且有自己的通知系統。」

也在中國小範圍爆紅:

另一件令人興奮的事是看到人們在 cmux CLI 之上進行開發。sasha 建立了一個 pi-cmux 擴充功能,在側邊欄中顯示模型資訊、token 用量和代理狀態:

cmux 中的一切都可以透過 CLI 編寫腳本:建立工作區、傳送按鍵、控制瀏覽器、讀取通知。cmux 的理念之一是可程式化和可組合,讓使用者可以自訂與程式碼代理合作的方式。程式碼代理的技術前沿變化很快,你不會想被鎖在一個跟不上的僵化 GUI 編排工具裡。

如果你正在同時執行多個程式碼代理,試試 cmux

cmux GitHub star history showing growth from near 0 to 900+ stars after the Show HN launch