blog.dopana

Back

9 tháng trước, Mitchell Hashimoto công bố libghostty. Hôm nay, 25+ project AI agent đã xây dựng trên nó.

Không phải ngẫu nhiên. AI coding agents (Claude Code, OpenCode, Codex) cần terminal — và libghostty là cách embed terminal đúng đắn nhất hiện tại.

AI Agent Ecosystem 2026
                         ┌─────────────────┐
Claude Code ────────────→│                 │
OpenCode   ────────────→│  libghostty      │
Codex      ────────────→│  terminal core   │
Cline      ────────────→│  (C API, WASM)   │
                         └─────────────────┘

                    Workspace app UI (SwiftUI/GPUI/Tauri)
plaintext

Tại Sao AI Agent Cần Terminal?#

AI coding agents hoạt động theo vòng lặp:

Read code → Plan → Write code → Run command → Read output → Repeat

                             Cần terminal
plaintext

Không phải terminal “gõ lệnh xem output” đơn giản. Agent cần:

  • Nhiều terminal song song — chạy test, build, dev server cùng lúc
  • Theo dõi trạng thái — agent nào đang chạy, output gì
  • Session persistence — không mất context khi restart
  • Programmatic access — đọc/write terminal programmatically
  • Isolation — mỗi agent một sandbox riêng

Workspace app cho AI agents là thể loại app mới — và libghostty là terminal engine được chọn.

The Big Players#

Mux (coder.com)#

# Desktop + browser app cho isolated, parallel agentic development
- Multiple agent sessions side-by-side
- Terminal rendering via libghostty
- Web version dùng ghostty-web (xterm.js API compatible)
bash

Tác giả coder.com cũng tạo ghostty-weblibghostty-vt-node — đầu tư sâu vào ecosystem.

Ghostree#

Ghostty fork thêm:

  • Native git worktree support
  • AI agent integration
  • Mỗi worktree = môi trường riêng cho agent

AiyuTerm#

macOS native:
├── Multi-repo sidebar
├── Persistent split layouts
├── SSH + tmux support
├── Real-time AI agent status dashboard
└── libghostty terminal core
plaintext

Supacode#

Open-source macOS “command center” cho coding agents:

# Chạy nhiều agents song song
supacode run --agent claude --task "Fix bug in auth"
supacode run --agent opencode --task "Add tests"
supacode ps # Xem trạng thái tất cả agents
bash

Parallel Agent Workflow#

Xu hướng mới: chạy nhiều agents song song trên cùng workspace.

Workspace App
├── Agent 1: Claude Code → refactor API layer        [running]
│   └── terminal: npm test -- --watch
├── Agent 2: OpenCode → implement user authentication [idle]
│   └── terminal: waiting for review
├── Agent 3: Codex → write documentation              [done]
│   └── terminal: output archived
└── Agent 4: Cline → database migration               [error]
    └── terminal: schema conflict detected
plaintext

Các app như Mux0, cmux, moss, Factory Floor đều theo pattern này. libghostty cho phép mỗi agent có terminal riêng, mỗi terminal chạy trong process riêng, render độc lập.

Agent-Aware Features#

Status Tracking#

// libghostty-vt cho phép đọc terminal state real-time
// App dùng để hiển thị trạng thái agent
interface AgentSession {
  terminal: VirtualTerminal
  status: 'running' | 'idle' | 'error' | 'done'
  command: string
  output: string  // Từ libghostty get_text()
  exitCode?: number
}
typescript

App như AiyuTerm, in0, Zentty hiển thị trạng thái agent bên cạnh terminal — màu xanh/đỏ/vàng, thời gian chạy, lệnh hiện tại.

Notification on Completion#

// cmux — macOS notifications cho AI agents
// Khi agent chạy xong hoặc lỗi → notification
// libghostty cho biết terminal đã có output mới
swift

Session Persistence#

// Zmx — dùng libghostty-vt để save/restore terminal state
// Agent chạy dở → restart → restore nguyên trạng thái
go

Agent Sandbox#

Agent sandbox (codelima)
├── VM cô lập
├── libghostty terminal
├── Filesystem riêng
└── Network policy riêng
plaintext

Workspace App Categories#

Terminal Multiplexer cho Agents#

AppPlatformĐặc điểm
Mux0macOSWorkspaces, tabs, split panes. Live status cho Claude Code, OpenCode, Codex
cmuxmacOSVertical tabs, notifications cho AI agents
ForgemacOSMultiplexer cho parallel CLI agents + long-running tasks
MuxymacOSSwiftUI multiplexer
MorimacOSWorkspace tổ chức theo project + worktree, tmux + libghostty

AI-Native Terminal#

AppPlatformĐặc điểm
blinkmacOSAI terminal hiện đại
limpidmacOSmacOS-native cho AI coding agent era
wittyCross-platformPython + Qt6 + Rust, AI-powered
frepmacOSAgentic terminal emulator
con-terminalmacOSBuilt-in AI harness

Multi-Agent Workspace#

AppPlatformĐặc điểm
SupacodemacOSCommand center chạy agents song song, open-source
mossmacOSMulti-terminal canvas, agent status tracking, file preview
AiyuTermmacOSMulti-repo sidebar, SSH, tmux, real-time agent status
Factory FloormacOSParallel development + git worktrees + Claude Code agents
paulattymacOSAI agent team workspace
taskersmacOSAgent-first terminal workspace, Rust shell, Niri-like tiling
ZenttymacOSVertical tabs, worklanes, notifications, agent-aware sidebar
in0macOSMultiplexer với live AI agent status
agtmux-termmacOSAI-agent-aware terminal, SwiftUI sidebar

Agent IDE#

AppPlatformĐặc điểm
moai-studioCross-platformRust + GPUI, SPEC-first development, MoAI-ADK
YENmacOSTerminal-first IDE, speech-to-text, themes, notifications
TheCommandermacOSDiff review, git workflow, worktree management
ADHDevCross-platformSelf-hosted control plane cho AI coding agents

Agent Infrastructure#

AppPlatformĐặc điểm
codelimamacOSChạy agents trong VM sandbox cô lập
wisptermCross-platformTerminal workspace cho remote development + AI agents
GhostreemacOSGhostty fork + git worktree + AI agents
AizenmacOSWorkspace cho parallel development

Tại Sao libghostty Thắng Thế Này?#

So sánh với các lựa chọn khác cho AI agent terminal:

Tiêu chíxterm.jslibvteTự viếtlibghostty
Native perf❌ (JS)⚠️✅ (Zig)
Embed C API
Zero dependency
WASM
Kitty protocol
Tmux control
Programmatic read⚠️
macOS native⚠️

xterm.js là lựa chọn cũ (VS Code dùng). Nhưng cho native macOS app, xterm.js nghĩa là nhúng cả Chromium/WebView — nặng, chậm.

libghostty native, nhẹ (~14KB), C API = gọi từ Swift/Rust/Go dễ dàng.

Tương Lai: Terminal Cho AI Agents#

Xu hướng đang hình thành:

  1. Từ terminal app → agent workspace: Không chỉ gõ lệnh, mà quản lý agents
  2. Multi-agent parallel: Nhiều agents chạy cùng lúc, mỗi agent terminal riêng
  3. Programmatic terminal: AI đọc/write terminal trực tiếp, không qua UI
  4. Session persistence: Terminal state sống qua restart
  5. Remote agents: Agents chạy trên server, terminal render local (libghostty + WASM)

libghostty là nền tảng cho tầm nhìn này. Terminal không còn là app — terminal là component.

Tổng Kết#

25+ AI agent project trên libghostty trong 9 tháng không phải ngẫu nhiên.

# 2025: libghostty ra mắt
# 2026: 25+ AI agent apps built on libghostty
# Next: terminal là component, workspace cho agents là app
bash

libghostty cung cấp terminal engine đúng cho kỷ nguyên AI coding agents: native, nhẹ, C API, WASM, programmatic access. Còn lại là workspace UX do cộng đồng xây.

Tài liệu tham khảo#