tapback-cli 0.0.2 → 0.0.3

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/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
@@ -16,22 +16,33 @@ tmuxセッションの出力をWebSocket経由でリアルタイム配信し、
16
16
  ## インストール
17
17
 
18
18
  ```bash
19
- npm install
19
+ npm install -g tapback-cli
20
20
  ```
21
21
 
22
22
  ## 使い方
23
23
 
24
24
  ```bash
25
25
  # 基本起動(ポート9876)
26
- node bin/cli.js
26
+ tb
27
27
 
28
28
  # ポート指定
29
- node bin/cli.js 8080
29
+ tb 8080
30
30
 
31
31
  # リバースプロキシ付き(localhost:3000 → :3001で外部公開)
32
- node bin/cli.js --proxy 3000:3001
32
+ tb --proxy 3000:3001
33
33
 
34
34
  # PIN認証を無効化
35
+ tb --no-pin
36
+ ```
37
+
38
+ ### ローカル開発
39
+
40
+ ```bash
41
+ npm install
42
+
43
+ node bin/cli.js
44
+ PORT=9877 node bin/cli.js
45
+ node bin/cli.js --proxy 3000:3001
35
46
  node bin/cli.js --no-pin
36
47
  ```
37
48
 
@@ -49,7 +60,7 @@ node bin/cli.js --no-pin
49
60
 
50
61
  ## 設定
51
62
 
52
- 設定は`~/.tapback.json`に保存されます。Web UIの`/settings`からも編集可能です。
63
+ 設定は`~/.config/tapback/config.json`に保存されます。Web UIの`/settings`からも編集可能です。
53
64
 
54
65
  ```json
55
66
  {
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++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tapback-cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
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