@aku11i/phantom 0.1.2 → 0.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 +254 -0
- package/README.md +90 -32
- package/dist/phantom.js +293 -217
- package/dist/phantom.js.map +4 -4
- package/package.json +7 -9
- package/dist/garden.js +0 -394
- package/dist/garden.js.map +0 -7
package/README.ja.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# 👻 Phantom
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**Git worktreeを使った並行開発のためのパワフルなCLIツール**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@aku11i/phantom)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
|
|
11
|
+
[インストール](#-インストール) • [クイックスタート](#-クイックスタート) • [なぜPhantom?](#-なぜphantom) • [ドキュメント](#-ドキュメント)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
## ✨ 主な機能
|
|
16
|
+
|
|
17
|
+
- 🚀 **シンプルなWorktree管理** - 直感的なコマンドでGit worktreeを作成・管理
|
|
18
|
+
- 🔄 **シームレスなコンテキスト切り替え** - stashやcommitせずに異なる機能間をジャンプ
|
|
19
|
+
- 🤖 **AI対応** - 複数のAIコーディングエージェントを並行実行するのに最適
|
|
20
|
+
- 🎯 **ブランチとWorktreeの同期** - 各worktreeに対応するブランチを自動作成
|
|
21
|
+
- 🐚 **インタラクティブシェル** - SSH風のworktreeナビゲーション体験
|
|
22
|
+
- ⚡ **ゼロ設定** - 賢明なデフォルト設定ですぐに使用可能
|
|
23
|
+
|
|
24
|
+
## 🤔 なぜPhantom?
|
|
25
|
+
|
|
26
|
+
現代の開発ワークフローでは、複数の機能を同時に作業することがよくあります。AIコーディングエージェントを並行実行したり、開発しながらPRをレビューしたり、単純に複数の機能をマルチタスクで作業したりする場合、複数のGit worktreeの管理は面倒になりがちです。
|
|
27
|
+
|
|
28
|
+
**問題点:**
|
|
29
|
+
- Git worktreeコマンドは冗長で複雑
|
|
30
|
+
- ブランチとworktreeを別々に管理するのはエラーが起きやすい
|
|
31
|
+
- コンテキストの切り替えには複数のコマンドが必要
|
|
32
|
+
- 同じコードベースで並行してAIエージェントを実行するのは困難
|
|
33
|
+
|
|
34
|
+
**Phantomの解決策:**
|
|
35
|
+
- 1つのコマンドでworktreeとブランチの両方を作成: `phantom create feature-x`
|
|
36
|
+
- 即座にコンテキストを切り替え: `phantom shell feature-x`
|
|
37
|
+
- ディレクトリを変更せずにコマンドを実行: `phantom exec feature-x npm test`
|
|
38
|
+
- 複数のAIエージェントとの「並行バイブコーディング」に最適
|
|
39
|
+
|
|
40
|
+
## 🚀 クイックスタート
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Phantomをインストール
|
|
44
|
+
npm install -g @aku11i/phantom
|
|
45
|
+
|
|
46
|
+
# 新しいworktreeを作成
|
|
47
|
+
phantom create feature-awesome
|
|
48
|
+
|
|
49
|
+
# worktreeにジャンプ
|
|
50
|
+
phantom shell feature-awesome
|
|
51
|
+
|
|
52
|
+
# または直接コマンドを実行
|
|
53
|
+
phantom exec feature-awesome npm install
|
|
54
|
+
phantom exec feature-awesome npm test
|
|
55
|
+
|
|
56
|
+
# すべてのworktreeをリスト表示
|
|
57
|
+
phantom list
|
|
58
|
+
|
|
59
|
+
# 完了したらクリーンアップ
|
|
60
|
+
phantom delete feature-awesome
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 📦 インストール
|
|
64
|
+
|
|
65
|
+
### npmを使用(推奨)
|
|
66
|
+
```bash
|
|
67
|
+
npm install -g @aku11i/phantom
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### pnpmを使用
|
|
71
|
+
```bash
|
|
72
|
+
pnpm add -g @aku11i/phantom
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### yarnを使用
|
|
76
|
+
```bash
|
|
77
|
+
yarn global add @aku11i/phantom
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### ソースからビルド
|
|
81
|
+
```bash
|
|
82
|
+
git clone https://github.com/aku11i/phantom.git
|
|
83
|
+
cd phantom
|
|
84
|
+
pnpm install
|
|
85
|
+
pnpm build
|
|
86
|
+
npm link
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 📖 ドキュメント
|
|
90
|
+
|
|
91
|
+
### コアコンセプト
|
|
92
|
+
|
|
93
|
+
**Worktree** 🌳 - Phantomによって管理されるGit worktree。各worktreeは特定のブランチや機能のための独立したワークスペースで、競合なしに並行開発が可能です。
|
|
94
|
+
|
|
95
|
+
### コマンド概要
|
|
96
|
+
|
|
97
|
+
#### Worktree管理
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# 対応するブランチを持つ新しいworktreeを作成
|
|
101
|
+
phantom create <name>
|
|
102
|
+
|
|
103
|
+
# すべてのworktreeとその現在のステータスをリスト表示
|
|
104
|
+
phantom list
|
|
105
|
+
|
|
106
|
+
# worktreeへの絶対パスを取得
|
|
107
|
+
phantom where <name>
|
|
108
|
+
|
|
109
|
+
# worktreeとそのブランチを削除
|
|
110
|
+
phantom delete <name>
|
|
111
|
+
phantom delete <name> --force # コミットされていない変更がある場合の強制削除
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
#### Worktreeでの作業
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# worktreeのコンテキストで任意のコマンドを実行
|
|
118
|
+
phantom exec <name> <command> [args...]
|
|
119
|
+
|
|
120
|
+
# 例:
|
|
121
|
+
phantom exec feature-auth npm install
|
|
122
|
+
phantom exec feature-auth npm run test
|
|
123
|
+
phantom exec feature-auth git status
|
|
124
|
+
|
|
125
|
+
# worktreeでインタラクティブシェルセッションを開く
|
|
126
|
+
phantom shell <name>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### 環境変数
|
|
130
|
+
|
|
131
|
+
Phantomで管理されたworktree内で作業する際、以下の環境変数が利用可能です:
|
|
132
|
+
|
|
133
|
+
- `PHANTOM_NAME` - 現在のworktreeの名前
|
|
134
|
+
- `PHANTOM_PATH` - worktreeディレクトリへの絶対パス
|
|
135
|
+
|
|
136
|
+
## 🔄 Phantom vs Git Worktree
|
|
137
|
+
|
|
138
|
+
| 機能 | Git Worktree | Phantom |
|
|
139
|
+
|---------|--------------|---------|
|
|
140
|
+
| worktree + ブランチの作成 | `git worktree add -b feature ../project-feature` | `phantom create feature` |
|
|
141
|
+
| worktreeのリスト表示 | `git worktree list` | `phantom list` |
|
|
142
|
+
| worktreeへの移動 | `cd ../project-feature` | `phantom shell feature` |
|
|
143
|
+
| worktreeでコマンド実行 | `cd ../project-feature && npm test` | `phantom exec feature npm test` |
|
|
144
|
+
| worktreeの削除 | `git worktree remove ../project-feature` | `phantom delete feature` |
|
|
145
|
+
|
|
146
|
+
## 🛠️ 開発
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# クローンとセットアップ
|
|
150
|
+
git clone https://github.com/aku11i/phantom.git
|
|
151
|
+
cd phantom
|
|
152
|
+
pnpm install
|
|
153
|
+
|
|
154
|
+
# テストの実行
|
|
155
|
+
pnpm test
|
|
156
|
+
|
|
157
|
+
# 型チェック
|
|
158
|
+
pnpm type-check
|
|
159
|
+
|
|
160
|
+
# リンティング
|
|
161
|
+
pnpm lint
|
|
162
|
+
|
|
163
|
+
# すべてのチェックを実行
|
|
164
|
+
pnpm ready
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## 🚀 リリースプロセス
|
|
168
|
+
|
|
169
|
+
Phantomの新しいバージョンをリリースするには:
|
|
170
|
+
|
|
171
|
+
1. **mainブランチにいて最新の状態であることを確認**
|
|
172
|
+
```bash
|
|
173
|
+
git checkout main
|
|
174
|
+
git pull
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
2. **すべてのチェックを実行**
|
|
178
|
+
```bash
|
|
179
|
+
pnpm ready
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. **バージョンを上げる**
|
|
183
|
+
```bash
|
|
184
|
+
# パッチリリース(バグ修正)の場合
|
|
185
|
+
npm version patch
|
|
186
|
+
|
|
187
|
+
# マイナーリリース(新機能)の場合
|
|
188
|
+
npm version minor
|
|
189
|
+
|
|
190
|
+
# メジャーリリース(破壊的変更)の場合
|
|
191
|
+
npm version major
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
4. **バージョンコミットとタグをプッシュ**
|
|
195
|
+
```bash
|
|
196
|
+
git push && git push --tags
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
5. **npmに公開**
|
|
200
|
+
```bash
|
|
201
|
+
pnpm publish
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
6. **GitHubリリースを作成**
|
|
205
|
+
```bash
|
|
206
|
+
# 自動生成されたノートでリリースを作成
|
|
207
|
+
gh release create v<version> \
|
|
208
|
+
--title "Phantom v<version>" \
|
|
209
|
+
--generate-notes \
|
|
210
|
+
--target main
|
|
211
|
+
|
|
212
|
+
# v0.1.3の例:
|
|
213
|
+
gh release create v0.1.3 \
|
|
214
|
+
--title "Phantom v0.1.3" \
|
|
215
|
+
--generate-notes \
|
|
216
|
+
--target main
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
ビルドプロセスは`prepublishOnly`スクリプトによって自動的に処理され、以下を行います:
|
|
220
|
+
- すべてのテストとチェックを実行
|
|
221
|
+
- esbuildを使用してTypeScriptソースをJavaScriptにビルド
|
|
222
|
+
- `dist/`ディレクトリにバンドルされた実行可能ファイルを作成
|
|
223
|
+
|
|
224
|
+
**注意**: `dist/`ディレクトリはgit-ignoreされており、公開プロセス中にのみ作成されます。
|
|
225
|
+
|
|
226
|
+
## 🤝 コントリビューション
|
|
227
|
+
|
|
228
|
+
コントリビューションは歓迎します!プルリクエストを自由に送信してください。大きな変更については、まず変更したい内容について議論するためにissueを開いてください。
|
|
229
|
+
|
|
230
|
+
以下を必ず行ってください:
|
|
231
|
+
- 適切にテストを更新する
|
|
232
|
+
- 既存のコードスタイルに従う
|
|
233
|
+
- 提出前に`pnpm ready`を実行する
|
|
234
|
+
|
|
235
|
+
## 📄 ライセンス
|
|
236
|
+
|
|
237
|
+
このプロジェクトはMITライセンスの下でライセンスされています - 詳細は[LICENSE](LICENSE)ファイルをご覧ください。
|
|
238
|
+
|
|
239
|
+
## 🙏 謝辞
|
|
240
|
+
|
|
241
|
+
- より良い並行開発ワークフローの必要性に触発されて
|
|
242
|
+
- AI支援開発時代のために構築
|
|
243
|
+
- すべてのコントリビューターに特別な感謝を
|
|
244
|
+
|
|
245
|
+
## 🤝 コントリビューター
|
|
246
|
+
|
|
247
|
+
- [@aku11i](https://github.com/aku11i) - プロジェクトの作成者およびメンテナー
|
|
248
|
+
- [Claude (Anthropic)](https://claude.ai) - コードベースの大部分を実装したAIペアプログラマー
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
<div align="center">
|
|
253
|
+
<a href="https://github.com/aku11i">aku11i</a>と<a href="https://claude.ai">Claude</a>により👻で作成
|
|
254
|
+
</div>
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
10
|
|
|
11
|
-
[Installation](#-installation) • [Quick Start](#-quick-start) • [Why Phantom?](#-why-phantom) • [Documentation](#-documentation)
|
|
11
|
+
[Installation](#-installation) • [Quick Start](#-quick-start) • [Why Phantom?](#-why-phantom) • [Documentation](#-documentation) • [日本語](./README.ja.md)
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
|
@@ -32,7 +32,7 @@ Modern development workflows often require working on multiple features simultan
|
|
|
32
32
|
- Running parallel AI agents on the same codebase is challenging
|
|
33
33
|
|
|
34
34
|
**The Phantom Solution:**
|
|
35
|
-
- One command to create both worktree and branch: `phantom
|
|
35
|
+
- One command to create both worktree and branch: `phantom create feature-x`
|
|
36
36
|
- Instant context switching: `phantom shell feature-x`
|
|
37
37
|
- Execute commands without changing directories: `phantom exec feature-x npm test`
|
|
38
38
|
- Perfect for "parallel vibe coding" with multiple AI agents
|
|
@@ -43,21 +43,21 @@ Modern development workflows often require working on multiple features simultan
|
|
|
43
43
|
# Install Phantom
|
|
44
44
|
npm install -g @aku11i/phantom
|
|
45
45
|
|
|
46
|
-
# Create a new
|
|
47
|
-
phantom
|
|
46
|
+
# Create a new worktree
|
|
47
|
+
phantom create feature-awesome
|
|
48
48
|
|
|
49
|
-
# Jump into the
|
|
49
|
+
# Jump into the worktree
|
|
50
50
|
phantom shell feature-awesome
|
|
51
51
|
|
|
52
52
|
# Or execute commands directly
|
|
53
53
|
phantom exec feature-awesome npm install
|
|
54
54
|
phantom exec feature-awesome npm test
|
|
55
55
|
|
|
56
|
-
# List all your
|
|
57
|
-
phantom
|
|
56
|
+
# List all your worktrees
|
|
57
|
+
phantom list
|
|
58
58
|
|
|
59
59
|
# Clean up when done
|
|
60
|
-
phantom
|
|
60
|
+
phantom delete feature-awesome
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
## 📦 Installation
|
|
@@ -82,6 +82,7 @@ yarn global add @aku11i/phantom
|
|
|
82
82
|
git clone https://github.com/aku11i/phantom.git
|
|
83
83
|
cd phantom
|
|
84
84
|
pnpm install
|
|
85
|
+
pnpm build
|
|
85
86
|
npm link
|
|
86
87
|
```
|
|
87
88
|
|
|
@@ -89,60 +90,58 @@ npm link
|
|
|
89
90
|
|
|
90
91
|
### Core Concepts
|
|
91
92
|
|
|
92
|
-
**
|
|
93
|
-
|
|
94
|
-
**Phantoms** 👻 - Processes or agents that work within gardens.
|
|
93
|
+
**Worktrees** 🌳 - Git worktrees managed by Phantom. Each worktree is an isolated workspace for a specific branch or feature, allowing parallel development without conflicts.
|
|
95
94
|
|
|
96
95
|
### Commands Overview
|
|
97
96
|
|
|
98
|
-
####
|
|
97
|
+
#### Worktree Management
|
|
99
98
|
|
|
100
99
|
```bash
|
|
101
|
-
# Create a new
|
|
102
|
-
phantom
|
|
100
|
+
# Create a new worktree with a matching branch
|
|
101
|
+
phantom create <name>
|
|
103
102
|
|
|
104
|
-
# List all
|
|
105
|
-
phantom
|
|
103
|
+
# List all worktrees with their current status
|
|
104
|
+
phantom list
|
|
106
105
|
|
|
107
|
-
# Get the absolute path to a
|
|
108
|
-
phantom
|
|
106
|
+
# Get the absolute path to a worktree
|
|
107
|
+
phantom where <name>
|
|
109
108
|
|
|
110
|
-
# Delete a
|
|
111
|
-
phantom
|
|
112
|
-
phantom
|
|
109
|
+
# Delete a worktree and its branch
|
|
110
|
+
phantom delete <name>
|
|
111
|
+
phantom delete <name> --force # Force delete with uncommitted changes
|
|
113
112
|
```
|
|
114
113
|
|
|
115
|
-
#### Working with
|
|
114
|
+
#### Working with Worktrees
|
|
116
115
|
|
|
117
116
|
```bash
|
|
118
|
-
# Execute any command in a
|
|
119
|
-
phantom exec <
|
|
117
|
+
# Execute any command in a worktree's context
|
|
118
|
+
phantom exec <name> <command> [args...]
|
|
120
119
|
|
|
121
120
|
# Examples:
|
|
122
121
|
phantom exec feature-auth npm install
|
|
123
122
|
phantom exec feature-auth npm run test
|
|
124
123
|
phantom exec feature-auth git status
|
|
125
124
|
|
|
126
|
-
# Open an interactive shell session in a
|
|
127
|
-
phantom shell <
|
|
125
|
+
# Open an interactive shell session in a worktree
|
|
126
|
+
phantom shell <name>
|
|
128
127
|
```
|
|
129
128
|
|
|
130
129
|
### Environment Variables
|
|
131
130
|
|
|
132
|
-
When working within a Phantom
|
|
131
|
+
When working within a worktree managed by Phantom, these environment variables are available:
|
|
133
132
|
|
|
134
|
-
- `
|
|
135
|
-
- `
|
|
133
|
+
- `PHANTOM_NAME` - Name of the current worktree
|
|
134
|
+
- `PHANTOM_PATH` - Absolute path to the worktree directory
|
|
136
135
|
|
|
137
136
|
## 🔄 Phantom vs Git Worktree
|
|
138
137
|
|
|
139
138
|
| Feature | Git Worktree | Phantom |
|
|
140
139
|
|---------|--------------|---------|
|
|
141
|
-
| Create worktree + branch | `git worktree add -b feature ../project-feature` | `phantom
|
|
142
|
-
| List worktrees | `git worktree list` | `phantom
|
|
140
|
+
| Create worktree + branch | `git worktree add -b feature ../project-feature` | `phantom create feature` |
|
|
141
|
+
| List worktrees | `git worktree list` | `phantom list` |
|
|
143
142
|
| Navigate to worktree | `cd ../project-feature` | `phantom shell feature` |
|
|
144
143
|
| Run command in worktree | `cd ../project-feature && npm test` | `phantom exec feature npm test` |
|
|
145
|
-
| Remove worktree | `git worktree remove ../project-feature` | `phantom
|
|
144
|
+
| Remove worktree | `git worktree remove ../project-feature` | `phantom delete feature` |
|
|
146
145
|
|
|
147
146
|
## 🛠️ Development
|
|
148
147
|
|
|
@@ -165,6 +164,65 @@ pnpm lint
|
|
|
165
164
|
pnpm ready
|
|
166
165
|
```
|
|
167
166
|
|
|
167
|
+
## 🚀 Release Process
|
|
168
|
+
|
|
169
|
+
To release a new version of Phantom:
|
|
170
|
+
|
|
171
|
+
1. **Ensure you're on main branch and up to date**
|
|
172
|
+
```bash
|
|
173
|
+
git checkout main
|
|
174
|
+
git pull
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
2. **Run all checks**
|
|
178
|
+
```bash
|
|
179
|
+
pnpm ready
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
3. **Bump version**
|
|
183
|
+
```bash
|
|
184
|
+
# For patch releases (bug fixes)
|
|
185
|
+
npm version patch
|
|
186
|
+
|
|
187
|
+
# For minor releases (new features)
|
|
188
|
+
npm version minor
|
|
189
|
+
|
|
190
|
+
# For major releases (breaking changes)
|
|
191
|
+
npm version major
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
4. **Push the version commit and tag**
|
|
195
|
+
```bash
|
|
196
|
+
git push && git push --tags
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
5. **Publish to npm**
|
|
200
|
+
```bash
|
|
201
|
+
pnpm publish
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
6. **Create GitHub release**
|
|
205
|
+
```bash
|
|
206
|
+
# Create a release with automatically generated notes
|
|
207
|
+
gh release create v<version> \
|
|
208
|
+
--title "Phantom v<version>" \
|
|
209
|
+
--generate-notes \
|
|
210
|
+
--target main
|
|
211
|
+
|
|
212
|
+
# Example for v0.1.3:
|
|
213
|
+
gh release create v0.1.3 \
|
|
214
|
+
--title "Phantom v0.1.3" \
|
|
215
|
+
--generate-notes \
|
|
216
|
+
--target main
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The build process is automatically handled by the `prepublishOnly` script, which:
|
|
220
|
+
- Runs all tests and checks
|
|
221
|
+
- Builds the TypeScript source to JavaScript using esbuild
|
|
222
|
+
- Creates bundled executables in the `dist/` directory
|
|
223
|
+
|
|
224
|
+
**Note**: The `dist/` directory is git-ignored and only created during the publish process.
|
|
225
|
+
|
|
168
226
|
## 🤝 Contributing
|
|
169
227
|
|
|
170
228
|
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|