arashi 1.7.0 → 1.8.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
@@ -99,7 +99,7 @@ Arashi currently provides these commands:
99
99
  - `arashi list`
100
100
  - `arashi status`
101
101
  - `arashi remove <branch|path>`
102
- - `arashi switch [filter] [--repos|--all] [--sesh]`
102
+ - `arashi switch [filter] [--repos|--all] [--sesh] [--no-default-launch]`
103
103
  - `arashi pull`
104
104
  - `arashi sync`
105
105
  - `arashi setup [--only <repo>] [--verbose]`
@@ -111,11 +111,14 @@ arashi init
111
111
  arashi add git@github.com:your-org/frontend.git
112
112
  arashi add git@github.com:your-org/backend.git
113
113
  arashi create feature-auth-refresh
114
+ arashi create feature-auth-refresh --launch
115
+ arashi create feature-auth-refresh --no-launch
114
116
  arashi status
115
117
  arashi switch feature-auth-refresh # parent repo worktrees
116
118
  arashi switch --repos feature-auth-refresh # child repo worktrees in current workspace
117
119
  arashi switch --all feature-auth-refresh # all repos
118
120
  arashi switch --repos docs # repo-name matching in child repos
121
+ arashi switch --no-default-launch # bypass configured launch mode defaults once
119
122
  ```
120
123
 
121
124
  ## Hooks
@@ -130,6 +133,12 @@ Arashi can run lifecycle hooks during `arashi create` and `arashi remove`.
130
133
  - Repository-specific hooks:
131
134
  - `pre-create.<repo>.sh`
132
135
  - `post-create.<repo>.sh`
136
+ - Scoped remove hooks:
137
+ - repository scope: `repos/<repo>/.arashi/hooks/pre-remove.sh` and `post-remove.sh`
138
+ - global shared: `~/.arashi/hooks/pre-remove.sh` and `post-remove.sh`
139
+ - global targeted: `~/.arashi/hooks/<repo>/pre-remove.sh` and `post-remove.sh`
140
+
141
+ For `arashi remove`, hook execution order is: repository scope -> workspace-root scope -> global targeted scope -> global shared scope.
133
142
 
134
143
  `pre-remove.sh` is useful for teardown before deletion (for example, stopping tmux sessions), and `post-remove.sh` can run final cleanup after remove operations complete.
135
144
 
@@ -190,6 +199,36 @@ If you prefer the term `delete`, create a shell alias:
190
199
  alias arashi-delete='arashi remove -f'
191
200
  ```
192
201
 
202
+ ## Configuration Schema
203
+
204
+ Arashi publishes a JSON Schema for `.arashi/config.json` so editors can validate and autocomplete your config.
205
+
206
+ - Stable URL: `https://unpkg.com/arashi/schema/config.schema.json`
207
+ - Version-pinned URL: `https://unpkg.com/arashi@1.7.0/schema/config.schema.json`
208
+
209
+ Example config header:
210
+
211
+ ```json
212
+ {
213
+ "$schema": "https://unpkg.com/arashi/schema/config.schema.json",
214
+ "version": "1.0.0",
215
+ "reposDir": "./repos",
216
+ "defaults": {
217
+ "create": {
218
+ "switch": true,
219
+ "launch": true,
220
+ "launchMode": "sesh"
221
+ },
222
+ "switch": {
223
+ "launchMode": "sesh"
224
+ }
225
+ },
226
+ "repos": {}
227
+ }
228
+ ```
229
+
230
+ Defaults precedence for create/switch behavior: explicit CLI flag > opt-out flag > config default > built-in default.
231
+
193
232
  ## skills.sh Integration
194
233
 
195
234
  Arashi also ships a dedicated `skills.sh` integration package for guided installation, workflow examples, and troubleshooting.
@@ -202,6 +241,7 @@ Arashi also ships a dedicated `skills.sh` integration package for guided install
202
241
  ## Documentation
203
242
 
204
243
  - Installation details: [`docs/INSTALLATION.md`](./docs/INSTALLATION.md)
244
+ - Configuration details: [`docs/configuration.md`](./docs/configuration.md)
205
245
  - Clone command details: [`docs/commands/clone.md`](./docs/commands/clone.md)
206
246
  - Hook behavior: [`docs/hooks.md`](./docs/hooks.md)
207
247
  - Setup command details: [`docs/commands/setup.md`](./docs/commands/setup.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arashi",
3
- "version": "1.7.0",
3
+ "version": "1.8.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",
@@ -32,6 +32,7 @@
32
32
  "bin/arashi.bat",
33
33
  "bin/arashi.ps1",
34
34
  "scripts/postinstall.js",
35
+ "schema/config.schema.json",
35
36
  "README.md",
36
37
  "LICENSE"
37
38
  ],
@@ -57,10 +58,14 @@
57
58
  "lint": "oxlint -D no-explicit-any .",
58
59
  "lint:fix": "oxlint --fix -D no-explicit-any .",
59
60
  "lint:ci": "oxlint --format github -D no-explicit-any .",
61
+ "schema:generate": "ts-json-schema-generator --tsconfig tsconfig.schema.json --path src/lib/config.ts --type Config --expose export --jsDoc extended --out schema/config.schema.json",
62
+ "schema:publish": "bun run schema:generate && oxfmt --config .oxfmtrc.json --write schema/config.schema.json",
63
+ "schema:check": "bun run schema:publish && git diff --exit-code -- schema/config.schema.json",
60
64
  "format": "oxfmt --config .oxfmtrc.json --write .",
61
65
  "format:check": "oxfmt --config .oxfmtrc.json --check .",
62
66
  "quality:changed": "bun run scripts/quality/changed-files-quality.ts",
63
67
  "postinstall": "node scripts/postinstall.js",
68
+ "prepublishOnly": "bun run schema:publish",
64
69
  "prepare": "husky"
65
70
  },
66
71
  "devDependencies": {
@@ -80,6 +85,7 @@
80
85
  "oxfmt": "0.28.0",
81
86
  "oxlint": "1.43.0",
82
87
  "semantic-release": "^24.2.0",
88
+ "ts-json-schema-generator": "2.4.0",
83
89
  "typescript": "^5.9.3"
84
90
  },
85
91
  "lint-staged": {
@@ -0,0 +1,127 @@
1
+ {
2
+ "$ref": "#/definitions/Config",
3
+ "$schema": "http://json-schema.org/draft-07/schema#",
4
+ "definitions": {
5
+ "CommandDefaultsConfig": {
6
+ "additionalProperties": false,
7
+ "properties": {
8
+ "create": {
9
+ "$ref": "#/definitions/CreateCommandDefaults"
10
+ },
11
+ "switch": {
12
+ "$ref": "#/definitions/SwitchCommandDefaults"
13
+ }
14
+ },
15
+ "type": "object"
16
+ },
17
+ "Config": {
18
+ "additionalProperties": false,
19
+ "description": "Root configuration object for Arashi",
20
+ "properties": {
21
+ "$schema": {
22
+ "description": "JSON Schema URL for editor validation/autocomplete",
23
+ "type": "string"
24
+ },
25
+ "defaults": {
26
+ "$ref": "#/definitions/CommandDefaultsConfig",
27
+ "description": "Optional command-scoped defaults for create and switch"
28
+ },
29
+ "hooks": {
30
+ "additionalProperties": false,
31
+ "description": "Optional workspace-level hooks settings",
32
+ "properties": {
33
+ "timeout": {
34
+ "description": "Timeout in milliseconds for long-running operations",
35
+ "type": "number"
36
+ }
37
+ },
38
+ "type": "object"
39
+ },
40
+ "repos": {
41
+ "additionalProperties": {
42
+ "$ref": "#/definitions/RepoConfig"
43
+ },
44
+ "description": "Map of repository names to their configurations",
45
+ "type": "object"
46
+ },
47
+ "reposDir": {
48
+ "description": "Directory where repositories are located",
49
+ "type": "string"
50
+ },
51
+ "sync": {
52
+ "additionalProperties": false,
53
+ "description": "Optional sync command settings",
54
+ "properties": {
55
+ "timeoutSeconds": {
56
+ "description": "Sync timeout in seconds",
57
+ "type": "number"
58
+ }
59
+ },
60
+ "type": "object"
61
+ },
62
+ "version": {
63
+ "$ref": "#/definitions/ConfigVersion",
64
+ "description": "Configuration schema version for migrations"
65
+ },
66
+ "worktreesDir": {
67
+ "description": "Base directory where worktrees are created (workspace-relative)",
68
+ "type": "string"
69
+ }
70
+ },
71
+ "required": ["version", "reposDir", "repos"],
72
+ "type": "object"
73
+ },
74
+ "ConfigVersion": {
75
+ "const": "1.0.0",
76
+ "type": "string"
77
+ },
78
+ "CreateCommandDefaults": {
79
+ "additionalProperties": false,
80
+ "properties": {
81
+ "launch": {
82
+ "description": "Default to launching a terminal/editor context after create",
83
+ "type": "boolean"
84
+ },
85
+ "launchMode": {
86
+ "$ref": "#/definitions/LaunchMode",
87
+ "description": "Preferred launch mode for create-triggered launch"
88
+ },
89
+ "switch": {
90
+ "description": "Default to switching to the new worktree after create",
91
+ "type": "boolean"
92
+ }
93
+ },
94
+ "type": "object"
95
+ },
96
+ "LaunchMode": {
97
+ "enum": ["auto", "sesh"],
98
+ "type": "string"
99
+ },
100
+ "RepoConfig": {
101
+ "additionalProperties": false,
102
+ "description": "Configuration for a single repository",
103
+ "properties": {
104
+ "gitUrl": {
105
+ "description": "Canonical git URL for cloning the repository",
106
+ "type": "string"
107
+ },
108
+ "path": {
109
+ "description": "Path to the repository (relative or absolute)",
110
+ "type": "string"
111
+ }
112
+ },
113
+ "required": ["path"],
114
+ "type": "object"
115
+ },
116
+ "SwitchCommandDefaults": {
117
+ "additionalProperties": false,
118
+ "properties": {
119
+ "launchMode": {
120
+ "$ref": "#/definitions/LaunchMode",
121
+ "description": "Preferred launch mode when running switch"
122
+ }
123
+ },
124
+ "type": "object"
125
+ }
126
+ }
127
+ }