arashi 1.1.3 → 1.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.md CHANGED
@@ -68,22 +68,49 @@ arashi add git@github.com:user/backend.git
68
68
  # Create a new feature worktree across all repos
69
69
  arashi create feature-new-api
70
70
 
71
+ # Preview worktrees without creating them
72
+ arashi create --dry-run feature-new-api
73
+
71
74
  # Check status across all repos
72
75
  arashi status
73
76
 
77
+ # Sync repos to the parent branch
78
+ arashi sync
79
+
74
80
  # Remove worktree when done
75
81
  arashi remove feature-new-api
82
+
83
+ # Remove a specific worktree path
84
+ arashi remove -f "$(arashi list | fzf)"
76
85
  ```
77
86
 
87
+ Note: `arashi remove` requires an interactive TTY. In non-interactive runs it exits with a clear error.
88
+
89
+ ## Hooks
90
+
91
+ Arashi can run lifecycle hooks during `arashi create` to automate setup tasks.
92
+
93
+ - Global hooks in `.arashi/hooks/`:
94
+ - `pre-create.sh`
95
+ - `post-create.sh`
96
+ - Repo-specific hooks in `.arashi/hooks/`:
97
+ - `pre-create.<child-repo>.sh`
98
+ - `post-create.<child-repo>.sh`
99
+
100
+ Repo-specific hooks run in the new child worktree context and receive main/parent repo paths via environment variables.
101
+
102
+ See `docs/hooks.md` for details.
103
+
78
104
  ## Planned Commands
79
105
 
80
106
  - `arashi init` - Initialize arashi in current repository
81
107
  - `arashi add <git-url>` - Add a repository to the repos folder
82
108
  - `arashi create <branch>` - Create coordinated worktrees
83
109
  - `arashi list` - List all worktrees
84
- - `arashi remove <branch>` - Remove worktrees and branches
110
+ - `arashi remove <branch|path>` - Remove worktrees and branches
85
111
  - `arashi setup` - Run setup scripts
86
112
  - `arashi status` - Show status of all repositories
113
+ - `arashi sync` - Align repositories to the parent branch
87
114
 
88
115
  ## Integration with fzf, tmux, and sesh
89
116
 
@@ -96,6 +123,9 @@ Navigate to any worktree interactively:
96
123
  ```bash
97
124
  # Interactive worktree selection
98
125
  cd $(arashi list | fzf)
126
+
127
+ # Remove a selected worktree
128
+ arashi remove -f "$(arashi list | fzf)"
99
129
  ```
100
130
 
101
131
  **Add as a shell keybinding** for instant access:
@@ -168,68 +198,25 @@ bindkey -s '^g' 'arashi-tmux\n' # Zsh
168
198
 
169
199
  #### Setup
170
200
 
171
- ```bash
172
- # Install sesh
173
- brew install joshmedeski/sesh/sesh
174
-
175
- # Add arashi as a sesh source
176
- # ~/.config/sesh/sesh.toml
177
- [sources]
178
- arashi = "arashi list"
179
- ```
201
+ Follow sesh's [installation instructions](https://github.com/joshmedeski/sesh?tab=readme-ov-file#how-to-install)
180
202
 
181
203
  #### Usage
182
204
 
183
205
  ```bash
184
- # Select from all sessions + arashi worktrees
185
- sesh connect $(sesh list | fzf)
206
+ # Select from arashi worktrees
207
+ sesh connect $(arashi list | fzf)
186
208
 
187
- # Or create a keybinding (Ctrl+A)
188
- bind '"\C-a":"sesh connect \$(sesh list | fzf)\n"'
209
+ # Or create a keybinding (Ctrl+G)
210
+ bind '"\C-g":"sesh connect \$(arashi list | fzf)\n"'
211
+ # zsh:
212
+ bindkey -s '^g' 'sesh connect $(arashi list | fzf)\n'
189
213
  ```
190
214
 
191
215
  **Benefits of sesh:**
192
- - Unified list of existing tmux sessions + arashi worktrees
193
216
  - Smart session naming and path handling
194
217
  - Automatic tmux session creation
195
218
  - Works seamlessly with zoxide and other tools
196
219
 
197
- ### Fish + tmux Integration
198
-
199
- For Fish shell users, here's a complete solution:
200
-
201
- ```fish
202
- # ~/.config/fish/functions/arashi_session.fish
203
- function arashi_session
204
- set -l worktree (arashi list | fzf \
205
- --preview 'cd {} && git status' \
206
- --preview-window=right:60% \
207
- --height=80%)
208
-
209
- if test -n "$worktree"
210
- set -l session_name (basename $worktree)
211
-
212
- if not tmux has-session -t $session_name 2>/dev/null
213
- tmux new-session -d -s $session_name -c $worktree
214
- end
215
-
216
- if set -q TMUX
217
- tmux switch-client -t $session_name
218
- else
219
- tmux attach-session -t $session_name
220
- end
221
- end
222
- end
223
-
224
- # Bind to Ctrl+G
225
- bind \cg arashi_session
226
- ```
227
-
228
- This includes:
229
- - Live git status preview in fzf
230
- - Automatic session creation with smart naming
231
- - Works both inside and outside tmux
232
-
233
220
  ### Comparison Table
234
221
 
235
222
  | Method | Setup Complexity | Features | Best For |
@@ -248,7 +235,7 @@ This includes:
248
235
  ### Example Workflow
249
236
 
250
237
  ```bash
251
- # Morning routine:
238
+ 1. Run `arashi create feature-new-api` to set up worktrees across repos
252
239
  1. Press Ctrl+G
253
240
  2. Type "feature" to filter worktrees
254
241
  3. Select your feature branch worktree
@@ -282,9 +269,6 @@ bun install
282
269
  # Run in development mode
283
270
  bun run dev
284
271
 
285
- # Build single-file executable
286
- bun run build
287
-
288
272
  # Build for all platforms
289
273
  bun run build:all
290
274
 
@@ -328,16 +312,6 @@ Arashi is built with:
328
312
 
329
313
  See the [Design Document](https://github.com/corwinm/arashi-arashi/tree/main/setup/.specify/memory/design.md) in the specs repository for the complete feature roadmap organized by implementation phases.
330
314
 
331
- ### Current Phase: Foundation (Phase 1)
332
- - [x] Project setup and structure
333
- - [x] Type definitions
334
- - [ ] Utility libraries (git, config, filesystem, logger, prompts)
335
-
336
- ### Next Phase: Core Commands (Phase 2)
337
- - [ ] `init` command
338
- - [ ] `add` command
339
- - [ ] `create` command
340
-
341
315
  ## Why "Arashi"?
342
316
 
343
317
  嵐 (Arashi) means "storm" in Japanese. This tool aims to be the calm center - the eye of the storm - that brings order to the chaos of managing multiple repositories and worktrees.
package/bin/arashi CHANGED
@@ -38,5 +38,25 @@ if [ ! -f "$BINARY" ]; then
38
38
  exit 1
39
39
  fi
40
40
 
41
- # Execute with stdin closed (0<&-) for fzf compatibility
42
- exec "$BINARY" "$@" 0<&-
41
+ # Close stdin only when piping list output (fzf compatibility)
42
+ command=""
43
+ force_remove="false"
44
+ for arg in "$@"; do
45
+ case "$arg" in
46
+ -*)
47
+ case "$arg" in
48
+ -f|--force) force_remove="true" ;;
49
+ esac
50
+ continue
51
+ ;;
52
+ *) command="$arg"; break ;;
53
+ esac
54
+ done
55
+
56
+ if [ ! -t 1 ]; then
57
+ if [ "$command" = "list" ] || { [ "$command" = "remove" ] && [ "$force_remove" = "true" ]; }; then
58
+ exec "$BINARY" "$@" 0<&-
59
+ fi
60
+ fi
61
+
62
+ exec "$BINARY" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arashi",
3
- "version": "1.1.3",
3
+ "version": "1.3.0",
4
4
  "description": "Git worktree manager for meta-repositories - The eye of the storm for your development workflow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -96,7 +96,7 @@ async function install() {
96
96
  try {
97
97
  await access(srcDir, constants.F_OK);
98
98
  console.log("✓ Development environment detected, skipping binary download");
99
- console.log(" Run 'bun run build:all' to build binaries locally");
99
+ console.log(" Run 'bun run build' to build binary locally");
100
100
  return;
101
101
  } catch {
102
102
  // Not in development, continue with download