opencode-agent-tmux 1.0.0 → 1.0.4
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 +43 -86
- package/package.json +1 -1
- package/scripts/install.js +7 -3
package/README.md
CHANGED
|
@@ -1,47 +1,40 @@
|
|
|
1
1
|
# opencode-agent-tmux
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/opencode-agent-tmux)
|
|
4
|
+
[](https://www.npmjs.com/package/opencode-agent-tmux)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
An [OpenCode](https://opencode.ai) plugin that provides **smart tmux integration** for viewing agent execution in real-time. Automatically spawns panes, streams output, and manages your terminal workspace.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
- **Agent-Agnostic**: Works with oh-my-opencode, omoc-slim, or vanilla OpenCode.
|
|
10
|
+
- **Cross-Platform**: Full support for **macOS**, **Linux**, and **Windows** (via PowerShell or WSL).
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
Please install the opencode-agent-tmux plugin for me.
|
|
12
|
+

|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
2. Run 'bun install' and 'bun run build' inside the directory
|
|
14
|
-
3. Add the plugin path to my ~/.config/opencode/opencode.json file
|
|
15
|
-
4. Verify the installation by running 'opencode --version'
|
|
14
|
+
## Installation
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
```
|
|
16
|
+
### 🤖 Let an LLM do it (Recommended)
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
Paste this into any LLM agent (OpenCode, Claude Code, Cursor, etc.):
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- **Configurable Layout**: Support multiple tmux layouts (main-vertical, tiled, etc.)
|
|
26
|
-
- **Multi-Port Support**: Automatically finds available ports when running multiple instances
|
|
27
|
-
- **Agent-Agnostic**: Works with oh-my-opencode, omoc-slim, or vanilla OpenCode
|
|
28
|
-
|
|
29
|
-
## 📋 Requirements
|
|
20
|
+
```text
|
|
21
|
+
Install the opencode-agent-tmux plugin by following: https://raw.githubusercontent.com/AnganSamadder/opencode-agent-tmux/main/README.md
|
|
22
|
+
```
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **Bun** (for building)
|
|
24
|
+
<details>
|
|
25
|
+
<summary><b>Instructions for LLM Agents</b></summary>
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
To install this plugin, please perform the following steps for the user:
|
|
36
28
|
|
|
37
|
-
1. **Install
|
|
29
|
+
1. **Install the NPM package globally:**
|
|
38
30
|
```bash
|
|
39
31
|
npm install -g opencode-agent-tmux
|
|
40
32
|
```
|
|
41
|
-
*Note:
|
|
33
|
+
*Note: This installer automatically configures the user's shell (Bash/Zsh/Fish/PowerShell) to use the smart wrapper.*
|
|
42
34
|
|
|
43
35
|
2. **Configure OpenCode:**
|
|
44
|
-
Add the
|
|
36
|
+
Add `"opencode-agent-tmux"` to the `plugins` array in the user's config file (usually `~/.config/opencode/opencode.json`).
|
|
37
|
+
|
|
45
38
|
```json
|
|
46
39
|
{
|
|
47
40
|
"plugins": [
|
|
@@ -50,72 +43,41 @@ The plugin repo is: https://github.com/AnganSamadder/opencode-agent-tmux.git
|
|
|
50
43
|
}
|
|
51
44
|
```
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
3. **Verify & Finalize:**
|
|
47
|
+
* Check if `tmux` is installed on the system. If not, advise the user to install it (e.g., `brew install tmux`, `sudo apt install tmux`, or `winget install tmux`).
|
|
48
|
+
* Tell the user: **"Installation complete! Please restart your terminal and run `opencode` to see the tmux integration in action."**
|
|
54
49
|
|
|
55
|
-
|
|
50
|
+
</details>
|
|
56
51
|
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
git clone https://github.com/AnganSamadder/opencode-agent-tmux.git ~/Code/opencode-agent-tmux
|
|
60
|
-
```
|
|
52
|
+
### 👤 For Humans (Manual)
|
|
61
53
|
|
|
62
|
-
|
|
54
|
+
1. **Install via NPM:**
|
|
63
55
|
```bash
|
|
64
|
-
|
|
65
|
-
bun install
|
|
66
|
-
bun run build
|
|
56
|
+
npm install -g opencode-agent-tmux
|
|
67
57
|
```
|
|
58
|
+
*The installer automatically configures your shell to use the smart wrapper.*
|
|
68
59
|
|
|
69
|
-
|
|
70
|
-
Add
|
|
60
|
+
2. **Enable the Plugin:**
|
|
61
|
+
Add `"opencode-agent-tmux"` to your `~/.config/opencode/opencode.json`:
|
|
71
62
|
```json
|
|
72
63
|
{
|
|
73
64
|
"plugins": [
|
|
74
|
-
"
|
|
65
|
+
"opencode-agent-tmux"
|
|
75
66
|
]
|
|
76
67
|
}
|
|
77
68
|
```
|
|
78
69
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Easy Mode (Recommended)
|
|
82
|
-
|
|
83
|
-
After installation, just type:
|
|
70
|
+
3. **Run OpenCode:**
|
|
71
|
+
Restart your terminal and type `opencode`. The plugin handles the rest!
|
|
84
72
|
|
|
85
|
-
|
|
86
|
-
opencode
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
The wrapper automatically:
|
|
90
|
-
- Launches tmux if you're not already in it
|
|
91
|
-
- Finds an available port (4096-4106) if default is in use
|
|
92
|
-
- Starts OpenCode with the available port
|
|
93
|
-
- Enables the plugin to spawn panes for agents
|
|
94
|
-
|
|
95
|
-
### Running Multiple Instances
|
|
96
|
-
|
|
97
|
-
Want to run multiple OpenCode sessions? No problem:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Terminal 1
|
|
101
|
-
opencode
|
|
102
|
-
# → Starts on port 4096
|
|
103
|
-
|
|
104
|
-
# Terminal 2
|
|
105
|
-
opencode
|
|
106
|
-
# → Detects 4096 in use, automatically uses port 4097
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Each instance works independently with its own tmux panes!
|
|
110
|
-
|
|
111
|
-
### Manual Mode
|
|
112
|
-
|
|
113
|
-
Or start OpenCode inside tmux manually:
|
|
73
|
+
## ✨ Features
|
|
114
74
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
75
|
+
- **Automatic Tmux Pane Spawning**: When any agent starts, automatically spawns a tmux pane
|
|
76
|
+
- **Live Streaming**: Each pane runs `opencode attach` to show real-time agent output
|
|
77
|
+
- **Auto-Cleanup**: Panes automatically close when agents complete
|
|
78
|
+
- **Configurable Layout**: Support multiple tmux layouts (`main-vertical`, `tiled`, etc.)
|
|
79
|
+
- **Multi-Port Support**: Automatically finds available ports (4096-4106) when running multiple instances
|
|
80
|
+
- **Smart Wrapper**: Automatically detects if you are in tmux; if not, launches a session for you.
|
|
119
81
|
|
|
120
82
|
## ⚙️ Configuration
|
|
121
83
|
|
|
@@ -143,20 +105,15 @@ You can customize behavior by creating `~/.config/opencode/opencode-agent-tmux.j
|
|
|
143
105
|
|
|
144
106
|
### Panes Not Spawning
|
|
145
107
|
1. Verify you're inside tmux: `echo $TMUX`
|
|
146
|
-
2. Check tmux is installed: `which tmux`
|
|
147
|
-
3. Check
|
|
148
|
-
4. Check logs: `cat /tmp/opencode-agent-tmux.log`
|
|
108
|
+
2. Check tmux is installed: `which tmux` (or `where tmux` on Windows)
|
|
109
|
+
3. Check logs: `cat /tmp/opencode-agent-tmux.log`
|
|
149
110
|
|
|
150
111
|
### Server Not Found
|
|
151
|
-
Make sure OpenCode is started with the `--port` flag matching your config
|
|
152
|
-
```bash
|
|
153
|
-
opencode --port 4096
|
|
154
|
-
```
|
|
112
|
+
Make sure OpenCode is started with the `--port` flag matching your config (the wrapper does this automatically).
|
|
155
113
|
|
|
156
114
|
## 📄 License
|
|
157
115
|
|
|
158
116
|
MIT
|
|
159
117
|
|
|
160
118
|
## 🙏 Acknowledgements
|
|
161
|
-
|
|
162
119
|
This project extracts and improves upon the tmux session management from [oh-my-opencode-slim](https://github.com/alvinunreal/oh-my-opencode-slim) by alvinunreal.
|
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import os from 'os';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
6
10
|
|
|
7
11
|
const HOME = os.homedir();
|
|
8
12
|
|