arashi 1.5.1 → 1.6.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.
Files changed (3) hide show
  1. package/README.md +10 -0
  2. package/bin/arashi.js +59 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -98,6 +98,7 @@ Arashi currently provides these commands:
98
98
  - `arashi list`
99
99
  - `arashi status`
100
100
  - `arashi remove <branch|path>`
101
+ - `arashi switch [filter] [--repos|--all] [--sesh]`
101
102
  - `arashi pull`
102
103
  - `arashi sync`
103
104
  - `arashi setup [--only <repo>] [--verbose]`
@@ -110,6 +111,10 @@ arashi add git@github.com:your-org/frontend.git
110
111
  arashi add git@github.com:your-org/backend.git
111
112
  arashi create feature-auth-refresh
112
113
  arashi status
114
+ arashi switch feature-auth-refresh # parent repo worktrees
115
+ arashi switch --repos feature-auth-refresh # child repo worktrees in current workspace
116
+ arashi switch --all feature-auth-refresh # all repos
117
+ arashi switch --repos docs # repo-name matching in child repos
113
118
  ```
114
119
 
115
120
  ## Hooks
@@ -163,6 +168,10 @@ bind '"\C-s":"sesh connect \$(arashi list | fzf)\n"'
163
168
  bindkey -s '^s' 'sesh connect $(arashi list | fzf)\n'
164
169
  ```
165
170
 
171
+ You can also use `arashi switch --sesh` directly inside tmux to open the selected worktree in a new tmux window.
172
+
173
+ `arashi switch` also detects tmux, Kitty, Ghostty, WezTerm, and iTerm2 contexts and prefers terminal-native launch behavior when available.
174
+
166
175
  ### Fast remove selection
167
176
 
168
177
  ```bash
@@ -190,6 +199,7 @@ Arashi also ships a dedicated `skills.sh` integration package for guided install
190
199
  - Installation details: [`docs/INSTALLATION.md`](./docs/INSTALLATION.md)
191
200
  - Hook behavior: [`docs/hooks.md`](./docs/hooks.md)
192
201
  - Setup command details: [`docs/commands/setup.md`](./docs/commands/setup.md)
202
+ - Switch command details: [`docs/commands/switch.md`](./docs/commands/switch.md)
193
203
  - Remove command details: [`docs/commands/remove.md`](./docs/commands/remove.md)
194
204
  - FZF integration: [`docs/FZF_COMPATIBILITY.md`](./docs/FZF_COMPATIBILITY.md)
195
205
 
package/bin/arashi.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { spawn } from "node:child_process";
2
+ import { spawn, spawnSync } from "node:child_process";
3
+ import { existsSync } from "node:fs";
3
4
  import { dirname, join } from "node:path";
4
5
  import { fileURLToPath } from "node:url";
5
6
 
@@ -8,14 +9,68 @@ const __dirname = dirname(__filename);
8
9
 
9
10
  const argv = process.argv.slice(2);
10
11
  const isWindows = process.platform === "win32";
12
+
13
+ const ensureInstalled = () => {
14
+ const wrapper = isWindows ? "arashi.bat" : "arashi";
15
+ const wrapperPath = join(__dirname, wrapper);
16
+ const postinstallPath = join(__dirname, "..", "scripts", "postinstall.js");
17
+ const defaultBinary = isWindows ? "arashi.bin.exe" : "arashi.bin";
18
+ const defaultBinaryPath = join(__dirname, defaultBinary);
19
+ const platformBinary = (() => {
20
+ if (isWindows) {
21
+ return "arashi-windows-x64.exe";
22
+ }
23
+
24
+ if (process.platform === "darwin" && process.arch === "arm64") {
25
+ return "arashi-macos-arm64";
26
+ }
27
+
28
+ if (process.platform === "linux" && process.arch === "x64") {
29
+ return "arashi-linux-x64";
30
+ }
31
+
32
+ return null;
33
+ })();
34
+ const platformBinaryPath = platformBinary ? join(__dirname, platformBinary) : null;
35
+ const binaryExists = () => {
36
+ if (existsSync(defaultBinaryPath)) {
37
+ return true;
38
+ }
39
+
40
+ if (platformBinaryPath && existsSync(platformBinaryPath)) {
41
+ return true;
42
+ }
43
+
44
+ return false;
45
+ };
46
+
47
+ if (existsSync(wrapperPath) && binaryExists()) {
48
+ return;
49
+ }
50
+
51
+ console.log("arashi binary missing; running postinstall to download.");
52
+ const result = spawnSync(process.execPath, [postinstallPath], { stdio: "inherit" });
53
+
54
+ if (result.error) {
55
+ console.error(`Failed to run postinstall. ${result.error.message}.`);
56
+ process.exit(1);
57
+ }
58
+
59
+ if (typeof result.status === "number" && result.status !== 0) {
60
+ process.exit(result.status);
61
+ }
62
+ };
63
+
64
+ ensureInstalled();
65
+
11
66
  const wrapper = isWindows ? "arashi.bat" : "arashi";
12
67
  const wrapperPath = join(__dirname, wrapper);
13
68
 
14
69
  const child = isWindows
15
70
  ? spawn(process.env.ComSpec ?? "cmd.exe", ["/d", "/s", "/c", wrapperPath, ...argv], {
16
- stdio: "inherit",
17
- windowsHide: false,
18
- })
71
+ stdio: "inherit",
72
+ windowsHide: false,
73
+ })
19
74
  : spawn(wrapperPath, argv, { stdio: "inherit" });
20
75
 
21
76
  child.on("exit", (code, signal) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arashi",
3
- "version": "1.5.1",
3
+ "version": "1.6.0",
4
4
  "description": "Git worktree manager for meta-repositories - The eye of the storm for your development workflow",
5
5
  "keywords": [
6
6
  "cli",