tmux-team 3.2.3 → 3.3.0
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 +44 -29
- package/bin/tmux-team +12 -5
- package/package.json +16 -15
- package/skills/README.md +1 -1
- package/src/bin-wrapper.test.ts +50 -0
- package/src/cli.test.ts +426 -0
- package/src/cli.ts +10 -6
- package/src/commands/basic-commands.test.ts +130 -0
- package/src/commands/config-command.test.ts +79 -0
- package/src/commands/help.ts +2 -2
- package/src/commands/install.ts +2 -14
- package/src/commands/preamble.test.ts +378 -0
- package/src/commands/talk.test.ts +116 -63
- package/src/commands/talk.ts +41 -28
- package/src/commands/this.ts +20 -0
- package/src/config.test.ts +1 -1
- package/src/config.ts +1 -1
- package/src/tmux.test.ts +20 -0
- package/src/ui.test.ts +46 -0
- package/src/commands/setup.test.ts +0 -175
- package/src/commands/setup.ts +0 -163
package/README.md
CHANGED
|
@@ -16,60 +16,75 @@ npm install -g tmux-team
|
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
# 1. Install for your AI agent
|
|
19
|
-
|
|
19
|
+
tmt install claude # or: tmt install codex
|
|
20
20
|
|
|
21
|
-
# 2.
|
|
22
|
-
|
|
21
|
+
# 2. Go to working folder and initialize
|
|
22
|
+
tmt init
|
|
23
23
|
|
|
24
|
-
# 3.
|
|
25
|
-
|
|
24
|
+
# 3. Register agents (run inside each agent's pane)
|
|
25
|
+
tmt this claude # registers current pane as "claude"
|
|
26
|
+
tmt this codex # registers current pane as "codex"
|
|
27
|
+
|
|
28
|
+
# 4. Talk to agents
|
|
29
|
+
tmt talk codex "Review this code" # waits for response by default
|
|
30
|
+
|
|
31
|
+
# 5. Update or remove an agent
|
|
32
|
+
tmt update codex --pane 2.3
|
|
33
|
+
tmt rm codex
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> **Tip:** Most AI agents support `!` to run bash commands. From inside Claude Code, Codex, or Gemini CLI, you can run `!tmt this myname` to quickly register that pane.
|
|
37
|
+
|
|
38
|
+
## Cross-Folder Collaboration
|
|
39
|
+
|
|
40
|
+
Agents don't need to be in the same folder to collaborate. You can add an agent from one project to another:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# In project-a folder, add an agent that's running in project-b
|
|
44
|
+
tmt add codex-reviewer 5.1 # Use the pane ID from the other project
|
|
26
45
|
```
|
|
27
46
|
|
|
28
|
-
|
|
47
|
+
Find pane IDs with: `tmux display-message -p "#{pane_id}"`
|
|
29
48
|
|
|
30
49
|
## Commands
|
|
31
50
|
|
|
32
51
|
| Command | Description |
|
|
33
52
|
|---------|-------------|
|
|
34
53
|
| `install [claude\|codex]` | Install tmux-team for an AI agent |
|
|
35
|
-
| `
|
|
36
|
-
| `talk <agent> "msg"
|
|
37
|
-
| `talk all "msg"
|
|
38
|
-
| `check <agent> [lines]` | Read agent's pane output
|
|
54
|
+
| `this <name> [remark]` | Register current pane as an agent |
|
|
55
|
+
| `talk <agent> "msg"` | Send message and wait for response |
|
|
56
|
+
| `talk all "msg"` | Broadcast to all agents |
|
|
57
|
+
| `check <agent> [lines]` | Read agent's pane output |
|
|
39
58
|
| `list` | Show configured agents |
|
|
40
59
|
| `learn` | Show educational guide |
|
|
41
60
|
|
|
42
|
-
**Options for `talk
|
|
61
|
+
**Options for `talk`:**
|
|
43
62
|
- `--timeout <seconds>` - Max wait time (default: 180s)
|
|
44
63
|
- `--lines <number>` - Lines to capture from response (default: 100)
|
|
45
64
|
|
|
46
|
-
Run `
|
|
65
|
+
Run `tmt help` for all commands and options.
|
|
47
66
|
|
|
48
67
|
## Managing Your Team
|
|
49
68
|
|
|
50
69
|
Configuration lives in `tmux-team.json` in your project root.
|
|
51
70
|
|
|
52
|
-
**
|
|
53
|
-
```bash
|
|
54
|
-
tmux-team setup
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**Read** - List configured agents:
|
|
71
|
+
**List** - Show configured agents:
|
|
58
72
|
```bash
|
|
59
|
-
|
|
73
|
+
tmt ls
|
|
60
74
|
```
|
|
61
75
|
|
|
62
|
-
**
|
|
76
|
+
**Edit** - Modify `tmux-team.json` directly:
|
|
63
77
|
```json
|
|
64
78
|
{
|
|
65
|
-
"codex": { "pane": "
|
|
66
|
-
"gemini": { "pane": "
|
|
79
|
+
"codex": { "pane": "1.1", "remark": "Code reviewer" },
|
|
80
|
+
"gemini": { "pane": "1.2", "remark": "Documentation" }
|
|
67
81
|
}
|
|
68
82
|
```
|
|
69
83
|
|
|
70
|
-
**
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
**Remove** - Delete an agent:
|
|
85
|
+
```bash
|
|
86
|
+
tmt rm codex
|
|
87
|
+
```
|
|
73
88
|
|
|
74
89
|
## Claude Code Plugin
|
|
75
90
|
|
|
@@ -88,8 +103,8 @@ Run this once when starting a session. Claude will understand how to coordinate
|
|
|
88
103
|
|
|
89
104
|
**`/team`** - Talk to other agents
|
|
90
105
|
```
|
|
91
|
-
/team talk codex "Review my authentication changes"
|
|
92
|
-
/team talk all "I'm starting the database migration"
|
|
106
|
+
/team talk codex "Review my authentication changes"
|
|
107
|
+
/team talk all "I'm starting the database migration"
|
|
93
108
|
/team list
|
|
94
109
|
```
|
|
95
110
|
Use this to delegate tasks, ask for reviews, or broadcast updates.
|
|
@@ -97,8 +112,8 @@ Use this to delegate tasks, ask for reviews, or broadcast updates.
|
|
|
97
112
|
## Learn More
|
|
98
113
|
|
|
99
114
|
```bash
|
|
100
|
-
|
|
101
|
-
|
|
115
|
+
tmt learn # Comprehensive guide
|
|
116
|
+
tmt help # All commands and options
|
|
102
117
|
```
|
|
103
118
|
|
|
104
119
|
## License
|
package/bin/tmux-team
CHANGED
|
@@ -3,17 +3,24 @@
|
|
|
3
3
|
// Thin wrapper that uses tsx to run the TypeScript CLI
|
|
4
4
|
// tsx is a runtime dependency for v2
|
|
5
5
|
import { spawn } from 'child_process';
|
|
6
|
-
import { fileURLToPath } from 'url';
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from 'url';
|
|
7
7
|
import { dirname, join } from 'path';
|
|
8
|
-
import {
|
|
8
|
+
import { createRequire } from 'module';
|
|
9
9
|
|
|
10
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
const cliPath = join(__dirname, '..', 'src', 'cli.ts');
|
|
12
12
|
|
|
13
13
|
// Prefer Node's --import hook over the tsx CLI (sandbox-friendly).
|
|
14
|
-
//
|
|
15
|
-
const
|
|
16
|
-
|
|
14
|
+
// Resolve `tsx` relative to *this installed package*, not the user's cwd.
|
|
15
|
+
const require = createRequire(import.meta.url);
|
|
16
|
+
let tsxImport;
|
|
17
|
+
try {
|
|
18
|
+
tsxImport = pathToFileURL(require.resolve('tsx')).href;
|
|
19
|
+
} catch {
|
|
20
|
+
console.error('Error: failed to resolve the `tsx` dependency from the tmux-team installation.');
|
|
21
|
+
console.error('Try reinstalling tmux-team (or ensure it was installed with its dependencies).');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
17
24
|
|
|
18
25
|
const child = spawn(process.execPath, ['--import', tsxImport, cliPath, ...process.argv.slice(2)], {
|
|
19
26
|
stdio: 'inherit',
|
package/package.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tmux-team",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "CLI tool for AI agent collaboration in tmux - manage cross-pane communication",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tmux-team": "./bin/tmux-team",
|
|
8
8
|
"tmt": "./bin/tmux-team"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "tsx src/cli.ts",
|
|
12
|
+
"tmt": "./bin/tmux-team",
|
|
13
|
+
"test": "pnpm test:run",
|
|
14
|
+
"test:watch": "vitest",
|
|
15
|
+
"test:run": "vitest run --coverage && node scripts/check-coverage.mjs --threshold 95",
|
|
16
|
+
"lint": "oxlint src/",
|
|
17
|
+
"lint:fix": "oxlint src/ --fix",
|
|
18
|
+
"format": "prettier --write src/",
|
|
19
|
+
"format:check": "prettier --check src/",
|
|
20
|
+
"type:check": "tsc --noEmit",
|
|
21
|
+
"check": "pnpm type:check && pnpm lint && pnpm format:check"
|
|
22
|
+
},
|
|
10
23
|
"keywords": [
|
|
11
24
|
"tmux",
|
|
12
25
|
"cli",
|
|
@@ -24,6 +37,7 @@
|
|
|
24
37
|
"engines": {
|
|
25
38
|
"node": ">=18"
|
|
26
39
|
},
|
|
40
|
+
"packageManager": "pnpm@9.15.4",
|
|
27
41
|
"os": [
|
|
28
42
|
"darwin",
|
|
29
43
|
"linux"
|
|
@@ -43,18 +57,5 @@
|
|
|
43
57
|
"prettier": "^3.7.4",
|
|
44
58
|
"typescript": "^5.3.0",
|
|
45
59
|
"vitest": "^1.2.0"
|
|
46
|
-
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"dev": "tsx src/cli.ts",
|
|
49
|
-
"tmt": "./bin/tmux-team",
|
|
50
|
-
"test": "pnpm test:run",
|
|
51
|
-
"test:watch": "vitest",
|
|
52
|
-
"test:run": "vitest run --coverage && node scripts/check-coverage.mjs --threshold 95",
|
|
53
|
-
"lint": "oxlint src/",
|
|
54
|
-
"lint:fix": "oxlint src/ --fix",
|
|
55
|
-
"format": "prettier --write src/",
|
|
56
|
-
"format:check": "prettier --check src/",
|
|
57
|
-
"type:check": "tsc --noEmit",
|
|
58
|
-
"check": "pnpm type:check && pnpm lint && pnpm format:check"
|
|
59
60
|
}
|
|
60
|
-
}
|
|
61
|
+
}
|
package/skills/README.md
CHANGED
|
@@ -29,7 +29,7 @@ tmux-team install claude
|
|
|
29
29
|
tmux-team install codex
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
After installation, run `tmux-team
|
|
32
|
+
After installation, run `tmux-team add <name> <pane>` to register your agents, or use `tmux-team this <name>` inside each agent's tmux pane.
|
|
33
33
|
|
|
34
34
|
## Claude Code
|
|
35
35
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { copyFileSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { dirname, join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
describe('bin/tmux-team wrapper', () => {
|
|
9
|
+
it('runs from a non-project cwd with hoisted tsx', () => {
|
|
10
|
+
const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
|
+
const tempRoot = mkdtempSync(join(repoRoot, '.tmp-bin-wrapper-'));
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
const projectRoot = join(tempRoot, 'project');
|
|
15
|
+
const userCwd = join(tempRoot, 'cwd');
|
|
16
|
+
|
|
17
|
+
const installedPkgRoot = join(projectRoot, 'node_modules', 'tmux-team');
|
|
18
|
+
const installedBin = join(installedPkgRoot, 'bin', 'tmux-team');
|
|
19
|
+
const installedCli = join(installedPkgRoot, 'src', 'cli.ts');
|
|
20
|
+
|
|
21
|
+
mkdirSync(join(installedPkgRoot, 'bin'), { recursive: true });
|
|
22
|
+
mkdirSync(join(installedPkgRoot, 'src'), { recursive: true });
|
|
23
|
+
mkdirSync(join(projectRoot, 'node_modules'), { recursive: true });
|
|
24
|
+
mkdirSync(userCwd, { recursive: true });
|
|
25
|
+
|
|
26
|
+
// Ensure Node treats the extensionless bin file as ESM (like a real install).
|
|
27
|
+
writeFileSync(
|
|
28
|
+
join(installedPkgRoot, 'package.json'),
|
|
29
|
+
JSON.stringify({ name: 'tmux-team', version: '0.0.0-test', type: 'module' })
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
copyFileSync(join(repoRoot, 'bin', 'tmux-team'), installedBin);
|
|
33
|
+
writeFileSync(installedCli, 'process.exit(0);\n');
|
|
34
|
+
|
|
35
|
+
// Simulate hoisting: tsx is present at the project root, not inside tmux-team/node_modules.
|
|
36
|
+
const require = createRequire(import.meta.url);
|
|
37
|
+
const tsxDir = dirname(require.resolve('tsx/package.json'));
|
|
38
|
+
symlinkSync(tsxDir, join(projectRoot, 'node_modules', 'tsx'), 'dir');
|
|
39
|
+
|
|
40
|
+
const result = spawnSync(process.execPath, [installedBin, '--help'], {
|
|
41
|
+
cwd: userCwd,
|
|
42
|
+
encoding: 'utf8',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
expect(result.status).toBe(0);
|
|
46
|
+
} finally {
|
|
47
|
+
rmSync(tempRoot, { recursive: true, force: true });
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|