@akiojin/gwt 6.1.0 → 6.3.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 +69 -1
- package/README.md +69 -1
- package/package.json +4 -2
- package/scripts/entrypoint.sh +61 -0
- package/scripts/verify-husky-hooks.sh +52 -0
package/README.ja.md
CHANGED
|
@@ -15,13 +15,14 @@ Rust版はCLI/TUIの主要フローとWeb UI(REST + WebSocket端末)まで
|
|
|
15
15
|
## 主要機能
|
|
16
16
|
|
|
17
17
|
- **モダンTUI**: Ratatuiによるスムーズでレスポンシブなターミナルインターフェース
|
|
18
|
-
- **フルスクリーンレイアウト**:
|
|
18
|
+
- **フルスクリーンレイアウト**: リポジトリ情報付きの固定ヘッダー、枠線付きのブランチリスト
|
|
19
19
|
- **スマートブランチ作成**: ガイド付きプロンプトと自動ベースブランチ選択でfeature、bugfix、hotfix、releaseブランチを作成
|
|
20
20
|
- **高度なワークツリー管理**: 作成、Worktreeのあるブランチのクリーンアップ、パス最適化を含む完全なライフサイクル管理
|
|
21
21
|
- **Coding Agent 選択**: 起動時の対話型ランチャーでビルトイン(Claude Code / Codex CLI / Gemini CLI / OpenCode)または `~/.gwt/tools.json` 定義のカスタムを選択
|
|
22
22
|
- **Coding Agent 統合**: 選択したコーディングエージェントをワークツリーで起動(Claude Codeは権限設定・変更処理の統合あり)
|
|
23
23
|
- **GitHub PR統合**: マージされたプルリクエストのブランチとワークツリーの自動クリーンアップ
|
|
24
24
|
- **変更管理**: 開発セッション後のコミット、stash、破棄の内蔵サポート
|
|
25
|
+
- **tmux マルチエージェントモード**: tmux ペインを使用して複数のコーディングエージェントを並列実行(tmux 内で実行時に自動有効化)
|
|
25
26
|
- **ユニバーサルパッケージ**: 一度インストールすれば全プロジェクトで一貫した動作
|
|
26
27
|
|
|
27
28
|
## インストール
|
|
@@ -135,6 +136,52 @@ gwt clean
|
|
|
135
136
|
3. **ワークツリー管理**: 既存ワークツリーの表示、オープン、削除
|
|
136
137
|
4. **ブランチクリーンアップ**: マージ済みPRやベースブランチと差分がないブランチ/ワークツリーをローカルから自動削除(Worktreeのないブランチは対象外)
|
|
137
138
|
|
|
139
|
+
## キーボードショートカット
|
|
140
|
+
|
|
141
|
+
### ブランチリスト画面
|
|
142
|
+
|
|
143
|
+
| キー | 動作 |
|
|
144
|
+
|-----|------|
|
|
145
|
+
| `Enter` | 既存エージェントペインにフォーカス / 非表示ペインを表示 / ウィザードを開く |
|
|
146
|
+
| `d` | エージェントペインを削除(確認あり) |
|
|
147
|
+
| `v` | エージェントペインの表示/非表示を切り替え |
|
|
148
|
+
| `Space` | ブランチの選択/選択解除 |
|
|
149
|
+
| `Up/Down` | ブランチ間を移動 |
|
|
150
|
+
| `PageUp/PageDown` | ページ移動 |
|
|
151
|
+
| `Home/End` | 先頭/末尾のブランチへジャンプ |
|
|
152
|
+
| `f` | フィルターモードに入る |
|
|
153
|
+
| `r` | ブランチリストを更新 |
|
|
154
|
+
| `c` | マージ済みブランチのクリーンアップ |
|
|
155
|
+
| `x` | ワークツリーの修復 |
|
|
156
|
+
| `l` | ログを表示 |
|
|
157
|
+
| `?` | ヘルプ |
|
|
158
|
+
| `q` / `Ctrl+C` | 終了 |
|
|
159
|
+
|
|
160
|
+
### フィルターモード
|
|
161
|
+
|
|
162
|
+
| キー | 動作 |
|
|
163
|
+
|-----|------|
|
|
164
|
+
| `Esc` | フィルターモードを終了 |
|
|
165
|
+
| 入力 | ブランチ名でフィルター |
|
|
166
|
+
|
|
167
|
+
## ステータスアイコンの凡例
|
|
168
|
+
|
|
169
|
+
| アイコン | 色 | 意味 |
|
|
170
|
+
|---------|-----|------|
|
|
171
|
+
| `o` | 緑 | 安全 - コミットされていない変更やプッシュされていないコミットなし |
|
|
172
|
+
| `!` | 赤 | 未コミット - ローカルに変更あり |
|
|
173
|
+
| `^` | 黄 | 未プッシュ - リモートにプッシュされていないコミットあり |
|
|
174
|
+
| `*` | 黄 | 未マージ - マージされていない変更あり |
|
|
175
|
+
|
|
176
|
+
## エージェントステータス表示
|
|
177
|
+
|
|
178
|
+
ブランチリストの右側に、実行中のエージェントが表示されます:
|
|
179
|
+
|
|
180
|
+
| 形式 | 意味 |
|
|
181
|
+
|------|------|
|
|
182
|
+
| `[/] Claude 01:23:45` | 実行中のエージェント(スピナー、名前、稼働時間) |
|
|
183
|
+
| `[BG] Claude 01:23:45` | 非表示(バックグラウンド)のエージェント(グレーアウト) |
|
|
184
|
+
|
|
138
185
|
## コーディングエージェント
|
|
139
186
|
|
|
140
187
|
gwt は PATH 上のエージェントを検出し、ランチャーに表示します。
|
|
@@ -325,6 +372,27 @@ cargo run
|
|
|
325
372
|
**Git ワークツリー競合**: クリーンアップ機能を使用して古いワークツリーを削除
|
|
326
373
|
**GitHub認証**: PRクリーンアップ機能使用前に`gh auth login`を実行
|
|
327
374
|
**バイナリが見つからない**: gwtバイナリがPATHに含まれていることを確認
|
|
375
|
+
**Docker + tmux でのUnicode文字化け**: Dockerコンテナ内のtmuxでUnicode文字(Claude Codeのロゴなど)がアンダースコアに化ける場合、tmuxをUTF-8モードで起動してください:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
tmux -u
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
または `~/.tmux.conf` に以下を追加:
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
set -gq utf8 on
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Dockerコンテナ内でロケールのインストールと設定が必要な場合もあります:
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
apt-get update && apt-get install -y locales
|
|
391
|
+
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
|
|
392
|
+
locale-gen
|
|
393
|
+
export LANG=en_US.UTF-8
|
|
394
|
+
export LC_ALL=en_US.UTF-8
|
|
395
|
+
```
|
|
328
396
|
|
|
329
397
|
### デバッグモード
|
|
330
398
|
|
package/README.md
CHANGED
|
@@ -15,13 +15,14 @@ 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
|
|
18
|
+
- **Full-screen Layout**: Persistent header with repo context and boxed branch list
|
|
19
19
|
- **Smart Branch Creation**: Create feature, bugfix, hotfix, or release branches with guided prompts and automatic base branch selection
|
|
20
20
|
- **Advanced Worktree Management**: Complete lifecycle management including creation, cleanup of worktree-backed branches, and path optimization
|
|
21
21
|
- **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
22
|
- **Coding Agent Integration**: Launch the selected agent in the worktree (Claude Code includes permission handling and post-change flow)
|
|
23
23
|
- **GitHub PR Integration**: Automatic cleanup of merged pull request branches and worktrees
|
|
24
24
|
- **Change Management**: Built-in support for committing, stashing, or discarding changes after development sessions
|
|
25
|
+
- **tmux Multi-Agent Mode**: Run multiple coding agents in parallel using tmux panes (automatically enabled when running inside tmux)
|
|
25
26
|
- **Universal Package**: Install once, use across all your projects with consistent behavior
|
|
26
27
|
|
|
27
28
|
## Installation
|
|
@@ -135,6 +136,52 @@ The tool presents an interactive interface with the following options:
|
|
|
135
136
|
3. **Manage Worktrees**: View, open, or remove existing worktrees
|
|
136
137
|
4. **Cleanup Branches**: Remove merged PR branches or branches identical to their base directly from the CLI (branches without worktrees are excluded)
|
|
137
138
|
|
|
139
|
+
## Keyboard Shortcuts
|
|
140
|
+
|
|
141
|
+
### Branch List Screen
|
|
142
|
+
|
|
143
|
+
| Key | Action |
|
|
144
|
+
|-----|--------|
|
|
145
|
+
| `Enter` | Focus existing agent pane / Show hidden pane / Open wizard |
|
|
146
|
+
| `d` | Delete agent pane (with confirmation) |
|
|
147
|
+
| `v` | Toggle agent pane visibility (show/hide) |
|
|
148
|
+
| `Space` | Select/Deselect branch |
|
|
149
|
+
| `Up/Down` | Navigate branches |
|
|
150
|
+
| `PageUp/PageDown` | Page navigation |
|
|
151
|
+
| `Home/End` | Jump to first/last branch |
|
|
152
|
+
| `f` | Enter filter mode |
|
|
153
|
+
| `r` | Refresh branch list |
|
|
154
|
+
| `c` | Cleanup merged branches |
|
|
155
|
+
| `x` | Repair worktrees |
|
|
156
|
+
| `l` | View logs |
|
|
157
|
+
| `?` | Help |
|
|
158
|
+
| `q` / `Ctrl+C` | Quit |
|
|
159
|
+
|
|
160
|
+
### Filter Mode
|
|
161
|
+
|
|
162
|
+
| Key | Action |
|
|
163
|
+
|-----|--------|
|
|
164
|
+
| `Esc` | Exit filter mode |
|
|
165
|
+
| Type | Filter branches by name |
|
|
166
|
+
|
|
167
|
+
## Status Icons Legend
|
|
168
|
+
|
|
169
|
+
| Icon | Color | Meaning |
|
|
170
|
+
|------|-------|---------|
|
|
171
|
+
| `o` | Green | Safe - No uncommitted or unpushed changes |
|
|
172
|
+
| `!` | Red | Uncommitted - Has local changes |
|
|
173
|
+
| `^` | Yellow | Unpushed - Has commits not pushed to remote |
|
|
174
|
+
| `*` | Yellow | Unmerged - Has unmerged changes |
|
|
175
|
+
|
|
176
|
+
## Agent Status Display
|
|
177
|
+
|
|
178
|
+
In the branch list, running agents are displayed on the right side:
|
|
179
|
+
|
|
180
|
+
| Format | Meaning |
|
|
181
|
+
|--------|---------|
|
|
182
|
+
| `[/] Claude 01:23:45` | Running agent (spinner, name, uptime) |
|
|
183
|
+
| `[BG] Claude 01:23:45` | Hidden (background) agent (grayed out) |
|
|
184
|
+
|
|
138
185
|
## Coding Agents
|
|
139
186
|
|
|
140
187
|
gwt detects agents available on PATH and lists them in the launcher.
|
|
@@ -325,6 +372,27 @@ End users can install the latest published package (via npm or the GitHub Releas
|
|
|
325
372
|
**Git Worktree Conflicts**: Use the cleanup feature to remove stale worktrees
|
|
326
373
|
**GitHub Authentication**: Run `gh auth login` before using PR cleanup features
|
|
327
374
|
**Binary Not Found**: Ensure the gwt binary is in your PATH
|
|
375
|
+
**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:
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
tmux -u
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Or add to your `~/.tmux.conf`:
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
set -gq utf8 on
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
You may also need to install and configure locales in your Docker container:
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
apt-get update && apt-get install -y locales
|
|
391
|
+
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen
|
|
392
|
+
locale-gen
|
|
393
|
+
export LANG=en_US.UTF-8
|
|
394
|
+
export LC_ALL=en_US.UTF-8
|
|
395
|
+
```
|
|
328
396
|
|
|
329
397
|
### Debug Mode
|
|
330
398
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akiojin/gwt",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.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."
|