opencode-agent-tmux 1.0.1 → 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 -87
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,48 +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
|
-
- **Cross-Platform**: Full support for **macOS**, **Linux**, and **Windows** (via PowerShell or WSL)
|
|
29
|
-
|
|
30
|
-
## 📋 Requirements
|
|
20
|
+
```text
|
|
21
|
+
Install the opencode-agent-tmux plugin by following: https://raw.githubusercontent.com/AnganSamadder/opencode-agent-tmux/main/README.md
|
|
22
|
+
```
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **Bun** (for building)
|
|
24
|
+
<details>
|
|
25
|
+
<summary><b>Instructions for LLM Agents</b></summary>
|
|
35
26
|
|
|
36
|
-
|
|
27
|
+
To install this plugin, please perform the following steps for the user:
|
|
37
28
|
|
|
38
|
-
1. **Install
|
|
29
|
+
1. **Install the NPM package globally:**
|
|
39
30
|
```bash
|
|
40
31
|
npm install -g opencode-agent-tmux
|
|
41
32
|
```
|
|
42
|
-
*Note:
|
|
33
|
+
*Note: This installer automatically configures the user's shell (Bash/Zsh/Fish/PowerShell) to use the smart wrapper.*
|
|
43
34
|
|
|
44
35
|
2. **Configure OpenCode:**
|
|
45
|
-
Add the
|
|
36
|
+
Add `"opencode-agent-tmux"` to the `plugins` array in the user's config file (usually `~/.config/opencode/opencode.json`).
|
|
37
|
+
|
|
46
38
|
```json
|
|
47
39
|
{
|
|
48
40
|
"plugins": [
|
|
@@ -51,72 +43,41 @@ The plugin repo is: https://github.com/AnganSamadder/opencode-agent-tmux.git
|
|
|
51
43
|
}
|
|
52
44
|
```
|
|
53
45
|
|
|
54
|
-
|
|
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."**
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
</details>
|
|
57
51
|
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
git clone https://github.com/AnganSamadder/opencode-agent-tmux.git ~/Code/opencode-agent-tmux
|
|
61
|
-
```
|
|
52
|
+
### 👤 For Humans (Manual)
|
|
62
53
|
|
|
63
|
-
|
|
54
|
+
1. **Install via NPM:**
|
|
64
55
|
```bash
|
|
65
|
-
|
|
66
|
-
bun install
|
|
67
|
-
bun run build
|
|
56
|
+
npm install -g opencode-agent-tmux
|
|
68
57
|
```
|
|
58
|
+
*The installer automatically configures your shell to use the smart wrapper.*
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
Add
|
|
60
|
+
2. **Enable the Plugin:**
|
|
61
|
+
Add `"opencode-agent-tmux"` to your `~/.config/opencode/opencode.json`:
|
|
72
62
|
```json
|
|
73
63
|
{
|
|
74
64
|
"plugins": [
|
|
75
|
-
"
|
|
65
|
+
"opencode-agent-tmux"
|
|
76
66
|
]
|
|
77
67
|
}
|
|
78
68
|
```
|
|
79
69
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Easy Mode (Recommended)
|
|
83
|
-
|
|
84
|
-
After installation, just type:
|
|
70
|
+
3. **Run OpenCode:**
|
|
71
|
+
Restart your terminal and type `opencode`. The plugin handles the rest!
|
|
85
72
|
|
|
86
|
-
|
|
87
|
-
opencode
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The wrapper automatically:
|
|
91
|
-
- Launches tmux if you're not already in it
|
|
92
|
-
- Finds an available port (4096-4106) if default is in use
|
|
93
|
-
- Starts OpenCode with the available port
|
|
94
|
-
- Enables the plugin to spawn panes for agents
|
|
95
|
-
|
|
96
|
-
### Running Multiple Instances
|
|
97
|
-
|
|
98
|
-
Want to run multiple OpenCode sessions? No problem:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Terminal 1
|
|
102
|
-
opencode
|
|
103
|
-
# → Starts on port 4096
|
|
104
|
-
|
|
105
|
-
# Terminal 2
|
|
106
|
-
opencode
|
|
107
|
-
# → Detects 4096 in use, automatically uses port 4097
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Each instance works independently with its own tmux panes!
|
|
111
|
-
|
|
112
|
-
### Manual Mode
|
|
113
|
-
|
|
114
|
-
Or start OpenCode inside tmux manually:
|
|
73
|
+
## ✨ Features
|
|
115
74
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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.
|
|
120
81
|
|
|
121
82
|
## ⚙️ Configuration
|
|
122
83
|
|
|
@@ -144,20 +105,15 @@ You can customize behavior by creating `~/.config/opencode/opencode-agent-tmux.j
|
|
|
144
105
|
|
|
145
106
|
### Panes Not Spawning
|
|
146
107
|
1. Verify you're inside tmux: `echo $TMUX`
|
|
147
|
-
2. Check tmux is installed: `which tmux`
|
|
148
|
-
3. Check
|
|
149
|
-
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`
|
|
150
110
|
|
|
151
111
|
### Server Not Found
|
|
152
|
-
Make sure OpenCode is started with the `--port` flag matching your config
|
|
153
|
-
```bash
|
|
154
|
-
opencode --port 4096
|
|
155
|
-
```
|
|
112
|
+
Make sure OpenCode is started with the `--port` flag matching your config (the wrapper does this automatically).
|
|
156
113
|
|
|
157
114
|
## 📄 License
|
|
158
115
|
|
|
159
116
|
MIT
|
|
160
117
|
|
|
161
118
|
## 🙏 Acknowledgements
|
|
162
|
-
|
|
163
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.
|