tmux-team 1.1.0 β†’ 2.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,13 +1,76 @@
1
- # tmux-team
1
+ # πŸ€– tmux-team
2
2
 
3
- CLI for multi-agent collaboration in tmux. Coordinate AI agents (Claude, Codex, Gemini) working in different panes.
3
+ **The lightweight coordination layer for terminal-based AI agents.**
4
4
 
5
- ## Installation
5
+ tmux-team is a protocol-agnostic "Team Lead" that enables multi-agent collaboration directly within your existing tmux workflow. It provides the transport layer, synchronization, and project management needed to turn a collection of isolated terminal panes into a coordinated AI task force.
6
+
7
+ ---
8
+
9
+ ## πŸ›‘ The Problem
10
+
11
+ As we move from "Chat with an AI" to "Orchestrating a Team," we face major friction points:
12
+
13
+ 1. **Isolation** β€” Agents in different panes (Claude, Gemini, local LLMs) have no way to talk to each other
14
+ 2. **Synchronization** β€” Humans are stuck in a "manual polling" loopβ€”waiting for an agent to finish before copying its output to the next pane
15
+ 3. **Tool Restrictions** β€” AI agents operate under tool whitelists; using `sleep` or arbitrary shell commands is dangerous or blocked
16
+ 4. **Token Waste** β€” Repeated polling instructions burn context tokens unnecessarily
17
+
18
+ ---
19
+
20
+ ## πŸš€ Our Niche: The Universal Transport Layer
21
+
22
+ Unlike heavyweight frameworks that require specific SDKs or cloud infrastructure, tmux-team treats the **terminal pane as the universal interface**.
23
+
24
+ - **Model Agnostic** β€” Works with Claude Code, Gemini CLI, Codex, Aider, or any CLI tool
25
+ - **Zero Infrastructure** β€” No servers, no MCP setup, no complex configuration. If it runs in tmux, tmux-team can talk to it
26
+ - **Whitelist-Friendly** β€” A single `tmux-team talk:*` prefix covers all operations, keeping AI tool permissions simple and safe
27
+ - **Local-First** β€” Per-project `tmux-team.json` lives with your repo; global config in `~/.tmux-team/` (v2)
28
+
29
+ ---
30
+
31
+ ## 🧠 Design Philosophy
32
+
33
+ > *These principles guide our design decisions.*
34
+
35
+ ### 1. Deterministic Transport (`--delay` vs. `sleep`)
36
+
37
+ **The Problem**: Tool allowlists typically approve one safe command (`tmux-team talk ...`) but not arbitrary shell commands. Using `sleep` is often blocked by security policies, requires shell availability and proper quoting, and creates a separate process that's hard to manage.
38
+
39
+ **The Why**: Internal delay keeps the workflow as a single tool call. This guarantees "First-Packet Integrity"β€”the CLI validates units (`500ms`, `2s`) and ensures the TTY buffer is ready to receive input specifically for that agent. No shell dependency, no policy friction.
40
+
41
+ ### 2. Stateless Handshakes (The "Nonce" Strategy)
42
+
43
+ **The Problem**: Terminal panes are streams, not RPC channels. A simple `[DONE]` string could already be in scrollback, or the agent might say "I'm almost done" and trigger a false positive.
44
+
45
+ **The Why**: We use a unique **Nonce** (Number used once) for every request: `{tmux-team-end:8f3a}`.
46
+ - **Collision Avoidance** β€” Prevents matching markers from previous turns
47
+ - **Completion Safety** β€” Ensures the agent has truly finished, not just paused mid-response
48
+ - **Zero-API RPC** β€” Creates request/response semantics over a standard TTY without requiring agents to support a special protocol
49
+
50
+ Combined with one-at-a-time locking, nonce markers ensure state stays consistent and debuggable.
51
+
52
+ ### 3. Context Injection (Preambles)
53
+
54
+ **The Problem**: AI agents are prone to "instruction drift." Over a long session, they might stop using your preferred format or forget constraints. Manually re-typing system instructions is a "token tax" on your own brain.
55
+
56
+ **The Why**: Preambles act as a forced system prompt for CLI environments. By injecting these "hidden instructions" at the transport level, we ensure the agent remains in character (e.g., "You are the code reviewer, do not edit files") without cluttering the human's command history. It's about reducing **Cognitive Load**β€”the human focuses on intent, the CLI enforces protocol.
57
+
58
+ ### 4. Token-Efficient Polling
59
+
60
+ **The Problem**: The `--wait` feature is powerful but higher-risk: long-running commands, more state to manage, potential for hung processes.
61
+
62
+ **The Why**: Default to the simple mental model (send β†’ manually check). Teams opt into `--wait` when they're ready. By capturing only the last few lines of the buffer and searching for the short, high-entropy nonce, we keep overhead near zeroβ€”we're looking for a single "heartbeat" at the TTY's edge, not re-parsing the whole history.
63
+
64
+ ---
65
+
66
+ ## πŸ“¦ Installation
6
67
 
7
68
  ```bash
8
69
  npm install -g tmux-team
9
70
  ```
10
71
 
72
+ **Requirements:** Node.js >= 16, tmux, macOS/Linux
73
+
11
74
  ### Shell Completion
12
75
 
13
76
  ```bash
@@ -25,45 +88,155 @@ eval "$(tmux-team completion bash)"
25
88
  /plugin install tmux-team@tmux-team
26
89
  ```
27
90
 
28
- ## Quick Start
91
+ ---
92
+
93
+ ## ⌨️ Quick Start
29
94
 
30
95
  ```bash
31
- # Setup agents
32
- tmux-team add claude 10.0 "Frontend"
33
- tmux-team add codex 10.1 "Backend"
34
- tmux-team add gemini 10.2 "Testing"
96
+ # Initialize config
97
+ tmux-team init
98
+
99
+ # Register your agents (name + tmux pane ID)
100
+ tmux-team add claude 10.0 "Frontend specialist"
101
+ tmux-team add codex 10.1 "Backend engineer"
102
+ tmux-team add gemini 10.2 "Code reviewer"
35
103
 
36
- # Talk to agents
37
- tmux-team talk codex "Review the auth module"
38
- tmux-team talk all "Starting the refactor"
104
+ # Send messages
105
+ tmux-team talk codex "Review the auth module and suggest improvements"
106
+ tmux-team talk all "Starting the refactor now"
39
107
 
40
108
  # Read responses
41
109
  tmux-team check codex
110
+ tmux-team check codex 200 # More lines if needed
42
111
 
43
112
  # Manage agents
44
113
  tmux-team list
114
+ tmux-team update codex --remark "Now handling tests"
45
115
  tmux-team remove gemini
46
116
  ```
47
117
 
48
- ## From Claude Code
118
+ ### From Claude Code
119
+
120
+ Once the plugin is installed, coordinate directly from your Claude Code session:
49
121
 
50
122
  ```
51
123
  /tmux-team:team codex "Can you review my changes?"
52
- /tmux-team:team all "I'm refactoring the database schema"
124
+ /tmux-team:team all "I'm starting the database migration"
53
125
  ```
54
126
 
55
- ## Commands
127
+ ---
128
+
129
+ ## πŸ“‹ Commands
56
130
 
57
131
  | Command | Description |
58
132
  |---------|-------------|
59
- | `talk <agent> <msg>` | Send message to agent (or "all") |
60
- | `check <agent> [lines]` | Read agent's output |
61
- | `list` | List configured agents |
62
- | `add <name> <pane> [remark]` | Add agent |
63
- | `update <name> --pane/--remark` | Update agent |
64
- | `remove <name>` | Remove agent |
65
- | `init` | Create tmux-team.json |
66
- | `completion [zsh\|bash]` | Output completion script |
133
+ | `talk <agent> "<msg>"` | Send message to agent (or `all` for broadcast) |
134
+ | `talk ... --delay 5` | Wait 5 seconds before sending |
135
+ | `talk ... --wait` | Wait for agent response (nonce-based) |
136
+ | `check <agent> [lines]` | Read agent's terminal output (default: 100 lines) |
137
+ | `list` | Show all configured agents |
138
+ | `add <name> <pane> [remark]` | Register a new agent |
139
+ | `update <name> --pane/--remark` | Update agent configuration |
140
+ | `remove <name>` | Unregister an agent |
141
+ | `init` | Create `tmux-team.json` in current directory |
142
+ | `pm init --name "Project"` | Initialize project management |
143
+ | `pm m add/list/done` | Manage milestones |
144
+ | `pm t add/list/update/done` | Manage tasks |
145
+ | `pm log` | View audit event log |
146
+ | `completion [zsh\|bash]` | Output shell completion script |
147
+
148
+ ---
149
+
150
+ ## βš™οΈ Configuration
151
+
152
+ ### Local Config (`./tmux-team.json`)
153
+
154
+ Per-project agent registry:
155
+
156
+ ```json
157
+ {
158
+ "claude": { "pane": "10.0", "remark": "Frontend specialist" },
159
+ "codex": { "pane": "10.1", "remark": "Backend engineer" }
160
+ }
161
+ ```
162
+
163
+ ### Global Config (`~/.config/tmux-team/config.json`)
164
+
165
+ ```json
166
+ {
167
+ "mode": "polling",
168
+ "preambleMode": "always",
169
+ "defaults": {
170
+ "timeout": 60000,
171
+ "pollInterval": 1000
172
+ },
173
+ "agents": {
174
+ "gemini": {
175
+ "preamble": "Do not edit files until explicitly asked."
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ ---
182
+
183
+ ## ✨ v2 Features
184
+
185
+ ### πŸ“‘ Enhanced `talk` Command
186
+
187
+ ```bash
188
+ # Delay before sending (safe alternative to sleep)
189
+ tmux-team talk codex "message" --delay 5
190
+
191
+ # Wait for response with nonce-based completion detection
192
+ tmux-team talk codex "message" --wait --timeout 60
193
+ ```
194
+
195
+ ### πŸ“œ Agent Preambles
196
+
197
+ Inject hidden instructions into every message:
198
+
199
+ ```json
200
+ {
201
+ "agents": {
202
+ "gemini": {
203
+ "preamble": "Always explain your reasoning. Do not edit files directly."
204
+ }
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### 🎯 Project Management
210
+
211
+ ```bash
212
+ # Initialize a team project
213
+ tmux-team pm init --name "Auth Refactor"
214
+
215
+ # Manage milestones and tasks
216
+ tmux-team pm m add "MVP Release"
217
+ tmux-team pm t add "Implement login" --milestone 1
218
+ tmux-team pm t update 1 --status in_progress
219
+ tmux-team pm t done 1
220
+
221
+ # View audit log
222
+ tmux-team pm log --limit 10
223
+ ```
224
+
225
+ ---
226
+
227
+ ## 🚫 Non-Goals
228
+
229
+ tmux-team intentionally stays lightweight:
230
+
231
+ - **Not an orchestrator** β€” No automatic task routing or agent selection
232
+ - **Not a session manager** β€” Doesn't create/manage tmux sessions or git worktrees
233
+ - **Not an LLM wrapper** β€” Doesn't process or route messages through AI
234
+
235
+ It's the plumbing layer that lets humans and AI agents coordinate via tmux, nothing more.
236
+
237
+ ---
238
+
239
+ *Built for developers who live in the terminal and want their AIs to do the same.*
67
240
 
68
241
  ## License
69
242