arashi 1.5.0 → 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.
- package/README.md +10 -0
- package/bin/arashi.js +87 -0
- package/package.json +3 -2
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
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn, spawnSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const argv = process.argv.slice(2);
|
|
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
|
+
|
|
66
|
+
const wrapper = isWindows ? "arashi.bat" : "arashi";
|
|
67
|
+
const wrapperPath = join(__dirname, wrapper);
|
|
68
|
+
|
|
69
|
+
const child = isWindows
|
|
70
|
+
? spawn(process.env.ComSpec ?? "cmd.exe", ["/d", "/s", "/c", wrapperPath, ...argv], {
|
|
71
|
+
stdio: "inherit",
|
|
72
|
+
windowsHide: false,
|
|
73
|
+
})
|
|
74
|
+
: spawn(wrapperPath, argv, { stdio: "inherit" });
|
|
75
|
+
|
|
76
|
+
child.on("exit", (code, signal) => {
|
|
77
|
+
if (typeof code === "number") {
|
|
78
|
+
process.exit(code);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
process.exit(signal ? 1 : 0);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
child.on("error", (error) => {
|
|
85
|
+
console.error(`Failed to start arashi. ${error.message}.`);
|
|
86
|
+
process.exit(1);
|
|
87
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arashi",
|
|
3
|
-
"version": "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",
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
"url": "git+https://github.com/corwinm/arashi.git"
|
|
25
25
|
},
|
|
26
26
|
"bin": {
|
|
27
|
-
"arashi": "./bin/arashi"
|
|
27
|
+
"arashi": "./bin/arashi.js"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"bin/arashi",
|
|
31
|
+
"bin/arashi.js",
|
|
31
32
|
"bin/arashi.bat",
|
|
32
33
|
"bin/arashi.ps1",
|
|
33
34
|
"scripts/postinstall.js",
|