Herdr
Cheat Sheet
“The runtime your coding agents live on — laptop, desktop, or a box you rent.” Herdr là background server giữ terminal của AI coding agent chạy liên tục — sống qua mất mạng, đóng nắp máy, restart. Multiplexer “mouse-first” quen thuộc như tmux (prefix Ctrl+b), nhận diện sẵn 19 agent CLI: Claude Code, Codex, Cursor…
Herdr là gì?
Một runtime dạng server giữ các phiên terminal thật luôn mở để coding agent làm việc liên tục mà không cần bạn ngồi canh. Herdr theo dõi agent nào đang chạy, bị chặn hay rảnh, cho agent tự tách pane & gọi lẫn nhau qua CLI/socket, và khôi phục layout sau khi restart máy. Từ máy nào có bàn phím cũng reconnect lại được. Backed by Y Combinator, phát hành dưới Apache 2.0.
Always running
Terminal vẫn sống khi bạn đóng nắp máy hay mất mạng. Detach client thì server vẫn chạy nền, process không dừng.
Agent status visibility
Hiện agent nào đang working, blocked hay idle. Trạng thái roll-up lên tab & workspace, nhảy thẳng tới pane cần chú ý.
Agent-native API
Agent tự split pane, khởi động agent khác và giao tiếp qua CLI herdr hoặc raw socket (pane.split, agent.wait…).
Universal compatibility
Chạy Claude Code, Codex, Cursor, opencode, Grok… 19 agent CLI không cần chỉnh sửa. Session & layout tự khôi phục sau khi restart.
Khác gì cmux? cmux là app terminal GUI chạy local trên macOS (Ghostty, browser tích hợp) — đóng app là process dừng. Herdr là server chạy nền mọi nơi (laptop, desktop, VPS thuê): agent vẫn chạy tiếp khi bạn detach, đóng máy hay mất mạng, và reconnect được từ máy khác.
Tính năng chính
Detach client, đóng nắp máy hay rớt mạng — server vẫn chạy, process không dừng. Đây là mức bền nhất.
Tự phát hiện agent đang working, blocked hay idle; roll-up lên tab & workspace, không phải hunt pane nào đang kẹt.
CLI & raw socket hợp nhất. Agent phối hợp bằng block thật (agent.wait) thay vì mô phỏng keystroke.
Binary agent hiện có chạy nguyên xi — không cần lớp wrapper, không đổi lệnh quen thuộc.
Attach lại phiên đang chạy từ bất kỳ máy nào có bàn phím. Bắt đầu ở laptop, tiếp tục trên desktop.
Khôi phục workspace/tab/pane sau khi restart; agent tự resume, pane history replay (experimental).
Click để focus, kéo viền để resize, right-click mở menu. Không cần học shortcut để bắt đầu — vẫn có prefix kiểu tmux khi cần.
Claude Code, Codex, Cursor, Pi, opencode, Grok, Copilot, Hermes… nhận diện out-of-the-box qua hooks hoặc screen-manifest.
Quick Start
Install (macOS/Linux)
curl -fsSL https://herdr.dev/install.sh | shHoặc brew install herdr · mise use -g herdr. Windows (beta): irm https://herdr.dev/install.ps1 | iex.
Launch
herdrChạy từ thư mục project bất kỳ → Herdr tạo hoặc attach vào default background session. Bạn không phải quản lý socket.
Chạy agent trong pane
claude
codex
pi
opencodeGõ tên agent CLI trong pane bất kỳ. Herdr tự phát hiện & theo dõi trạng thái. Detach: Ctrl+b rồi q.
CLI & Socket API
Mọi thao tác đều có subcommand herdr tương ứng, hoặc gọi trực tiếp qua raw socket theo dot-notation (pane.split, layout.export…). Target pane dạng w1:p1 hoặc --current.
Workspaces & tabs
workspace create--cwd ~/project --label apitab create--label logsstatusTổng quan trạng thái hiện tạiapi snapshotSnapshot toàn bộ stateapi schema [--json]Schema của socket APIPanes — layout
pane split w1:p1--direction rightpane run w1:p2"npm test"pane resize--direction right --amount 0.1pane swap--direction right --currentpane zoom--on --currentpane neighbor--direction right --currentPanes — đọc output
pane read --source recent--lines 50pane read --source visible--lines 80pane read --source detectionVùng agent-detectionpane layout --currentCây layout hiện tạiRaw socket methods
pane.split · pane.readTách & đọc panepane.send_text · send_keysGửi text / phímpane.focus · move · swapĐiều hướng panelayout.apply · layout.exportÁp / xuất layoutevents.subscribe · waitNghe/chờ eventAgent integration
Herdr tự phát hiện các agent phổ biến: Claude Code, Codex, Cursor Agent CLI, OpenCode, Grok CLI, GitHub Copilot CLI, Devin CLI, Kimi Code CLI, Pi, OMP và nhiều CLI khác. Trạng thái xác định qua lifecycle hooks (agent được tích hợp) hoặc screen-manifest detection (phân tích buffer terminal). Gemini CLI & Cline được phát hiện nhưng ít được kiểm thử hơn.
Integration & attach
integration install claudeCài hook cho agentintegration statusKiểm tra version integrationagent attach reviewerAttach thẳng vào agent terminalagent attach reviewer --takeoverAttach & chiếm quyền điều khiểnLabel, wait & debug
agent rename w1:p1 reviewerĐổi tên hiển thịagent rename reviewer --clearXóa nhãnagent wait w1:p1 --until doneChờ agent xong (hoặc blocked)agent explain <target>Giải thích trạng thái phát hiện
Báo metadata thủ công cho source ngoài luồng: herdr pane report-agent w1:p1 --source custom:indexer --agent docs-bot --state working. Cập nhật lại manifest: herdr server update-agent-manifests.
Keybindings
Prefix mặc định là Ctrl+b (tương thích workflow tmux). Nhấn prefix rồi phím lệnh. Xem toàn bộ binding với prefix+?. Đổi trong [keys] của config, rồi herdr server reload-config. Không cần học shortcut để bắt đầu — click chuột cũng được.
Panes & tabs
prefix+vSplit sang phảiprefix+minusSplit xuống dướiprefix+cTab mớiprefix+nTab kế tiếpprefix+pTab trước đóWorkspaces & client
prefix+wĐiều hướng workspaceprefix+shift+nWorkspace mớiprefix+qDetach client (server vẫn chạy)prefix+?Hiện mọi keybindingMouse-first: click pane/tab/workspace/agent để focus, kéo viền split để resize, right-click mở context menu.
Cấu hình
Định dạng TOML tại ~/.config/herdr/config.toml (Linux/macOS) hoặc %APPDATA%\herdr\config.toml (Windows). Chạy herdr --help để xem đường dẫn thực tế, sửa xong reload bằng herdr server reload-config.
Đổi prefix: prefix = "ctrl+b". Mỗi action nhận mảng shortcut, ví dụ next_tab = ["prefix+n", "ctrl+alt+]"].
name = "catppuccin" hoặc dùng màu terminal. Tự đổi sáng/tối với auto_switch = true + light_name/dark_name.
Bố trí sidebar Agent/Space bằng mảng rows với token state_icon, workspace, tab, agent.
Chọn kênh toast: herdr, terminal, system hoặc off; đặt vị trí (vd bottom-right).
Đặt shell mặc định: default_shell = "nu". Các tùy chọn scrollback & nâng cao xem Config reference.
Bật replay lịch sử pane: [experimental] pane_history = true. Tắt auto-resume agent: resume_agents_on_restore = false.
Session persistence
Điểm Herdr khác hẳn một terminal GUI local: detach không giết process. Có hai mức — ngắt kết nối (server vẫn sống) và restart máy (process buộc dừng, chỉ khôi phục được layout).
Detach / mất mạng — server vẫn chạy
Sau khi restart máy / server
Dừng hẳn server: herdr server stop. Nâng cấp mà giữ tiến trình đang chạy (experimental): herdr update --handoff.
Dùng thực tế
Tài liệu & cộng đồng
Landing, installer & tổng quan tính năng.
herdr.devQuick start, install, agents, session state, configuration, socket API.
herdr.dev/docsMã nguồn, releases, issues. Backed by Y Combinator · Apache 2.0.
github.com/herdrdev/herdrCài nhanh trên macOS/Linux.
curl -fsSL https://herdr.dev/install.sh | sh