@akiojin/gwt 6.1.0 → 6.4.0

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.ja.md CHANGED
@@ -15,13 +15,15 @@ Rust版はCLI/TUIの主要フローとWeb UI(REST + WebSocket端末)まで
15
15
  ## 主要機能
16
16
 
17
17
  - **モダンTUI**: Ratatuiによるスムーズでレスポンシブなターミナルインターフェース
18
- - **フルスクリーンレイアウト**: リポジトリ情報付きの固定ヘッダー、枠線付きのブランチリスト、キーボードショートカット付きの常時表示フッター
18
+ - **フルスクリーンレイアウト**: リポジトリ情報付きの固定ヘッダー、枠線付きのブランチリスト
19
+ - **ブランチサマリーパネル**: コミット履歴、変更統計、ブランチメタデータに加えて、Tabでセッション要約を切り替えて表示
19
20
  - **スマートブランチ作成**: ガイド付きプロンプトと自動ベースブランチ選択でfeature、bugfix、hotfix、releaseブランチを作成
20
21
  - **高度なワークツリー管理**: 作成、Worktreeのあるブランチのクリーンアップ、パス最適化を含む完全なライフサイクル管理
21
22
  - **Coding Agent 選択**: 起動時の対話型ランチャーでビルトイン(Claude Code / Codex CLI / Gemini CLI / OpenCode)または `~/.gwt/tools.json` 定義のカスタムを選択
22
23
  - **Coding Agent 統合**: 選択したコーディングエージェントをワークツリーで起動(Claude Codeは権限設定・変更処理の統合あり)
23
24
  - **GitHub PR統合**: マージされたプルリクエストのブランチとワークツリーの自動クリーンアップ
24
25
  - **変更管理**: 開発セッション後のコミット、stash、破棄の内蔵サポート
26
+ - **tmux マルチエージェントモード**: tmux ペインを使用して複数のコーディングエージェントを並列実行(tmux 内で実行時に自動有効化)
25
27
  - **ユニバーサルパッケージ**: 一度インストールすれば全プロジェクトで一貫した動作
26
28
 
27
29
  ## インストール
@@ -135,6 +137,52 @@ gwt clean
135
137
  3. **ワークツリー管理**: 既存ワークツリーの表示、オープン、削除
136
138
  4. **ブランチクリーンアップ**: マージ済みPRやベースブランチと差分がないブランチ/ワークツリーをローカルから自動削除(Worktreeのないブランチは対象外)
137
139
 
140
+ ## キーボードショートカット
141
+
142
+ ### ブランチリスト画面
143
+
144
+ | キー | 動作 |
145
+ |-----|------|
146
+ | `Enter` | 既存エージェントペインにフォーカス / 非表示ペインを表示 / ウィザードを開く |
147
+ | `d` | エージェントペインを削除(確認あり) |
148
+ | `v` | エージェントペインの表示/非表示を切り替え |
149
+ | `Space` | ブランチの選択/選択解除 |
150
+ | `Up/Down` | ブランチ間を移動 |
151
+ | `PageUp/PageDown` | ページ移動 |
152
+ | `Home/End` | 先頭/末尾のブランチへジャンプ |
153
+ | `f` | フィルターモードに入る |
154
+ | `r` | ブランチリストを更新 |
155
+ | `c` | マージ済みブランチのクリーンアップ |
156
+ | `x` | ワークツリーの修復 |
157
+ | `l` | ログを表示 |
158
+ | `?` | ヘルプ |
159
+ | `q` / `Ctrl+C` | 終了 |
160
+
161
+ ### フィルターモード
162
+
163
+ | キー | 動作 |
164
+ |-----|------|
165
+ | `Esc` | フィルターモードを終了 |
166
+ | 入力 | ブランチ名でフィルター |
167
+
168
+ ## ステータスアイコンの凡例
169
+
170
+ | アイコン | 色 | 意味 |
171
+ |---------|-----|------|
172
+ | `o` | 緑 | 安全 - コミットされていない変更やプッシュされていないコミットなし |
173
+ | `!` | 赤 | 未コミット - ローカルに変更あり |
174
+ | `^` | 黄 | 未プッシュ - リモートにプッシュされていないコミットあり |
175
+ | `*` | 黄 | 未マージ - マージされていない変更あり |
176
+
177
+ ## エージェントステータス表示
178
+
179
+ ブランチリストの右側に、実行中のエージェントが表示されます:
180
+
181
+ | 形式 | 意味 |
182
+ |------|------|
183
+ | `[/] Claude 01:23:45` | 実行中のエージェント(スピナー、名前、稼働時間) |
184
+ | `[BG] Claude 01:23:45` | 非表示(バックグラウンド)のエージェント(グレーアウト) |
185
+
138
186
  ## コーディングエージェント
139
187
 
140
188
  gwt は PATH 上のエージェントを検出し、ランチャーに表示します。
@@ -325,6 +373,27 @@ cargo run
325
373
  **Git ワークツリー競合**: クリーンアップ機能を使用して古いワークツリーを削除
326
374
  **GitHub認証**: PRクリーンアップ機能使用前に`gh auth login`を実行
327
375
  **バイナリが見つからない**: gwtバイナリがPATHに含まれていることを確認
376
+ **Docker + tmux でのUnicode文字化け**: Dockerコンテナ内のtmuxでUnicode文字(Claude Codeのロゴなど)がアンダースコアに化ける場合、tmuxをUTF-8モードで起動してください:
377
+
378
+ ```bash
379
+ tmux -u
380
+ ```
381
+
382
+ または `~/.tmux.conf` に以下を追加:
383
+
384
+ ```
385
+ set -gq utf8 on
386
+ ```
387
+
388
+ Dockerコンテナ内でロケールのインストールと設定が必要な場合もあります:
389
+
390
+ ```bash
391
+ apt-get update && apt-get install -y locales
392
+ sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
393
+ locale-gen
394
+ export LANG=en_US.UTF-8
395
+ export LC_ALL=en_US.UTF-8
396
+ ```
328
397
 
329
398
  ### デバッグモード
330
399
 
package/README.md CHANGED
@@ -15,13 +15,15 @@ The Rust implementation covers the core CLI/TUI workflow and the Web UI (REST +
15
15
  ## Key Features
16
16
 
17
17
  - **Modern TUI**: Built with Ratatui for a smooth, responsive terminal interface
18
- - **Full-screen Layout**: Persistent header with repo context, boxed branch list, and always-visible footer with keyboard shortcuts
18
+ - **Full-screen Layout**: Persistent header with repo context and boxed branch list
19
+ - **Branch Summary Panel**: Real-time branch details panel with commit history, change stats, branch metadata, plus a Tab-switchable session summary view
19
20
  - **Smart Branch Creation**: Create feature, bugfix, hotfix, or release branches with guided prompts and automatic base branch selection
20
21
  - **Advanced Worktree Management**: Complete lifecycle management including creation, cleanup of worktree-backed branches, and path optimization
21
22
  - **Coding Agent Selection**: Choose between built-in agents (Claude Code / Codex CLI / Gemini CLI / OpenCode) or custom coding agents defined in `~/.gwt/tools.json`
22
23
  - **Coding Agent Integration**: Launch the selected agent in the worktree (Claude Code includes permission handling and post-change flow)
23
24
  - **GitHub PR Integration**: Automatic cleanup of merged pull request branches and worktrees
24
25
  - **Change Management**: Built-in support for committing, stashing, or discarding changes after development sessions
26
+ - **tmux Multi-Agent Mode**: Run multiple coding agents in parallel using tmux panes (automatically enabled when running inside tmux)
25
27
  - **Universal Package**: Install once, use across all your projects with consistent behavior
26
28
 
27
29
  ## Installation
@@ -135,6 +137,52 @@ The tool presents an interactive interface with the following options:
135
137
  3. **Manage Worktrees**: View, open, or remove existing worktrees
136
138
  4. **Cleanup Branches**: Remove merged PR branches or branches identical to their base directly from the CLI (branches without worktrees are excluded)
137
139
 
140
+ ## Keyboard Shortcuts
141
+
142
+ ### Branch List Screen
143
+
144
+ | Key | Action |
145
+ |-----|--------|
146
+ | `Enter` | Focus existing agent pane / Show hidden pane / Open wizard |
147
+ | `d` | Delete agent pane (with confirmation) |
148
+ | `v` | Toggle agent pane visibility (show/hide) |
149
+ | `Space` | Select/Deselect branch |
150
+ | `Up/Down` | Navigate branches |
151
+ | `PageUp/PageDown` | Page navigation |
152
+ | `Home/End` | Jump to first/last branch |
153
+ | `f` | Enter filter mode |
154
+ | `r` | Refresh branch list |
155
+ | `c` | Cleanup merged branches |
156
+ | `x` | Repair worktrees |
157
+ | `l` | View logs |
158
+ | `?` | Help |
159
+ | `q` / `Ctrl+C` | Quit |
160
+
161
+ ### Filter Mode
162
+
163
+ | Key | Action |
164
+ |-----|--------|
165
+ | `Esc` | Exit filter mode |
166
+ | Type | Filter branches by name |
167
+
168
+ ## Status Icons Legend
169
+
170
+ | Icon | Color | Meaning |
171
+ |------|-------|---------|
172
+ | `o` | Green | Safe - No uncommitted or unpushed changes |
173
+ | `!` | Red | Uncommitted - Has local changes |
174
+ | `^` | Yellow | Unpushed - Has commits not pushed to remote |
175
+ | `*` | Yellow | Unmerged - Has unmerged changes |
176
+
177
+ ## Agent Status Display
178
+
179
+ In the branch list, running agents are displayed on the right side:
180
+
181
+ | Format | Meaning |
182
+ |--------|---------|
183
+ | `[/] Claude 01:23:45` | Running agent (spinner, name, uptime) |
184
+ | `[BG] Claude 01:23:45` | Hidden (background) agent (grayed out) |
185
+
138
186
  ## Coding Agents
139
187
 
140
188
  gwt detects agents available on PATH and lists them in the launcher.
@@ -325,6 +373,27 @@ End users can install the latest published package (via npm or the GitHub Releas
325
373
  **Git Worktree Conflicts**: Use the cleanup feature to remove stale worktrees
326
374
  **GitHub Authentication**: Run `gh auth login` before using PR cleanup features
327
375
  **Binary Not Found**: Ensure the gwt binary is in your PATH
376
+ **Unicode Character Corruption in Docker + tmux**: If Unicode characters (like the Claude Code logo) appear as underscores in Docker containers with tmux, start tmux with UTF-8 mode:
377
+
378
+ ```bash
379
+ tmux -u
380
+ ```
381
+
382
+ Or add to your `~/.tmux.conf`:
383
+
384
+ ```
385
+ set -gq utf8 on
386
+ ```
387
+
388
+ You may also need to install and configure locales in your Docker container:
389
+
390
+ ```bash
391
+ apt-get update && apt-get install -y locales
392
+ sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
393
+ locale-gen
394
+ export LANG=en_US.UTF-8
395
+ export LC_ALL=en_US.UTF-8
396
+ ```
328
397
 
329
398
  ### Debug Mode
330
399
 
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@akiojin/gwt",
3
- "version": "6.1.0",
3
+ "version": "6.4.0",
4
4
  "description": "Interactive Git worktree manager with Coding Agent selection (Claude Code / Codex CLI / Gemini CLI)",
5
5
  "bin": {
6
6
  "gwt": "bin/gwt.js"
7
7
  },
8
8
  "type": "module",
9
9
  "scripts": {
10
- "postinstall": "node scripts/postinstall.js"
10
+ "postinstall": "node scripts/postinstall.js",
11
+ "prepare": "test -n \"$CI\" || npx husky install",
12
+ "lint:husky": "bash scripts/verify-husky-hooks.sh"
11
13
  },
12
14
  "keywords": [
13
15
  "git",
@@ -0,0 +1,61 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ # Git設定(node:22-bookwormにはGitが含まれている)
5
+ # グローバルGit設定(安全なディレクトリを追加)
6
+ git config --global --add safe.directory /gwt
7
+
8
+ # ユーザー名とメールの設定(環境変数から)
9
+ if [ -n "${GITHUB_USERNAME:-}" ]; then
10
+ git config --global user.name "$GITHUB_USERNAME"
11
+ fi
12
+
13
+ if [ -n "${GIT_USER_EMAIL:-}" ]; then
14
+ git config --global user.email "$GIT_USER_EMAIL"
15
+ fi
16
+
17
+ # Git認証ファイルを環境変数から作成
18
+ if [ -n "${GITHUB_USERNAME:-}" ] && [ -n "${GITHUB_PERSONAL_ACCESS_TOKEN:-}" ]; then
19
+ printf '%s\n' "https://${GITHUB_USERNAME}:${GITHUB_PERSONAL_ACCESS_TOKEN}@github.com" > /root/.git-credentials
20
+ chmod 600 /root/.git-credentials
21
+ git config --global credential.helper store
22
+ fi
23
+
24
+ # GitHub CLIの認証(GITHUB_TOKENが設定されている場合)
25
+ if [ -n "${GITHUB_TOKEN:-}" ] && command -v gh &> /dev/null; then
26
+ if echo "$GITHUB_TOKEN" | gh auth login --with-token; then
27
+ echo "✅ GitHub CLI authenticated"
28
+ else
29
+ echo "⚠️ GitHub CLI authentication failed (non-fatal)" >&2
30
+ fi
31
+ fi
32
+
33
+ # .codexディレクトリのセットアップ
34
+ # auth.jsonをホストと同期(クロスプラットフォーム対応)
35
+ mkdir -p /root/.codex
36
+ if [ -f /root/.codex-host/auth.json ]; then
37
+ # auth.jsonが誤ってディレクトリとして作成されている場合は削除
38
+ if [ -d /root/.codex/auth.json ]; then
39
+ echo "⚠️ Removing incorrectly created auth.json directory"
40
+ rm -rf /root/.codex/auth.json
41
+ fi
42
+
43
+ # ホストのauth.jsonが存在しない、または空、またはホスト側が新しい場合はコピー
44
+ if [ ! -f /root/.codex/auth.json ] || [ ! -s /root/.codex/auth.json ] || [ /root/.codex-host/auth.json -nt /root/.codex/auth.json ]; then
45
+ cp /root/.codex-host/auth.json /root/.codex/auth.json
46
+ chmod 600 /root/.codex/auth.json
47
+ echo "✅ Codex auth.json synced from host"
48
+ else
49
+ echo "✅ Codex auth.json is up to date"
50
+ fi
51
+ else
52
+ echo "ℹ️ INFO: Codex auth.json not found on host (optional)"
53
+ fi
54
+
55
+ echo "🚀 Docker development environment is ready!"
56
+ echo " You can now build the project with: bun run build"
57
+ echo " Or start development with: bun run dev"
58
+ echo ""
59
+
60
+ # コマンドの実行(デフォルトはbash)
61
+ exec "$@"
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6
+ PRE_PUSH="$ROOT_DIR/.husky/pre-push"
7
+ PRE_COMMIT="$ROOT_DIR/.husky/pre-commit"
8
+ PACKAGE_JSON="$ROOT_DIR/package.json"
9
+
10
+ fail() {
11
+ echo "Husky hook verification failed: $1" >&2
12
+ exit 1
13
+ }
14
+
15
+ require_file() {
16
+ if [ ! -f "$1" ]; then
17
+ fail "Missing file: $1"
18
+ fi
19
+ }
20
+
21
+ require_contains() {
22
+ local file="$1"
23
+ local pattern="$2"
24
+ if ! grep -Fq "$pattern" "$file"; then
25
+ fail "Expected pattern not found in $file: $pattern"
26
+ fi
27
+ }
28
+
29
+ require_not_contains() {
30
+ local file="$1"
31
+ local pattern="$2"
32
+ if grep -Fq "$pattern" "$file"; then
33
+ fail "Unexpected pattern found in $file: $pattern"
34
+ fi
35
+ }
36
+
37
+ require_file "$PACKAGE_JSON"
38
+ require_contains "$PACKAGE_JSON" "\"prepare\": \"bunx husky install\""
39
+ require_contains "$PACKAGE_JSON" "\"lint:husky\": \"bash scripts/verify-husky-hooks.sh\""
40
+
41
+ require_file "$PRE_PUSH"
42
+ require_contains "$PRE_PUSH" "cargo clippy --all-targets --all-features -- -D warnings"
43
+ require_contains "$PRE_PUSH" "cargo fmt --all -- --check"
44
+ require_contains "$PRE_PUSH" "bunx --bun markdownlint-cli . --config .markdownlint.json --ignore target --ignore CHANGELOG.md"
45
+
46
+ if [ -f "$PRE_COMMIT" ]; then
47
+ require_not_contains "$PRE_COMMIT" "cargo clippy --all-targets --all-features -- -D warnings"
48
+ require_not_contains "$PRE_COMMIT" "cargo fmt --all -- --check"
49
+ require_not_contains "$PRE_COMMIT" "markdownlint-cli"
50
+ fi
51
+
52
+ echo "Husky hook verification passed."