ttyd-mux 0.4.1 → 0.4.2

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
@@ -2,6 +2,9 @@
2
2
 
3
3
  [![CI](https://github.com/cuzic/ttyd-mux/actions/workflows/ci.yml/badge.svg)](https://github.com/cuzic/ttyd-mux/actions/workflows/ci.yml)
4
4
  ![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/cuzic/cc6203266343ecd145c80ea0e848fb33/raw/ttyd-mux-coverage.json)
5
+ [![npm version](https://img.shields.io/npm/v/ttyd-mux.svg)](https://www.npmjs.com/package/ttyd-mux)
6
+ [![npm downloads](https://img.shields.io/npm/dm/ttyd-mux.svg)](https://www.npmjs.com/package/ttyd-mux)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
8
 
6
9
  A CLI tool for managing multiple ttyd+tmux web terminal sessions.
7
10
 
@@ -9,33 +12,149 @@ A CLI tool for managing multiple ttyd+tmux web terminal sessions.
9
12
 
10
13
  ---
11
14
 
12
- ## Motivation / 開発動機
15
+ ## Table of Contents / 目次
16
+
17
+ - [Quick Start](#quick-start--クイックスタート)
18
+ - [Features](#features--機能)
19
+ - [Use Cases](#use-cases--ユースケース)
20
+ - [Installation](#installation--インストール)
21
+ - [Usage Patterns](#usage-patterns--使い方)
22
+ - [Commands](#commands--コマンド)
23
+ - [Configuration](#configuration--設定)
24
+ - [Architecture](#architecture--アーキテクチャ)
25
+ - [Toolbar Features](#toolbar-features--ツールバー機能)
26
+ - [PWA Support](#pwa-support--pwa-対応)
27
+ - [Caddy Integration](#caddy-integration--caddy-との連携)
28
+ - [Development](#development--開発)
13
29
 
14
- **English:**
15
- This tool was developed to easily access terminal sessions running AI coding assistants like [Claude Code](https://docs.anthropic.com/en/docs/claude-code) from a web browser. When running long coding sessions with AI assistants on a remote server, you can monitor and interact with them from anywhere through your browser.
30
+ ---
16
31
 
17
- **日本語:**
18
- このツールは、[Claude Code](https://docs.anthropic.com/ja/docs/claude-code) などの AI コーディングアシスタントを実行しているターミナルセッションに、ブラウザから簡単にアクセスできるようにする目的で開発されました。リモートサーバーで AI アシスタントと長時間のコーディングセッションを実行する際、ブラウザからどこからでも監視・操作できます。
32
+ ## Quick Start / クイックスタート
33
+
34
+ ```bash
35
+ # Install / インストール
36
+ npm install -g ttyd-mux
37
+
38
+ # Start terminal in current directory / カレントディレクトリでターミナル起動
39
+ cd ~/my-project
40
+ ttyd-mux up
41
+
42
+ # Open in browser / ブラウザで開く
43
+ # → http://localhost:7680/ttyd-mux/my-project/
44
+
45
+ # Stop / 停止
46
+ ttyd-mux down
47
+ ```
48
+
49
+ That's it! No configuration needed for basic usage.
50
+
51
+ 基本的な利用には設定不要です。
19
52
 
20
53
  ---
21
54
 
22
- ## Overview / 概要
55
+ ## Features / 機能
23
56
 
24
- **English:**
25
- ttyd-mux makes it easy to manage multiple web terminal (ttyd) sessions.
57
+ ### Core Features / コア機能
58
+
59
+ | Feature | Description |
60
+ |---------|-------------|
61
+ | **Zero Config** | Just run `ttyd-mux up` - no setup required / 設定不要で即起動 |
62
+ | **Multi-Session** | Manage multiple terminals from one portal / ポータルで複数ターミナルを一元管理 |
63
+ | **Auto Daemon** | Daemon starts automatically when needed / 必要時にデーモン自動起動 |
64
+ | **tmux Integration** | Sessions persist across restarts / tmux でセッション永続化 |
65
+ | **Reverse Proxy Ready** | Works with Caddy, nginx, etc. / リバースプロキシ対応 |
66
+
67
+ ### Mobile Features / モバイル機能
68
+
69
+ | Feature | Description |
70
+ |---------|-------------|
71
+ | **PWA Support** | Add to home screen, fullscreen mode / ホーム画面追加、フルスクリーン |
72
+ | **IME Input** | Japanese/CJK input support / 日本語入力対応 |
73
+ | **Touch Zoom** | Pinch to resize font / ピンチでフォントサイズ変更 |
74
+ | **Double-tap Enter** | Quick command execution / ダブルタップで Enter |
75
+ | **Scroll Buttons** | Easy scrollback navigation / スクロール用ボタン |
76
+
77
+ ### PC Features / PC 機能
78
+
79
+ | Feature | Description |
80
+ |---------|-------------|
81
+ | **Ctrl+Scroll Zoom** | Mouse wheel font resize / マウスホイールでサイズ変更 |
82
+ | **Trackpad Pinch** | Mac gesture support / Mac トラックパッド対応 |
83
+ | **Toolbar Toggle** | Ctrl+J to show/hide / Ctrl+J で表示切替 |
84
+ | **Auto Reload** | Reconnects on tab switch / タブ切替時に自動再接続 |
85
+
86
+ ---
87
+
88
+ ## Use Cases / ユースケース
89
+
90
+ ### 1. AI Coding Assistant Monitoring / AI コーディングアシスタントの監視
91
+
92
+ Monitor long-running AI coding sessions (like Claude Code) from anywhere.
93
+
94
+ Claude Code などの AI コーディングセッションをどこからでも監視。
95
+
96
+ ```bash
97
+ # On your server / サーバー上で
98
+ cd ~/my-ai-project
99
+ ttyd-mux up
100
+
101
+ # Access from phone/tablet / スマホ・タブレットからアクセス
102
+ # https://your-server.com/ttyd-mux/my-ai-project/
103
+ ```
104
+
105
+ ### 2. Remote Development / リモート開発
106
+
107
+ Access your development environment from any device with a browser.
108
+
109
+ ブラウザさえあればどのデバイスからでも開発環境にアクセス。
110
+
111
+ ```bash
112
+ # Start multiple project terminals / 複数プロジェクトを起動
113
+ cd ~/project-a && ttyd-mux up
114
+ cd ~/project-b && ttyd-mux up
115
+
116
+ # List all sessions / セッション一覧
117
+ ttyd-mux list --url
118
+ ```
119
+
120
+ ### 3. Server Administration / サーバー管理
121
+
122
+ Predefined sessions for server operations.
123
+
124
+ サーバー操作用の事前定義セッション。
125
+
126
+ ```yaml
127
+ # ~/.config/ttyd-mux/config.yaml
128
+ sessions:
129
+ - name: logs
130
+ dir: /var/log
131
+ - name: docker
132
+ dir: /opt/docker
133
+ - name: admin
134
+ dir: /root
135
+ ```
136
+
137
+ ```bash
138
+ ttyd-mux daemon start --sessions
139
+ ```
140
+
141
+ ### 4. Pair Programming / ペアプログラミング
142
+
143
+ Share your terminal with team members via browser.
144
+
145
+ ブラウザ経由でチームメンバーとターミナルを共有。
146
+
147
+ ---
148
+
149
+ ## Motivation / 開発動機
26
150
 
27
- - Run `ttyd-mux up` in any directory to start a browser-accessible terminal
28
- - Provides a portal page to manage all sessions
29
- - Integrates with reverse proxies like Caddy for external access
30
- - Perfect for monitoring AI coding assistants like Claude Code remotely
151
+ **English:**
152
+ This tool was developed to easily access terminal sessions running AI coding assistants like [Claude Code](https://docs.anthropic.com/en/docs/claude-code) from a web browser. When running long coding sessions with AI assistants on a remote server, you can monitor and interact with them from anywhere through your browser.
31
153
 
32
154
  **日本語:**
33
- ttyd-mux は、複数の Web ターミナル(ttyd)セッションを簡単に管理するためのツールです。
155
+ このツールは、[Claude Code](https://docs.anthropic.com/ja/docs/claude-code) などの AI コーディングアシスタントを実行しているターミナルセッションに、ブラウザから簡単にアクセスできるようにする目的で開発されました。リモートサーバーで AI アシスタントと長時間のコーディングセッションを実行する際、ブラウザからどこからでも監視・操作できます。
34
156
 
35
- - カレントディレクトリで `ttyd-mux up` するだけでブラウザアクセス可能なターミナルを起動
36
- - 複数セッションを一元管理するポータルページを提供
37
- - Caddy などのリバースプロキシと連携して外部公開
38
- - Claude Code などの AI コーディングアシスタントをリモートから監視するのに最適
157
+ ---
39
158
 
40
159
  ## Installation / インストール
41
160
 
@@ -61,8 +180,13 @@ sudo apt install ttyd tmux
61
180
 
62
181
  # macOS (Homebrew)
63
182
  brew install ttyd tmux
183
+
184
+ # Check installation / インストール確認
185
+ ttyd-mux doctor
64
186
  ```
65
187
 
188
+ ---
189
+
66
190
  ## Usage Patterns / 使い方
67
191
 
68
192
  ttyd-mux has two main usage patterns:
@@ -86,6 +210,9 @@ ttyd-mux up
86
210
  # Check status / 状態確認
87
211
  ttyd-mux status
88
212
 
213
+ # List sessions with URLs / URLと一緒にセッション一覧
214
+ ttyd-mux list --url
215
+
89
216
  # Stop / 停止
90
217
  ttyd-mux down
91
218
  ```
@@ -116,35 +243,55 @@ ttyd-mux daemon start -s
116
243
  ttyd-mux daemon stop --stop-sessions
117
244
  ```
118
245
 
246
+ ---
247
+
119
248
  ## Commands / コマンド
120
249
 
121
250
  ### Session Commands / セッションコマンド
122
251
 
123
- ```bash
124
- ttyd-mux up # Start session for current directory
125
- ttyd-mux down # Stop session for current directory
126
- ttyd-mux status # Show status
127
- ttyd-mux attach [name] # Attach to tmux session directly
128
- ```
252
+ | Command | Description |
253
+ |---------|-------------|
254
+ | `ttyd-mux up` | Start session for current directory / セッション起動 |
255
+ | `ttyd-mux down` | Stop session for current directory / セッション停止 |
256
+ | `ttyd-mux down --kill-tmux` | Stop session and terminate tmux / tmux も終了 |
257
+ | `ttyd-mux status` | Show daemon and session status / 状態表示 |
258
+ | `ttyd-mux list` | List active sessions / セッション一覧 |
259
+ | `ttyd-mux list -l` | List with details (port, directory) / 詳細表示 |
260
+ | `ttyd-mux list --url` | List with access URLs / URL 表示 |
261
+ | `ttyd-mux attach [name]` | Attach to tmux session directly / tmux に直接接続 |
129
262
 
130
263
  ### Daemon Control / デーモン制御
131
264
 
132
- ```bash
133
- ttyd-mux daemon start # Start daemon only
134
- ttyd-mux daemon start --sessions # Start daemon + all predefined sessions
135
- ttyd-mux daemon start -s # Start daemon + select sessions interactively
136
- ttyd-mux daemon start -f # Start in foreground (debug)
137
- ttyd-mux daemon stop # Stop daemon
138
- ttyd-mux daemon stop --stop-sessions # Stop all sessions + daemon
139
- ttyd-mux daemon reload # Reload config (hot-reload)
140
- ttyd-mux daemon restart # Restart daemon (apply code updates)
141
- ```
265
+ | Command | Description |
266
+ |---------|-------------|
267
+ | `ttyd-mux daemon start` | Start daemon only / デーモンのみ起動 |
268
+ | `ttyd-mux daemon start --sessions` | Start daemon + all predefined sessions / 全セッションも起動 |
269
+ | `ttyd-mux daemon start -s` | Start daemon + select sessions / 選択して起動 |
270
+ | `ttyd-mux daemon start -f` | Start in foreground (debug) / フォアグラウンド起動 |
271
+ | `ttyd-mux daemon stop` | Stop daemon / デーモン停止 |
272
+ | `ttyd-mux daemon stop -s` | Stop all sessions + daemon / セッションも停止 |
273
+ | `ttyd-mux daemon stop -s --kill-tmux` | Stop all + terminate tmux / tmux も終了 |
274
+ | `ttyd-mux daemon reload` | Reload config (hot-reload) / 設定リロード |
275
+ | `ttyd-mux daemon restart` | Restart daemon / デーモン再起動 |
276
+
277
+ ### Utilities / ユーティリティ
278
+
279
+ | Command | Description |
280
+ |---------|-------------|
281
+ | `ttyd-mux doctor` | Check dependencies and configuration / 診断 |
282
+ | `ttyd-mux deploy` | Generate static files (for static mode) / 静的ファイル生成 |
283
+
284
+ ### Caddy Integration / Caddy 連携
285
+
286
+ | Command | Description |
287
+ |---------|-------------|
288
+ | `ttyd-mux caddy setup` | Add route via Caddy Admin API / ルート追加 |
289
+ | `ttyd-mux caddy remove` | Remove route / ルート削除 |
290
+ | `ttyd-mux caddy status` | Show routes in Caddy / ルート確認 |
291
+ | `ttyd-mux caddy sync` | Sync routes (static mode) / ルート同期 |
292
+ | `ttyd-mux caddy snippet` | Show Caddyfile snippet / スニペット表示 |
142
293
 
143
- ### Diagnostics / 診断
144
-
145
- ```bash
146
- ttyd-mux doctor # Check dependencies and configuration
147
- ```
294
+ ---
148
295
 
149
296
  ## Configuration / 設定
150
297
 
@@ -183,6 +330,13 @@ proxy_mode: proxy
183
330
  # Hostname for Caddy integration
184
331
  hostname: example.com
185
332
 
333
+ # Toolbar settings (proxy mode only)
334
+ toolbar:
335
+ font_size_default_mobile: 32
336
+ font_size_default_pc: 14
337
+ font_size_min: 10
338
+ font_size_max: 48
339
+
186
340
  # Predefined sessions for static usage / 静的利用のためのセッション定義
187
341
  sessions:
188
342
  - name: project-a
@@ -191,6 +345,8 @@ sessions:
191
345
  dir: /home/user/project-b
192
346
  ```
193
347
 
348
+ ---
349
+
194
350
  ## Architecture / アーキテクチャ
195
351
 
196
352
  ### Proxy Mode (default) / プロキシモード(デフォルト)
@@ -206,12 +362,13 @@ sessions:
206
362
  └─────────┘ │ │ │ project-b) │
207
363
  │ - Portal │ └─────────────────┘
208
364
  │ - Proxy │
365
+ │ - Toolbar │
209
366
  │ - API │
210
367
  └──────────────┘
211
368
  ```
212
369
 
213
370
  - **Caddy**: Forwards external requests to ttyd-mux / 外部からのリクエストを ttyd-mux に転送
214
- - **ttyd-mux daemon**: Portal + reverse proxy to ttyd / ポータル表示 + ttyd へのリバースプロキシ
371
+ - **ttyd-mux daemon**: Portal + reverse proxy + toolbar injection / ポータル + プロキシ + ツールバー注入
215
372
  - **ttyd**: Web terminal for each session (runs tmux) / 各セッションの Web ターミナル(tmux を起動)
216
373
 
217
374
  ### Static Mode / スタティックモード
@@ -265,25 +422,54 @@ ttyd-mux daemon (manages sessions)
265
422
  - `ttyd-mux up` で再起動すると既存の tmux セッションに再接続します
266
423
  - `--kill-tmux` フラグで tmux セッションも完全に終了できます
267
424
 
425
+ ---
426
+
268
427
  ## Toolbar Features / ツールバー機能
269
428
 
270
429
  In proxy mode, ttyd-mux injects a toolbar for improved input experience:
271
430
 
272
431
  プロキシモードでは、入力体験向上のためツールバーが注入されます:
273
432
 
274
- ### Mobile Support / モバイル対応
433
+ ### Mobile / モバイル
275
434
 
276
- - **IME Input**: Virtual keyboard with Japanese IME support / 日本語 IME 対応
435
+ - **IME Input**: Text field with virtual keyboard support / 日本語 IME 対応テキスト入力
277
436
  - **Touch Pinch Zoom**: Two-finger pinch to resize font / 2本指ピンチでフォントサイズ変更
278
437
  - **Double-tap Enter**: Double-tap to send Enter key / ダブルタップで Enter 送信
279
- - **Scroll Buttons**: PgUp/PgDn for scrolling / スクロール用ボタン
438
+ - **Scroll Buttons**: PgUp/PgDn for scrollback / スクロールバック用ボタン
439
+ - **Minimize Mode**: Collapse toolbar for more terminal space / ツールバー最小化
280
440
 
281
- ### PC Browser Support / PC ブラウザ対応
441
+ ### PC Browser / PC ブラウザ
282
442
 
283
443
  - **Ctrl+Scroll Zoom**: Mouse wheel with Ctrl key / Ctrl+マウスホイールでサイズ変更
284
444
  - **Trackpad Pinch Zoom** (Mac): Two-finger pinch gesture / トラックパッドピンチ
285
445
  - **Ctrl+J Toggle**: Show/hide toolbar / ツールバー表示切替
286
446
 
447
+ ---
448
+
449
+ ## PWA Support / PWA 対応
450
+
451
+ ttyd-mux supports Progressive Web App (PWA) for a native app-like experience:
452
+
453
+ ttyd-mux はネイティブアプリのような体験のため PWA に対応しています:
454
+
455
+ ### Features / 機能
456
+
457
+ - **Fullscreen Mode**: No browser address bar / アドレスバーなしのフルスクリーン
458
+ - **Home Screen Icon**: Add to home screen on iOS/Android / ホーム画面にアイコン追加
459
+ - **Auto Reconnect**: Automatically reloads when returning from background / バックグラウンドから復帰時に自動再接続
460
+
461
+ ### How to Install / インストール方法
462
+
463
+ **Android (Chrome):**
464
+ 1. Open portal page / ポータルページを開く
465
+ 2. Menu → "Add to Home screen" / メニュー → 「ホーム画面に追加」
466
+
467
+ **iOS (Safari):**
468
+ 1. Open portal page / ポータルページを開く
469
+ 2. Share → "Add to Home Screen" / 共有 → 「ホーム画面に追加」
470
+
471
+ ---
472
+
287
473
  ## Caddy Integration / Caddy との連携
288
474
 
289
475
  ### Using Admin API (Recommended) / Admin API で設定(推奨)
@@ -312,7 +498,28 @@ handle /ttyd-mux/* {
312
498
  }
313
499
  ```
314
500
 
315
- See [docs/caddy-setup.md](docs/caddy-setup.md) for details, including authentication setup.
501
+ ### Authentication / 認証
502
+
503
+ For external access, configure authentication in Caddy:
504
+
505
+ 外部公開時は Caddy で認証を設定:
506
+
507
+ ```caddyfile
508
+ example.com {
509
+ # Basic authentication
510
+ basicauth /ttyd-mux/* {
511
+ user $2a$14$... # bcrypt hash
512
+ }
513
+
514
+ handle /ttyd-mux/* {
515
+ reverse_proxy 127.0.0.1:7680
516
+ }
517
+ }
518
+ ```
519
+
520
+ See [docs/caddy-setup.md](docs/caddy-setup.md) for details, including OAuth setup.
521
+
522
+ ---
316
523
 
317
524
  ## File Structure / ファイル構成
318
525
 
@@ -325,14 +532,24 @@ See [docs/caddy-setup.md](docs/caddy-setup.md) for details, including authentica
325
532
  ttyd-mux.sock # Daemon communication socket / デーモン通信用ソケット
326
533
  ```
327
534
 
535
+ ---
536
+
328
537
  ## Development / 開発
329
538
 
330
539
  ```bash
540
+ # Clone repository
541
+ git clone https://github.com/cuzic/ttyd-mux.git
542
+ cd ttyd-mux
543
+
544
+ # Install dependencies
545
+ bun install
546
+
331
547
  # Run in development / 開発実行
332
548
  bun run src/index.ts <command>
333
549
 
334
550
  # Test / テスト
335
- bun test
551
+ bun test # Unit tests
552
+ bun run test:e2e # E2E tests (Playwright)
336
553
 
337
554
  # Type check / 型チェック
338
555
  bun run typecheck
@@ -340,10 +557,22 @@ bun run typecheck
340
557
  # Lint / リント
341
558
  bun run check
342
559
 
343
- # Build single executable / ビルド(単一実行ファイル)
344
- bun build src/index.ts --compile --outfile ttyd-mux
560
+ # Build / ビルド
561
+ bun run build
345
562
  ```
346
563
 
564
+ ---
565
+
566
+ ## Contributing / 貢献
567
+
568
+ Issues and Pull Requests are welcome!
569
+
570
+ Issue や Pull Request を歓迎します!
571
+
572
+ See [CLAUDE.md](CLAUDE.md) for development guidelines.
573
+
574
+ ---
575
+
347
576
  ## License / ライセンス
348
577
 
349
578
  MIT
package/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const NAME: "ttyd-mux";
2
- export declare const VERSION: "0.4.1";
2
+ export declare const VERSION: "0.4.2";
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
2
  export const NAME = 'ttyd-mux';
3
- export const VERSION = '0.4.1';
3
+ export const VERSION = '0.4.2';
4
4
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ttyd-mux",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
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",