ttyd-mux 0.2.0 → 0.2.1
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 +75 -63
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,30 +1,44 @@
|
|
|
1
1
|
# ttyd-mux
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A CLI tool for managing multiple ttyd+tmux web terminal sessions.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
複数の ttyd+tmux Web ターミナルセッションを管理する CLI ツール。
|
|
6
6
|
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview / 概要
|
|
10
|
+
|
|
11
|
+
**English:**
|
|
12
|
+
ttyd-mux makes it easy to manage multiple web terminal (ttyd) sessions.
|
|
13
|
+
|
|
14
|
+
- Run `ttyd-mux up` in any directory to start a browser-accessible terminal
|
|
15
|
+
- Provides a portal page to manage all sessions
|
|
16
|
+
- Integrates with reverse proxies like Caddy for external access
|
|
17
|
+
|
|
18
|
+
**日本語:**
|
|
7
19
|
ttyd-mux は、複数の Web ターミナル(ttyd)セッションを簡単に管理するためのツールです。
|
|
8
20
|
|
|
9
21
|
- カレントディレクトリで `ttyd-mux up` するだけでブラウザアクセス可能なターミナルを起動
|
|
10
22
|
- 複数セッションを一元管理するポータルページを提供
|
|
11
23
|
- Caddy などのリバースプロキシと連携して外部公開
|
|
12
24
|
|
|
13
|
-
## インストール
|
|
25
|
+
## Installation / インストール
|
|
14
26
|
|
|
15
27
|
```bash
|
|
28
|
+
# Install globally with npm
|
|
16
29
|
# npm でグローバルインストール
|
|
17
30
|
npm install -g ttyd-mux
|
|
18
31
|
|
|
32
|
+
# Or run directly with npx
|
|
19
33
|
# または npx で直接実行
|
|
20
34
|
npx ttyd-mux up
|
|
21
35
|
```
|
|
22
36
|
|
|
23
|
-
### 必要な依存関係
|
|
37
|
+
### Prerequisites / 必要な依存関係
|
|
24
38
|
|
|
25
|
-
- **Node.js** 18
|
|
39
|
+
- **Node.js** 18+ (or Bun)
|
|
26
40
|
- **ttyd**: https://github.com/tsl0922/ttyd
|
|
27
|
-
- **tmux**:
|
|
41
|
+
- **tmux**: Terminal multiplexer
|
|
28
42
|
|
|
29
43
|
```bash
|
|
30
44
|
# Ubuntu/Debian
|
|
@@ -34,65 +48,61 @@ sudo apt install ttyd tmux
|
|
|
34
48
|
brew install ttyd tmux
|
|
35
49
|
```
|
|
36
50
|
|
|
37
|
-
## クイックスタート
|
|
51
|
+
## Quick Start / クイックスタート
|
|
38
52
|
|
|
39
53
|
```bash
|
|
54
|
+
# Start in your project directory
|
|
40
55
|
# プロジェクトディレクトリで起動
|
|
41
56
|
cd ~/my-project
|
|
42
57
|
ttyd-mux up
|
|
43
58
|
|
|
44
|
-
# ブラウザでアクセス
|
|
59
|
+
# Access in browser / ブラウザでアクセス
|
|
45
60
|
# http://localhost:7680/ttyd-mux/my-project/
|
|
46
61
|
|
|
47
|
-
# 状態確認
|
|
62
|
+
# Check status / 状態確認
|
|
48
63
|
ttyd-mux status
|
|
49
64
|
|
|
50
|
-
# 停止
|
|
65
|
+
# Stop / 停止
|
|
51
66
|
ttyd-mux down
|
|
52
67
|
```
|
|
53
68
|
|
|
54
|
-
## コマンド
|
|
69
|
+
## Commands / コマンド
|
|
55
70
|
|
|
56
|
-
### メインコマンド
|
|
71
|
+
### Main Commands / メインコマンド
|
|
57
72
|
|
|
58
73
|
```bash
|
|
59
|
-
ttyd-mux up [--name <name>] # セッション起動 → 自動アタッチ
|
|
60
|
-
ttyd-mux up --detach # セッション起動のみ(アタッチしない)
|
|
61
|
-
ttyd-mux down # カレントディレクトリのセッション停止
|
|
74
|
+
ttyd-mux up [--name <name>] # Start session and attach / セッション起動 → 自動アタッチ
|
|
75
|
+
ttyd-mux up --detach # Start without attaching / セッション起動のみ(アタッチしない)
|
|
76
|
+
ttyd-mux down # Stop current directory session / カレントディレクトリのセッション停止
|
|
62
77
|
```
|
|
63
78
|
|
|
64
|
-
### セッション管理
|
|
79
|
+
### Session Management / セッション管理
|
|
65
80
|
|
|
66
81
|
```bash
|
|
67
|
-
ttyd-mux start <name> # 事前定義セッションを起動
|
|
68
|
-
ttyd-mux start --all # 全ての事前定義セッションを起動
|
|
69
|
-
ttyd-mux stop <name> # セッション停止
|
|
70
|
-
ttyd-mux stop --all # 全セッション停止
|
|
71
|
-
ttyd-mux status # 状態表示
|
|
82
|
+
ttyd-mux start <name> # Start predefined session / 事前定義セッションを起動
|
|
83
|
+
ttyd-mux start --all # Start all predefined sessions / 全ての事前定義セッションを起動
|
|
84
|
+
ttyd-mux stop <name> # Stop session / セッション停止
|
|
85
|
+
ttyd-mux stop --all # Stop all sessions / 全セッション停止
|
|
86
|
+
ttyd-mux status # Show status / 状態表示
|
|
72
87
|
```
|
|
73
88
|
|
|
74
|
-
### 直接アクセス
|
|
89
|
+
### Direct Access / 直接アクセス
|
|
75
90
|
|
|
76
91
|
```bash
|
|
77
|
-
ttyd-mux attach [name] # tmuxセッションに直接アタッチ
|
|
92
|
+
ttyd-mux attach [name] # Attach directly to tmux session / tmuxセッションに直接アタッチ
|
|
78
93
|
```
|
|
79
94
|
|
|
80
|
-
### デーモン制御
|
|
95
|
+
### Daemon Control / デーモン制御
|
|
81
96
|
|
|
82
97
|
```bash
|
|
83
|
-
ttyd-mux daemon # デーモン起動
|
|
84
|
-
ttyd-mux daemon -f # フォアグラウンドで起動(デバッグ用)
|
|
85
|
-
ttyd-mux shutdown # デーモン終了
|
|
98
|
+
ttyd-mux daemon # Start daemon / デーモン起動
|
|
99
|
+
ttyd-mux daemon -f # Start in foreground (debug) / フォアグラウンドで起動(デバッグ用)
|
|
100
|
+
ttyd-mux shutdown # Stop daemon / デーモン終了
|
|
86
101
|
```
|
|
87
102
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
ttyd-mux generate caddy # Caddyfile生成
|
|
92
|
-
ttyd-mux generate caddy -o Caddyfile --hostname example.com
|
|
93
|
-
```
|
|
103
|
+
## Configuration / 設定
|
|
94
104
|
|
|
95
|
-
|
|
105
|
+
Configuration files are searched in the following order:
|
|
96
106
|
|
|
97
107
|
設定ファイルは以下の順序で検索されます:
|
|
98
108
|
|
|
@@ -100,30 +110,32 @@ ttyd-mux generate caddy -o Caddyfile --hostname example.com
|
|
|
100
110
|
2. `./.ttyd-mux.yaml`
|
|
101
111
|
3. `~/.config/ttyd-mux/config.yaml`
|
|
102
112
|
|
|
103
|
-
### 設定例
|
|
113
|
+
### Example / 設定例
|
|
104
114
|
|
|
105
115
|
```yaml
|
|
106
116
|
# ~/.config/ttyd-mux/config.yaml
|
|
107
117
|
|
|
108
|
-
# URLパスのプレフィックス
|
|
118
|
+
# URL path prefix / URLパスのプレフィックス
|
|
109
119
|
base_path: /ttyd-mux
|
|
110
120
|
|
|
111
|
-
# ttydセッションのベースポート
|
|
121
|
+
# Base port for ttyd sessions / ttydセッションのベースポート
|
|
112
122
|
base_port: 7600
|
|
113
123
|
|
|
114
|
-
# デーモンのHTTPポート
|
|
124
|
+
# Daemon HTTP port / デーモンのHTTPポート
|
|
115
125
|
daemon_port: 7680
|
|
116
126
|
|
|
127
|
+
# Listen addresses (default: IPv4 + IPv6 localhost)
|
|
117
128
|
# リッスンアドレス(デフォルト: IPv4 + IPv6 localhost)
|
|
118
129
|
listen_addresses:
|
|
119
130
|
- "127.0.0.1"
|
|
120
131
|
- "::1"
|
|
121
|
-
# - "0.0.0.0" # 外部からのアクセスを許可する場合
|
|
132
|
+
# - "0.0.0.0" # Allow external access / 外部からのアクセスを許可する場合
|
|
122
133
|
|
|
134
|
+
# Auto-attach to tmux on session start (default: true)
|
|
123
135
|
# セッション起動時に自動でtmuxにアタッチ(デフォルト: true)
|
|
124
136
|
auto_attach: true
|
|
125
137
|
|
|
126
|
-
# 事前定義セッション(オプション)
|
|
138
|
+
# Predefined sessions (optional) / 事前定義セッション(オプション)
|
|
127
139
|
sessions:
|
|
128
140
|
- name: project-a
|
|
129
141
|
dir: /home/user/project-a
|
|
@@ -136,7 +148,7 @@ sessions:
|
|
|
136
148
|
port_offset: 2
|
|
137
149
|
```
|
|
138
150
|
|
|
139
|
-
## アーキテクチャ
|
|
151
|
+
## Architecture / アーキテクチャ
|
|
140
152
|
|
|
141
153
|
```
|
|
142
154
|
┌─────────────────┐
|
|
@@ -153,29 +165,29 @@ sessions:
|
|
|
153
165
|
└──────────────┘
|
|
154
166
|
```
|
|
155
167
|
|
|
156
|
-
- **Caddy**: 外部からのリクエストを ttyd-mux に転送
|
|
157
|
-
- **ttyd-mux daemon**: ポータル表示 + ttyd へのリバースプロキシ
|
|
158
|
-
- **ttyd**: 各セッションの Web ターミナル(tmux を起動)
|
|
168
|
+
- **Caddy**: Forwards external requests to ttyd-mux / 外部からのリクエストを ttyd-mux に転送
|
|
169
|
+
- **ttyd-mux daemon**: Portal + reverse proxy to ttyd / ポータル表示 + ttyd へのリバースプロキシ
|
|
170
|
+
- **ttyd**: Web terminal for each session (runs tmux) / 各セッションの Web ターミナル(tmux を起動)
|
|
159
171
|
|
|
160
|
-
## Caddy との連携
|
|
172
|
+
## Caddy Integration / Caddy との連携
|
|
161
173
|
|
|
162
|
-
### Admin API で設定(推奨)
|
|
174
|
+
### Using Admin API (Recommended) / Admin API で設定(推奨)
|
|
163
175
|
|
|
164
176
|
```bash
|
|
165
|
-
# ルートを追加
|
|
177
|
+
# Add route / ルートを追加
|
|
166
178
|
ttyd-mux caddy setup --hostname example.com
|
|
167
179
|
|
|
168
|
-
# 設定を確認
|
|
180
|
+
# Check configuration / 設定を確認
|
|
169
181
|
ttyd-mux caddy status
|
|
170
182
|
|
|
171
|
-
# ルートを削除
|
|
183
|
+
# Remove route / ルートを削除
|
|
172
184
|
ttyd-mux caddy remove --hostname example.com
|
|
173
185
|
```
|
|
174
186
|
|
|
175
|
-
### Caddyfile 手動編集
|
|
187
|
+
### Manual Caddyfile / Caddyfile 手動編集
|
|
176
188
|
|
|
177
189
|
```bash
|
|
178
|
-
# コピペ用スニペットを表示
|
|
190
|
+
# Show snippet for copy-paste / コピペ用スニペットを表示
|
|
179
191
|
ttyd-mux caddy snippet
|
|
180
192
|
```
|
|
181
193
|
|
|
@@ -185,38 +197,38 @@ handle /ttyd-mux/* {
|
|
|
185
197
|
}
|
|
186
198
|
```
|
|
187
199
|
|
|
188
|
-
|
|
200
|
+
See [docs/caddy-setup.md](docs/caddy-setup.md) for details.
|
|
189
201
|
|
|
190
|
-
## ファイル構成
|
|
202
|
+
## File Structure / ファイル構成
|
|
191
203
|
|
|
192
204
|
```
|
|
193
205
|
~/.config/ttyd-mux/
|
|
194
|
-
config.yaml # 設定ファイル
|
|
206
|
+
config.yaml # Configuration file / 設定ファイル
|
|
195
207
|
|
|
196
208
|
~/.local/state/ttyd-mux/
|
|
197
|
-
state.json # 実行中セッションの状態
|
|
198
|
-
ttyd-mux.sock # デーモン通信用ソケット
|
|
209
|
+
state.json # Running session state / 実行中セッションの状態
|
|
210
|
+
ttyd-mux.sock # Daemon communication socket / デーモン通信用ソケット
|
|
199
211
|
```
|
|
200
212
|
|
|
201
|
-
## 開発
|
|
213
|
+
## Development / 開発
|
|
202
214
|
|
|
203
215
|
```bash
|
|
204
|
-
# 開発実行
|
|
216
|
+
# Run in development / 開発実行
|
|
205
217
|
bun run src/index.ts <command>
|
|
206
218
|
|
|
207
|
-
# テスト
|
|
219
|
+
# Test / テスト
|
|
208
220
|
bun test
|
|
209
221
|
|
|
210
|
-
# 型チェック
|
|
222
|
+
# Type check / 型チェック
|
|
211
223
|
bun run typecheck
|
|
212
224
|
|
|
213
|
-
# リント
|
|
225
|
+
# Lint / リント
|
|
214
226
|
bun run check
|
|
215
227
|
|
|
216
|
-
# ビルド(単一実行ファイル)
|
|
228
|
+
# Build single executable / ビルド(単一実行ファイル)
|
|
217
229
|
bun build src/index.ts --compile --outfile ttyd-mux
|
|
218
230
|
```
|
|
219
231
|
|
|
220
|
-
## ライセンス
|
|
232
|
+
## License / ライセンス
|
|
221
233
|
|
|
222
234
|
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ttyd-mux",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "ttyd session multiplexer - manage multiple ttyd+tmux sessions",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "ttyd session multiplexer - manage multiple ttyd+tmux web terminal sessions / 複数の ttyd+tmux Web ターミナルセッションを管理する CLI ツール",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|