How manaflow-ai/cmux works
cmux is a native macOS terminal and browser for developers working with AI coding agents. The main workflow is to create and organize workspaces and split panes, run local or remote terminals, and receive agent notifications in the sidebar when attention is needed. The CLI and socket API automate those operations; browser panes support scripted interaction. The graph includes documented capabilities and indexed core modules, plus catalog-query relationships visible in excerpts. Several runtime modules are indexed but unsampled, so their internal call paths are not inferred.
Main entry points: Workspace.swift Workspace state · cmux.swift CLI and socket API · SurfaceCatalog.swift Surface catalog · SurfaceCatalogQueryService.swift Catalog queries
Components 22
Workspaces and terminals
- Workspace state
Sources/Workspace.swift - Terminal runtime
Sources/TerminalController.swift - Split layout
Sources/DockSplitStore.swift - SSH sessions
CLI/CMUXCLI+SSHTui.swift - In-app browser
CLI/CMUXCLI+BrowserRepl.swift
Agent notifications
- Agent work feed
Sources/Feed/FeedCoordinator.swift - Notification reconciliation
Packages/macOS/CmuxAgentJournal/Sources/CmuxAgentJournal/AgentNotificationReconciler.swift - Agent sessions
Sources/Mobile/AgentChat/AgentChatSessionRegistry.swift
Surface catalog
- Surface catalog
Sources/Surfaces/SurfaceCatalog.swift - Surface providers
Sources/Surfaces/SurfaceProvider.swift - Catalog queries
Sources/Surfaces/SurfaceCatalogQueryService.swift - Current work query
Sources/Surfaces/CurrentWorkQueryService.swift - Cloud workspace creation
Sources/Surfaces/CloudWorkspaceCreationCoordinator.swift
Automation and control
- CLI and socket API
CLI/cmux.swift - Automation rules
Sources/AutomationEngine.swift - Command palette
Packages/macOS/CmuxCommandPalette/Sources/CmuxCommandPalette/Search/CommandPaletteSearchEngine.swift
Shared services
- Event bus
Sources/CmuxEventBus.swift - Diagnostic logging
Packages/Shared/CMUXMobileCore/Sources/CMUXMobileCore/DiagnosticLog.swift - Peer connectivity
Packages/Shared/CmuxIrohTransport/Sources/CmuxIrohTransport/CmxConnectivityPeerSession.swift - Transport trust
Packages/Shared/CmuxIrohTransport/Sources/CmuxIrohTransport/CmxIrohTrustBrokerClient.swift - Machine identity
Packages/macOS/CmuxSurfaceCatalogModel/Sources/CmuxSurfaceCatalogModel/SurfaceMachineID.swift
Other components
- Developer
Connections 23
- Developer → Workspace state: creates and organizes
README.md - Developer → Terminal runtime: runs commands
README.md - Developer → In-app browser: scripts browser
README.md - Developer → CLI and socket API: controls app
README.md - Workspace state → Split layout: organizes panes
README.md - Workspace state → Terminal runtime: hosts terminals
README.md - Workspace state → In-app browser: hosts browser pane
README.md - Developer → SSH sessions: starts remote session
README.md - Terminal runtime → Notification reconciliation: emits agent signals
README.md - CLI and socket API → Notification reconciliation: sends notifications
README.md - Notification reconciliation → Agent work feed: surfaces agent activity
- CLI and socket API → Workspace state: controls workspaces
README.md - CLI and socket API → In-app browser: controls browser
README.md - Automation rules → Event bus: subscribes to events
Sources/AutomationEngine.swift - Catalog queries → Surface catalog: reads and refreshes
Sources/Surfaces/SurfaceCatalogQueryService.swift - Surface catalog → Surface providers: refreshes and materializes
Sources/Surfaces/SurfaceCatalog.swift - Cloud workspace creation → Surface catalog: creates cloud workspaces
Sources/Surfaces/SurfaceCatalog.swift - Current work query → Surface catalog: captures catalog
Sources/Surfaces/CurrentWorkQueryService.swift - Current work query → Agent sessions: reads agent records
Sources/Surfaces/CurrentWorkQueryService.swift - Catalog queries → Machine identity: resolves machine
Sources/Surfaces/SurfaceCatalogQueryService.swift - Catalog queries → Surface providers: resolves provider
Sources/Surfaces/SurfaceCatalogQueryService.swift - Developer → Command palette: searches commands
README.md - Peer connectivity → Transport trust: uses trust broker