tapback-cli 0.0.2 → 0.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.
@@ -0,0 +1,3 @@
1
+ {
2
+ "MD033": false
3
+ }
package/CLAUDE.md CHANGED
@@ -38,7 +38,7 @@ tapback-node/
38
38
  │ ├── tmux.js # tmuxコマンド実行 (child_process.execFile)
39
39
  │ ├── proxy.js # リバースプロキシ (localhost書き換え)
40
40
  │ ├── claudeStatus.js # Claude Codeステータス管理 + hooks設置
41
- │ ├── config.js # 設定ファイル (~/.tapback.json) 読み書き
41
+ │ ├── config.js # 設定ファイル (~/.config/tapback/config.json) 読み書き
42
42
  │ └── html.js # モバイルUI HTML生成
43
43
  ```
44
44
 
@@ -48,7 +48,7 @@ tapback-node/
48
48
  - **tmux.js**: tmuxコマンド(capture-pane, send-keys, list-sessions, display-message)のPromiseラッパー
49
49
  - **proxy.js**: http-proxyベースのリバースプロキシ。localhost参照を自動的にMacのIPに書き換え
50
50
  - **claudeStatus.js**: Claude Codeフック設置、ステータス受信・保存。`~/.claude/settings.json`を更新
51
- - **config.js**: `~/.tapback.json`による設定永続化(PIN有効/無効、プロキシポート、クイックボタン)
51
+ - **config.js**: `~/.config/tapback/config.json`による設定永続化(PIN有効/無効、プロキシポート、クイックボタン)
52
52
  - **html.js**: モバイル向けレスポンシブWebUI、設定ページ、PIN認証ページ
53
53
 
54
54
  ### 通信フロー
@@ -81,4 +81,4 @@ tapback-node/
81
81
  - tmuxコマンドは明示的に`session:0.0`を指定(複数ウィンドウ/ペーン対応のため)
82
82
  - PATH設定で`/opt/homebrew/bin`と`/usr/local/bin`を追加(tmux検出用)
83
83
  - プロキシはlocalhost参照を自動的にMacのIPに書き換え
84
- - 設定ファイルは`~/.tapback.json`に保存
84
+ - 設定ファイルは`~/.config/tapback/config.json`に保存
package/README.md CHANGED
@@ -4,9 +4,22 @@
4
4
 
5
5
  tmuxセッションの出力をWebSocket経由でリアルタイム配信し、スマホからターミナルの閲覧・コマンド入力ができます。
6
6
 
7
+ <p align="center">
8
+ <img src="images/terminal.png" width="280" alt="Terminal"><br>
9
+ <em>ターミナル起動画面 — URL・PIN・設定情報を表示</em>
10
+ </p>
11
+ <p align="center">
12
+ <img src="images/settings.png" width="280" alt="Settings"><br>
13
+ <em>設定画面 — PIN認証・プロキシポート・クイックボタンの管理</em>
14
+ </p>
15
+ <p align="center">
16
+ <img src="images/phone.png" width="280" alt="Phone"><br>
17
+ <em>モバイルUI — tmux出力のリアルタイム表示とコマンド送信</em>
18
+ </p>
19
+
7
20
  ## 機能
8
21
 
9
- - tmuxセッションのリアルタイム監視(1秒間隔)
22
+ - tmuxセッションのリアルタイム監視(0.5秒間隔)
10
23
  - モバイルからのコマンド送信
11
24
  - Claude Codeのステータス表示(hooks連携)
12
25
  - localhostアプリのリバースプロキシ
@@ -16,22 +29,33 @@ tmuxセッションの出力をWebSocket経由でリアルタイム配信し、
16
29
  ## インストール
17
30
 
18
31
  ```bash
19
- npm install
32
+ npm install -g tapback-cli
20
33
  ```
21
34
 
22
35
  ## 使い方
23
36
 
24
37
  ```bash
25
38
  # 基本起動(ポート9876)
26
- node bin/cli.js
39
+ tb
27
40
 
28
41
  # ポート指定
29
- node bin/cli.js 8080
42
+ tb 8080
30
43
 
31
44
  # リバースプロキシ付き(localhost:3000 → :3001で外部公開)
32
- node bin/cli.js --proxy 3000:3001
45
+ tb --proxy 3000:3001
33
46
 
34
47
  # PIN認証を無効化
48
+ tb --no-pin
49
+ ```
50
+
51
+ ### ローカル開発
52
+
53
+ ```bash
54
+ npm install
55
+
56
+ node bin/cli.js
57
+ PORT=9877 node bin/cli.js
58
+ node bin/cli.js --proxy 3000:3001
35
59
  node bin/cli.js --no-pin
36
60
  ```
37
61
 
@@ -49,7 +73,7 @@ node bin/cli.js --no-pin
49
73
 
50
74
  ## 設定
51
75
 
52
- 設定は`~/.tapback.json`に保存されます。Web UIの`/settings`からも編集可能です。
76
+ 設定は`~/.config/tapback/config.json`に保存されます。Web UIの`/settings`からも編集可能です。
53
77
 
54
78
  ```json
55
79
  {
package/bin/cli.js CHANGED
@@ -9,7 +9,7 @@ const config = require('../src/config');
9
9
  const cfg = config.load();
10
10
 
11
11
  // CLI args override config
12
- let port = 9876;
12
+ let port = Number(process.env.PORT) || 9876;
13
13
  const proxyPorts = { ...cfg.proxyPorts };
14
14
 
15
15
  for (let i = 2; i < process.argv.length; i++) {
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tapback-cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Monitor and control tmux sessions from your mobile device",
5
5
  "bin": {
6
6
  "tb": "./bin/cli.js"
package/src/config.js CHANGED
@@ -2,7 +2,8 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
  const os = require('os');
4
4
 
5
- const CONFIG_PATH = path.join(os.homedir(), '.tapback.json');
5
+ const CONFIG_DIR = path.join(os.homedir(), '.config', 'tapback');
6
+ const CONFIG_PATH = path.join(CONFIG_DIR, 'config.json');
6
7
 
7
8
  const DEFAULTS = {
8
9
  pinEnabled: true,
@@ -20,6 +21,7 @@ function load() {
20
21
  }
21
22
 
22
23
  function save(config) {
24
+ fs.mkdirSync(CONFIG_DIR, { recursive: true });
23
25
  fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));
24
26
  }
25
27
 
package/src/server.js CHANGED
@@ -204,7 +204,7 @@ function createServer({ port = 9876, pinEnabled = true, quickButtons = [], appUR
204
204
  if (ws.readyState === 1) ws.send(msg);
205
205
  }
206
206
  }
207
- }, 1000);
207
+ }, 500);
208
208
 
209
209
  server.listen(port, '0.0.0.0');
210
210