Skip to content

Installation and Updates zh CN

ChrAlpha edited this page Nov 12, 2026 · 5 revisions
🇬🇧English | 🇨🇳中文

安装与更新

环境要求

Linux 或 macOS(amd64 或 arm64)、tmux 3.2 或更新版本、TPM、curl,以及 Claude Code、Codex、Pi、oh-my-pi 中的任意一个或多个。

安装

交给 agent 安装

在 tmux pane 中运行的 coding agent 里粘贴:

Read https://raw.githubusercontent.com/ChrAlpha/tmux-agent-experience/main/SKILL.md and follow it to install or update tmag for the AI tool I am using.

Agent 会先征得你同意再修改 tmux 配置,随后安装插件、接入当前使用的 agent 宿主,并验证结果。SKILL.md 是这套流程的完整说明,也可直接阅读。更新时使用同一段 prompt。

手动安装

  1. 在 tmux.conf 中加入插件,然后按 prefix + I:

    set -g @plugin 'ChrAlpha/tmux-agent-experience'

    插件加载时下载与自身版本匹配的已发布 tmag binary,校验 SHA-256,存入自己的目录:$TMUX_PLUGIN_MANAGER_PATH/tmux-agent-experience/bin/,通常为 ~/.tmux/plugins/tmux-agent-experience/bin/。

    版本检查在同一个后台安装任务中执行。两次 curl 下载各有 10 秒连接超时和 25 秒总传输超时,不重试。这些是网络超时;本地工具、文件系统及已有 executable 的运行不受整次安装的统一 deadline 约束。安装文件在 bin/ 内暂存,checksum 和版本验证通过后才原子替换 executable。

    同时运行的多个安装任务各自发布同一个 release;中途被打断的安装任务不会留下阻塞后续安装的东西。缺少 curl 会报错,安装过程不会回退到从源码构建。

  2. 按 prefix + M-a。弹窗展示通过已安装的各个 agent 自己的 plugin manager 接入的命令,经你确认后执行并检查结果。每个 agent 安装两个插件:tmag 通过 hooks 上报状态;tmag-peers 提供 skill,让 agent 知道如何通过 tmag 与其他 agents 协作,详见 Agent 协作。Pi 和 oh-my-pi 没有 hooks,它们的 tmag 是负责上报的 extension。两者都从插件自己的目录以 packages 形式安装(pi install、omp plugin install),因此 packages 始终与 binary 匹配,并随插件一起更新。

  3. 在 tmux panes 中启动新的 agent sessions。Codex 中通过 /hooks 批准 tmag 的 hooks,再运行一次 /title 启用 thread-id,详见 Session 与 pane。

不使用 TPM 时,clone 仓库,并在 tmux.conf 中运行插件入口:

git clone https://github.com/ChrAlpha/tmux-agent-experience ~/.tmux/plugins/tmux-agent-experience
run-shell ~/.tmux/plugins/tmux-agent-experience/tmag.tmux

更新

prefix + U 更新 tmux 插件,下次加载时会下载匹配的 binary。随后按 prefix + M-a,将 agent 插件更新到相同版本。

Codex 的 hooks 批准与插件版本绑定,因此每次更新后,都需在新的 Codex session 中通过 /hooks 重新批准 tmag 的 hooks。Pi 和 oh-my-pi 的 packages 随插件更新,新的 sessions 会加载它们。

卸载

tmag uninstall 会打印准确的移除步骤。Pi 和 oh-my-pi 的 packages 从插件目录安装,需先于插件移除。需要清理状态时,在 binary 仍已安装的情况下运行 tmag uninstall --purge。移除范围见文件与运行占用。

Clone this wiki locally