← Back to Docs

Architecture

ETerm technical architecture

Tech Stack

LayerTechnologyNotes
AppSwift, SwiftUImacOS 14+
RenderingRustPerformance-critical, via FFI
GPUMetalNative macOS graphics
IPCUnix Domain SocketPlugin communication
PluginsDynamic bundlesETermKit SDK

High-Level Architecture

┌─────────────────────────────────────┐
│           ETerm.app (Swift)         │
│                                     │
│  ┌─────────┐ ┌─────────┐ ┌───────┐  │
│  │ Terminal│ │ Layout  │ │  MCP  │  │
│  └─────────┘ └─────────┘ └───────┘  │
│                                     │
│  ┌─────────────────────────────────┐│
│  │         Plugin Framework        ││
│  └─────────────────────────────────┘│
└──────────────┬──────────────────────┘
               │ FFI (C ABI)
┌──────────────▼──────────────────────┐
│     Rust Rendering Engine           │
│         (sugarloaf-ffi)             │
└──────────────┬──────────────────────┘
               │ Metal
┌──────────────▼──────────────────────┐
│              GPU                    │
└─────────────────────────────────────┘

Directory Structure

ETerm/
├── ETerm/
│   ├── Application/     # App lifecycle, commands, events
│   ├── Core/
│   │   ├── Terminal/    # Terminal emulation (DDD)
│   │   ├── Layout/      # Panel, Tab, Divider
│   │   ├── Keyboard/    # Input, IME, Shortcuts
│   │   ├── Settings/    # Configuration
│   │   └── Events/      # EventBus
│   └── Features/
│       ├── MCP/         # MCP server implementation
│       ├── AI/          # AI integration
│       └── Plugins/     # Plugin framework
├── Plugins/             # 11 built-in plugins
├── Packages/
│   └── ETermKit/        # Plugin SDK framework
└── rio/
    └── sugarloaf-ffi/   # Rust rendering engine

Core Modules

ModulePurpose
TerminalTerminal emulation, PTY management, state handling
LayoutPanel splitting, tab management, drag & drop
KeyboardInput handling, IME support, shortcut binding
MCPModel Context Protocol server for AI tools
PluginsPlugin loading, lifecycle, host bridge

FFI Layer

Swift and Rust communicate via C ABI. The Rust layer handles:

  • Terminal state and rendering
  • Text selection
  • GPU rendering via Metal

Plugin System

Plugins are dynamic bundles (.bundle) built with ETermKit SDK. They run in the main process and can:

  • Add sidebar views
  • Decorate tabs
  • Register commands
  • Subscribe to events

See Plugin SDK for development guide.