Community生產力與協作github.com

aradotso/cmux-終端機多工器

AI 原生的終端機多工器,具備可程式化的 Socket API、完整的 Playwright 等效瀏覽器自動化,以及代理團隊協調功能——專為 Claude Code 和自主代理工作流程打造。

cmux-終端機多工器 是什麼?

此技能提供一個 AI 原生的終端機多工器,名為 cmux,它超越了傳統的終端機管理工具。其核心功能包括一個可程式化的 Socket API,讓 AI 代理能直接以程式方式控制終端機工作階段,實現進階的自動化與協調。此外,它內建完整的 Playwright 等效瀏覽器自動化能力,使代理能無縫地執行網頁互動與測試。該技能特別支援代理團隊的協調,允許一個主要代理(如 Claude Code)動態地部署、監控並與多個子代理通訊,以協作完成複雜任務。它適用於 Claude Code、Cursor、Codex 等平台,透過在後端建立一個多工伺服器,並提供清晰的 API 端點,讓 AI 客戶端能以標準化方式進行互動與管理。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/aradotso/trending-skills/tree/main/skills/cmux-terminal-multiplexer

Installed? Explore more 生產力與協作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

cmux-終端機多工器 是做什麼的?

AI 原生的終端機多工器,具備可程式化的 Socket API、完整的 Playwright 等效瀏覽器自動化,以及代理團隊協調功能——專為 Claude Code 和自主代理工作流程打造。

安裝與設定

安裝

需要 Go 1.21 或更新版本。

go install github.com/aradotso/cmux@latest

或者從原始碼建置:

git clone https://github.com/aradotso/cmux.git
cd cmux
make build

初始化

在您的專案目錄中執行:

cmux init

這會建立一個 cmux.json 設定檔和預設的 socket 端點。

使用方法

啟動伺服器

cmux server

預設情況下,伺服器會監聽 Unix socket ./cmux.sock。若要使用 TCP,請在 cmux.json 中設定或傳遞 --tcp :8080 標誌。

代理 API 端點

Socket API 提供以下端點:

端點方法說明
/sessionPOST建立新的終端機工作階段
/session/{id}GET取得工作階段詳細資訊
/session/{id}/sendPOST將命令傳送到工作階段
/sessionsGET列出所有活躍的工作階段
/browserPOST啟動新的瀏覽器實例
/browser/{id}/navigatePOST導航至 URL
/browser/{id}/screenshotGET取得螢幕截圖
/agentPOST部署一個子代理
/agent/{id}/messagePOST傳送訊息給代理

範例:以程式方式建立工作階段

# 建立新的終端機工作階段
cmux api /session -X POST -d '{"name": "build-session"}'

# 發送命令
cmux api /session/1/send -X POST -d '{"command": "npm run build"}'

瀏覽器自動化

import socket
import json

# 連線至 cmux socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
sock.connect("./cmux.sock")

# 啟動瀏覽器
sock.send(json.dumps({"method": "POST", "path": "/browser", "body": {}}))
response = json.loads(sock.recv(4096))
browser_id = response["id"]

# 導航
sock.send(json.dumps({
    "method": "POST",
    "path": f"/browser/{browser_id}/navigate",
    "body": {"url": "https://example.com"}
}))

代理團隊協調

部署多個代理以協作處理大型任務:

# 部署子代理
cmux api /agent -X POST -d '{"role": "code-reviewer", "context": "review PR #42"}'

# 傳送訊息
cmux api /agent/1/message -X POST -d '{"text": "請檢查這個合併請求。"}'

代理可以透過 socket 相互通訊,共享工作階段與資源。

設定

cmux.json 支援以下選項:

選項類型預設值說明
socket_path字串./cmux.sockUnix socket 路徑
tcp_address字串""TCP 監聽位址(留空則使用 socket)
log_level字串info日誌等級(debug、info、warn、error)
max_sessions整數50最大並行工作階段數
agent_pool_size整數5預分配的代理數量
browser_timeout整數30000瀏覽器操作逾時(毫秒)

與 Claude Code 的整合

在 Claude Code 中使用時,請指定 socket 路徑:

claude code --socket ./cmux.sock

然後您可以使用 CLI 命令與 cmux 互動:

# 在 Claude Code 中執行 cmux 命令
cmux session create "執行測試"
cmux browser open https://claude.ai
cmux agent deploy "data-analyzer"

故障排除

  • 無法連線至 socket:請確保伺服器正在執行 (cmux server),且 socket 路徑正確。
  • 工作階段未回應:檢查 max_sessions 設定;您可能已達到限制。
  • 瀏覽器無法啟動:驗證是否已安裝 Playwright 及其相依性。
  • 代理通訊失敗:檢查 agent_pool_size 是否足夠應付負載。

如需更多協助,請參閱文件或在儲存庫中開啟問題。

授權

MIT

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

aradotso/724-office-ai-agent

Self-evolving AI agent system with 26 tools, three-layer memory, MCP plugins, and 24/7 self-repair in pure Python.

aradotso/agency-agents-ai-specialists

A collection of specialized AI agent personalities for Claude Code, Cursor, Aider, Windsurf, and other AI coding tools — covering engineering, design, marketing, sales, and more.

aradotso/agent-browser-automation

Headless browser automation CLI for AI agents using native Rust binary with Chrome DevTools Protocol

aradotso/antigravity-manager

AI coding agent skill for Antigravity Manager — a Tauri v2 + Rust desktop app and Docker service that manages multiple Google/Anthropic accounts and proxies them as standard OpenAI/Anthropic/Gemini API endpoints with intelligent account rotation.

aradotso/aracli-deploy-management

Guide to deploying and managing OpenClaw-compatible AI agent systems across cloud, bare metal, and hybrid infrastructure.

aradotso/autoresearchclaw-autonomous-research

Fully autonomous research pipeline that turns a topic idea into a complete academic paper with real citations, experiments, and conference-ready LaTeX.

aradotso/autoresearch-genealogy

Structured prompts, vault templates, and autonomous research workflows for AI-assisted genealogy using Claude Code.

aradotso/brreg

Search and retrieve Norwegian company data from Brønnøysundregistrene (the Norwegian Business Registry). Access all ~1.2 million registered companies in Norway.

aradotso/chrome-cdp-live-browser

Give AI agents access to your live Chrome session via CDP — interact with open tabs, logged-in accounts, and current page state

aradotso/claude-hud-statusline

A Claude Code plugin that displays a real-time HUD showing context usage, active tools, running agents, and todo progress in your terminal statusline.

aradotso/claude-peers-mcp

Enable multiple Claude Code instances to discover each other and exchange messages in real-time via a local broker daemon and MCP server.

aradotso/clui-cc-claude-overlay

Command Line User Interface for Claude Code — a floating macOS desktop overlay with multi-tab sessions, permission approval UI, voice input, and skills marketplace.

aradotso/code-review-graph

Build a persistent knowledge graph of your codebase so Claude reads only what matters — up to 49x fewer tokens on coding tasks.

aradotso/codex-autoresearch-loop

Self-directed iterative research skill for Codex that continuously cycles through modify, verify, retain or discard, and repeat until a measurable goal is reached.

aradotso/copaw-ai-assistant

Personal AI assistant framework supporting multiple chat channels (DingTalk, Feishu, QQ, Discord, etc.) with extensible skills, local/cloud deployment, and cron scheduling.

aradotso/corridorkey-green-screen

AI-powered green screen keyer that unmixes foreground colors and generates clean linear alpha channels using neural networks

aradotso/crucix-intelligence-dashboard

Personal intelligence agent that aggregates 27 OSINT data sources into a self-hosted Jarvis-style dashboard with Telegram/Discord bots, LLM analysis, and real-time alerts.

aradotso/daily-stock-analysis

LLM-powered A/H/US stock intelligent analysis system with multi-source data, real-time news, AI decision dashboards, and multi-channel push notifications via GitHub Actions.

aradotso/deepseek-ocr

Expert skill for using DeepSeek-OCR, a vision-language model for optical character recognition with context optical compression supporting documents, PDFs, and images.

aradotso/edict-multi-agent-orchestration

Install and use the Edict (三省六部) multi-agent orchestration system with 12 specialized AI agents, real-time kanban dashboard, and audit trails

相關技能