显示HN:Agent-of-empires:OpenCode和Claude Code会话管理器
Show HN: Agent-of-empires: OpenCode and Claude Code session manager

原始链接: https://github.com/njbrake/agent-of-empires

## Agent of Empires (aoe) - AI 代码会话管理器 Agent of Empires (aoe) 是一个基于 Rust 的终端会话管理器,适用于 Linux 和 macOS,围绕 tmux 的强大功能构建。它通过将每个会话封装在一个专用的 tmux 实例中,简化了像 Claude Code 和 OpenCode 这样 AI 代码代理的管理和监控。 **主要特性:** * **tmux 集成:** 利用 tmux 实现可靠的会话持久性。 掌握基本的 tmux 知识(尤其是 `Ctrl+b d` 用于分离)会有帮助。 * **TUI 仪表盘:** 提供会话控制的可视化界面。 * **会话和分组管理:** 创建、连接、分离、删除会话,并将会话组织到文件夹中。 * **状态检测:** 自动识别 Claude Code 和 OpenCode 的状态。 * **多配置支持:** 为不同的项目或客户隔离工作区。 **安装:** 可以通过 `curl`、Homebrew (`brew install njbrake/aoe/aoe`) 或从源代码使用 `cargo` 进行安装。 配置存储在 `~/.agent-of-empires/` 中。 对于移动 SSH 客户端,建议在 *tmux 会话内* 运行 `aoe`。 它受到 agent-deck 的启发,并采用 MIT 许可。

## Agent-of-Empires:一个用于管理LLM会话的CLI工具 Mozilla.ai的ML工程师Nathan创建了**agent-of-empires (aoe)**,一个基于Rust的CLI工具,旨在简化对本地大型语言模型(LLM)的使用,例如通过OpenCode和Claude Code访问的模型。认识到本地LLM通常比托管模型慢,aoe解决了在等待代理响应时来回切换多个终端窗口的困扰。 Aoe在tmux中监控LLM会话的状态(运行中、空闲、等待输入),允许用户快速查看和切换它们。功能包括会话命名、分组和可配置的配置文件。开发者正在探索诸如使用Docker进行沙盒化和改进Git工作树支持等功能。 该项目旨在通过减少管理多个会话的开销,使自托管LLM更具可行性。它可以通过`curl`或`brew install`获得,开发者欢迎反馈和功能建议。讨论强调了对代理编排工具日益增长的需求,以及对更简洁的API来控制这些代理的渴望。
相关文章

原文

A terminal session manager for Linux and MacOS using tmux to aid in management and monitoring of AI coding agents, written in Rust.

Agent of Empires TUI

Quick install (Linux & macOS):

curl -fsSL \
  https://raw.githubusercontent.com/njbrake/agent-of-empires/main/scripts/install.sh \
  | bash

Homebrew:

brew install njbrake/aoe/aoe

Update via brew update && brew upgrade aoe.

Build from source:

git clone https://github.com/njbrake/agent-of-empires
cd agent-of-empires
cargo build --release

Agent of Empires (aoe) is a wrapper around tmux, the terminal multiplexer. Each AI coding session you create is actually a tmux session under the hood.

Once you attach to a session, you're working directly in tmux. Basic tmux knowledge helps:

tmux Command What It Does
Ctrl+b d Detach from session (return to Agent of Empires)
Ctrl+b [ Enter scroll/copy mode
Ctrl+b n / Ctrl+b p Next/previous window

If you're new to tmux, the key thing to remember is Ctrl+b d to detach and return to the TUI, and that with Claude Code you'll need to enter scroll mode in order to scroll up in the Claude Code window (this isn't necessary when using opencode).

  • TUI Dashboard - Visual interface to manage all your AI coding sessions
  • Session Management - Create, attach, detach, and delete sessions
  • Group Organization - Organize sessions into hierarchical folders
  • Status Detection - Automatic status detection for Claude Code and OpenCode
  • tmux Integration - Sessions persist in tmux for reliability
  • Multi-profile Support - Separate workspaces for different projects
# Launch the TUI
aoe

# Or add a session directly from CLI
aoe add /path/to/project

Profiles let you maintain separate workspaces with their own sessions and groups. This is useful when you want to keep different contexts isolated—for example, work projects vs personal projects, or different client engagements.

aoe                 # Uses "default" profile
aoe -p work         # Uses "work" profile
aoe -p client-xyz   # Uses "client-xyz" profile

Each profile stores its own sessions.json and groups.json, so switching profiles gives you a completely different set of sessions.

Configuration is stored in ~/.agent-of-empires/:

~/.agent-of-empires/
├── config.toml           # Global configuration
├── profiles/
│   └── default/
│       ├── sessions.json # Session data
│       └── groups.json   # Group structure
└── logs/                 # Session logs
Variable Description
AGENT_OF_EMPIRES_PROFILE Default profile to use
AGENT_OF_EMPIRES_DEBUG Enable debug logging
# Check code
cargo check

# Run tests
cargo test

# Format code
cargo fmt

# Lint
cargo clippy

# Run in debug mode
AGENT_OF_EMPIRES_DEBUG=1 cargo run

# Build release binary
cargo build --release

Using aoe with mobile SSH clients (Termius, Blink, etc.)

If you're connecting via SSH from a mobile app like Termius, you may encounter issues when attaching to sessions. The recommended approach is to run aoe inside a tmux session:

# Start a tmux session first
tmux new-session -s main

# Then run aoe inside it
aoe

When you attach to an agent session, tmux will switch to that session. To navigate back to aoe use the tmux command Ctrl+b L to switch to last session (toggle back to aoe)

Claude Code is flickering

This is not an issue with aoe: it's a known problem with Claude Code: anthropics/claude-code#1913

Inspired by agent-deck (Go + Bubble Tea).

MIT License - see LICENSE for details.

联系我们 contact @ memedata.com