@dafish/gogo-meta 1.2.0 → 1.4.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 +169 -92
- package/dist/cli.js +94 -41
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +95 -42
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -10,11 +10,48 @@ A modern TypeScript CLI for managing multi-repository projects. Execute commands
|
|
|
10
10
|
- Flexible filtering (include/exclude by name or pattern)
|
|
11
11
|
- NPM operations across all projects
|
|
12
12
|
- Symlink projects for local development
|
|
13
|
+
- JSON and YAML configuration formats
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
17
|
+
### npm (recommended)
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g @dafish/gogo-meta
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or run without installing:
|
|
24
|
+
|
|
16
25
|
```bash
|
|
17
|
-
|
|
26
|
+
npx @dafish/gogo-meta --help
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Docker
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
docker pull ghcr.io/dafish/gogo-meta
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
When using Docker, mount your working directory and SSH keys so gogo can access your repositories:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
docker run -it --rm \
|
|
39
|
+
-v "$PWD":/workspace \
|
|
40
|
+
-v "$HOME/.ssh":/root/.ssh:ro \
|
|
41
|
+
-w /workspace \
|
|
42
|
+
ghcr.io/dafish/gogo-meta <command>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Any `gogo` command shown in this README can be run via Docker by replacing `gogo` with the `docker run` call above. For convenience, you can create a shell alias:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
alias gogo='docker run -it --rm -v "$PWD":/workspace -v "$HOME/.ssh":/root/.ssh:ro -w /workspace ghcr.io/dafish/gogo-meta'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### From source
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/daFish/gogo-meta.git
|
|
18
55
|
cd gogo-meta
|
|
19
56
|
bun install
|
|
20
57
|
bun run build
|
|
@@ -43,7 +80,11 @@ gogo exec "git status" --parallel
|
|
|
43
80
|
|
|
44
81
|
### .gogo
|
|
45
82
|
|
|
46
|
-
The
|
|
83
|
+
The config file defines child repositories, ignore patterns, and predefined commands. Both JSON and YAML formats are supported.
|
|
84
|
+
|
|
85
|
+
gogo looks for config files in the following order of precedence: `.gogo` (JSON) > `.gogo.yaml` > `.gogo.yml`. The first file found is used.
|
|
86
|
+
|
|
87
|
+
#### JSON format (.gogo)
|
|
47
88
|
|
|
48
89
|
```json
|
|
49
90
|
{
|
|
@@ -70,6 +111,37 @@ The `.gogo` file defines child repositories, ignore patterns, and predefined com
|
|
|
70
111
|
}
|
|
71
112
|
```
|
|
72
113
|
|
|
114
|
+
#### YAML format (.gogo.yaml)
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
# Main services
|
|
118
|
+
projects:
|
|
119
|
+
api: git@github.com:org/api.git
|
|
120
|
+
web: git@github.com:org/web.git
|
|
121
|
+
libs/shared: git@github.com:org/shared.git
|
|
122
|
+
|
|
123
|
+
ignore:
|
|
124
|
+
- .git
|
|
125
|
+
- node_modules
|
|
126
|
+
- .vagrant
|
|
127
|
+
- .vscode
|
|
128
|
+
|
|
129
|
+
# Predefined commands
|
|
130
|
+
commands:
|
|
131
|
+
build: npm run build
|
|
132
|
+
test:
|
|
133
|
+
cmd: npm test
|
|
134
|
+
parallel: true
|
|
135
|
+
description: Run tests in all projects
|
|
136
|
+
deploy:
|
|
137
|
+
cmd: npm run deploy
|
|
138
|
+
parallel: true
|
|
139
|
+
concurrency: 2
|
|
140
|
+
includeOnly:
|
|
141
|
+
- api
|
|
142
|
+
- web
|
|
143
|
+
```
|
|
144
|
+
|
|
73
145
|
### .looprc (optional)
|
|
74
146
|
|
|
75
147
|
Define default ignore patterns for command execution:
|
|
@@ -86,29 +158,31 @@ Define default ignore patterns for command execution:
|
|
|
86
158
|
|
|
87
159
|
These options are available for most commands:
|
|
88
160
|
|
|
89
|
-
| Option
|
|
90
|
-
|
|
91
|
-
| `--include-only <dirs>`
|
|
92
|
-
| `--exclude-only <dirs>`
|
|
93
|
-
| `--include-pattern <regex>` | Include directories matching regex pattern
|
|
94
|
-
| `--exclude-pattern <regex>` | Exclude directories matching regex pattern
|
|
95
|
-
| `--parallel`
|
|
96
|
-
| `--concurrency <n>`
|
|
161
|
+
| Option | Description |
|
|
162
|
+
| --------------------------- | --------------------------------------------------- |
|
|
163
|
+
| `--include-only <dirs>` | Only target specified directories (comma-separated) |
|
|
164
|
+
| `--exclude-only <dirs>` | Exclude specified directories (comma-separated) |
|
|
165
|
+
| `--include-pattern <regex>` | Include directories matching regex pattern |
|
|
166
|
+
| `--exclude-pattern <regex>` | Exclude directories matching regex pattern |
|
|
167
|
+
| `--parallel` | Execute commands concurrently |
|
|
168
|
+
| `--concurrency <n>` | Maximum parallel processes (default: 4) |
|
|
97
169
|
|
|
98
170
|
---
|
|
99
171
|
|
|
100
172
|
### `gogo init`
|
|
101
173
|
|
|
102
|
-
Initialize a new gogo-meta repository by creating a
|
|
174
|
+
Initialize a new gogo-meta repository by creating a config file.
|
|
103
175
|
|
|
104
176
|
```bash
|
|
105
|
-
gogo init
|
|
106
|
-
gogo init --
|
|
177
|
+
gogo init # Create .gogo (JSON, default)
|
|
178
|
+
gogo init --format yaml # Create .gogo.yaml (YAML)
|
|
179
|
+
gogo init --force # Overwrite existing config file
|
|
107
180
|
```
|
|
108
181
|
|
|
109
|
-
| Option
|
|
110
|
-
|
|
111
|
-
| `-f, --force`
|
|
182
|
+
| Option | Description |
|
|
183
|
+
| ------------------- | ---------------------------------------------- |
|
|
184
|
+
| `-f, --force` | Overwrite existing config file |
|
|
185
|
+
| `--format <format>` | Config file format: `json` (default) or `yaml` |
|
|
112
186
|
|
|
113
187
|
---
|
|
114
188
|
|
|
@@ -136,14 +210,14 @@ gogo exec "npm install" --exclude-only docs
|
|
|
136
210
|
gogo exec "npm test" --include-pattern "^libs/"
|
|
137
211
|
```
|
|
138
212
|
|
|
139
|
-
| Option
|
|
140
|
-
|
|
141
|
-
| `--include-only <dirs>`
|
|
142
|
-
| `--exclude-only <dirs>`
|
|
213
|
+
| Option | Description |
|
|
214
|
+
| --------------------------- | ------------------------------------ |
|
|
215
|
+
| `--include-only <dirs>` | Only run in specified directories |
|
|
216
|
+
| `--exclude-only <dirs>` | Skip specified directories |
|
|
143
217
|
| `--include-pattern <regex>` | Include directories matching pattern |
|
|
144
218
|
| `--exclude-pattern <regex>` | Exclude directories matching pattern |
|
|
145
|
-
| `--parallel`
|
|
146
|
-
| `--concurrency <n>`
|
|
219
|
+
| `--parallel` | Run commands concurrently |
|
|
220
|
+
| `--concurrency <n>` | Max parallel processes |
|
|
147
221
|
|
|
148
222
|
---
|
|
149
223
|
|
|
@@ -171,15 +245,15 @@ gogo run deploy --include-only api
|
|
|
171
245
|
# CLI flags override these config defaults
|
|
172
246
|
```
|
|
173
247
|
|
|
174
|
-
| Option
|
|
175
|
-
|
|
176
|
-
| `-l, --list`
|
|
177
|
-
| `--include-only <dirs>`
|
|
178
|
-
| `--exclude-only <dirs>`
|
|
248
|
+
| Option | Description |
|
|
249
|
+
| --------------------------- | ------------------------------------------------------- |
|
|
250
|
+
| `-l, --list` | List all available commands |
|
|
251
|
+
| `--include-only <dirs>` | Only run in specified directories (overrides config) |
|
|
252
|
+
| `--exclude-only <dirs>` | Skip specified directories (overrides config) |
|
|
179
253
|
| `--include-pattern <regex>` | Include directories matching pattern (overrides config) |
|
|
180
254
|
| `--exclude-pattern <regex>` | Exclude directories matching pattern (overrides config) |
|
|
181
|
-
| `--parallel`
|
|
182
|
-
| `--concurrency <n>`
|
|
255
|
+
| `--parallel` | Run commands concurrently (overrides config) |
|
|
256
|
+
| `--concurrency <n>` | Max parallel processes (overrides config) |
|
|
183
257
|
|
|
184
258
|
---
|
|
185
259
|
|
|
@@ -195,8 +269,8 @@ gogo git clone git@github.com:org/meta-repo.git
|
|
|
195
269
|
gogo git clone git@github.com:org/meta-repo.git -d my-project
|
|
196
270
|
```
|
|
197
271
|
|
|
198
|
-
| Option
|
|
199
|
-
|
|
272
|
+
| Option | Description |
|
|
273
|
+
| ----------------------- | --------------------- |
|
|
200
274
|
| `-d, --directory <dir>` | Target directory name |
|
|
201
275
|
|
|
202
276
|
---
|
|
@@ -211,12 +285,12 @@ gogo git update --parallel
|
|
|
211
285
|
gogo git update --include-only api,web
|
|
212
286
|
```
|
|
213
287
|
|
|
214
|
-
| Option
|
|
215
|
-
|
|
288
|
+
| Option | Description |
|
|
289
|
+
| ----------------------- | ------------------------------ |
|
|
216
290
|
| `--include-only <dirs>` | Only update specified projects |
|
|
217
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
218
|
-
| `--parallel`
|
|
219
|
-
| `--concurrency <n>`
|
|
291
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
292
|
+
| `--parallel` | Clone in parallel |
|
|
293
|
+
| `--concurrency <n>` | Max parallel clones |
|
|
220
294
|
|
|
221
295
|
---
|
|
222
296
|
|
|
@@ -230,11 +304,11 @@ gogo git status --parallel
|
|
|
230
304
|
gogo git status --include-only api
|
|
231
305
|
```
|
|
232
306
|
|
|
233
|
-
| Option
|
|
234
|
-
|
|
307
|
+
| Option | Description |
|
|
308
|
+
| ----------------------- | ----------------------------- |
|
|
235
309
|
| `--include-only <dirs>` | Only check specified projects |
|
|
236
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
237
|
-
| `--parallel`
|
|
310
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
311
|
+
| `--parallel` | Run in parallel |
|
|
238
312
|
|
|
239
313
|
---
|
|
240
314
|
|
|
@@ -247,12 +321,12 @@ gogo git pull
|
|
|
247
321
|
gogo git pull --parallel
|
|
248
322
|
```
|
|
249
323
|
|
|
250
|
-
| Option
|
|
251
|
-
|
|
324
|
+
| Option | Description |
|
|
325
|
+
| ----------------------- | ---------------------------- |
|
|
252
326
|
| `--include-only <dirs>` | Only pull specified projects |
|
|
253
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
254
|
-
| `--parallel`
|
|
255
|
-
| `--concurrency <n>`
|
|
327
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
328
|
+
| `--parallel` | Pull in parallel |
|
|
329
|
+
| `--concurrency <n>` | Max parallel pulls |
|
|
256
330
|
|
|
257
331
|
---
|
|
258
332
|
|
|
@@ -265,11 +339,11 @@ gogo git push
|
|
|
265
339
|
gogo git push --include-only api,web
|
|
266
340
|
```
|
|
267
341
|
|
|
268
|
-
| Option
|
|
269
|
-
|
|
342
|
+
| Option | Description |
|
|
343
|
+
| ----------------------- | ---------------------------- |
|
|
270
344
|
| `--include-only <dirs>` | Only push specified projects |
|
|
271
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
272
|
-
| `--parallel`
|
|
345
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
346
|
+
| `--parallel` | Push in parallel |
|
|
273
347
|
|
|
274
348
|
---
|
|
275
349
|
|
|
@@ -291,13 +365,13 @@ gogo git branch feature/new-feature
|
|
|
291
365
|
gogo git branch feature/old-feature --delete
|
|
292
366
|
```
|
|
293
367
|
|
|
294
|
-
| Option
|
|
295
|
-
|
|
296
|
-
| `-d, --delete`
|
|
297
|
-
| `-a, --all`
|
|
298
|
-
| `--include-only <dirs>` | Only target specified projects
|
|
299
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
300
|
-
| `--parallel`
|
|
368
|
+
| Option | Description |
|
|
369
|
+
| ----------------------- | ------------------------------------ |
|
|
370
|
+
| `-d, --delete` | Delete the specified branch |
|
|
371
|
+
| `-a, --all` | List all branches (local and remote) |
|
|
372
|
+
| `--include-only <dirs>` | Only target specified projects |
|
|
373
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
374
|
+
| `--parallel` | Run in parallel |
|
|
301
375
|
|
|
302
376
|
---
|
|
303
377
|
|
|
@@ -313,12 +387,12 @@ gogo git checkout main
|
|
|
313
387
|
gogo git checkout -b feature/new-feature
|
|
314
388
|
```
|
|
315
389
|
|
|
316
|
-
| Option
|
|
317
|
-
|
|
318
|
-
| `-b, --create`
|
|
319
|
-
| `--include-only <dirs>` | Only target specified projects
|
|
320
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
321
|
-
| `--parallel`
|
|
390
|
+
| Option | Description |
|
|
391
|
+
| ----------------------- | ------------------------------------- |
|
|
392
|
+
| `-b, --create` | Create the branch if it doesn't exist |
|
|
393
|
+
| `--include-only <dirs>` | Only target specified projects |
|
|
394
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
395
|
+
| `--parallel` | Run in parallel |
|
|
322
396
|
|
|
323
397
|
---
|
|
324
398
|
|
|
@@ -331,11 +405,11 @@ gogo git commit -m "Update dependencies"
|
|
|
331
405
|
gogo git commit -m "Fix bug" --include-only api
|
|
332
406
|
```
|
|
333
407
|
|
|
334
|
-
| Option
|
|
335
|
-
|
|
336
|
-
| `-m, --message <msg>`
|
|
408
|
+
| Option | Description |
|
|
409
|
+
| ----------------------- | --------------------------------- |
|
|
410
|
+
| `-m, --message <msg>` | Commit message (required) |
|
|
337
411
|
| `--include-only <dirs>` | Only commit in specified projects |
|
|
338
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
412
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
339
413
|
|
|
340
414
|
---
|
|
341
415
|
|
|
@@ -348,6 +422,7 @@ gogo project create libs/new-lib git@github.com:org/new-lib.git
|
|
|
348
422
|
```
|
|
349
423
|
|
|
350
424
|
This will:
|
|
425
|
+
|
|
351
426
|
1. Create the directory
|
|
352
427
|
2. Initialize git
|
|
353
428
|
3. Add the remote origin
|
|
@@ -371,11 +446,12 @@ gogo project import existing-folder
|
|
|
371
446
|
gogo project import api git@github.com:org/api.git --no-clone
|
|
372
447
|
```
|
|
373
448
|
|
|
374
|
-
| Option
|
|
375
|
-
|
|
449
|
+
| Option | Description |
|
|
450
|
+
| ------------ | ------------------------------------------- |
|
|
376
451
|
| `--no-clone` | Register project in `.gogo` without cloning |
|
|
377
452
|
|
|
378
453
|
This will:
|
|
454
|
+
|
|
379
455
|
1. Clone the repository (if URL provided and directory doesn't exist, unless `--no-clone`)
|
|
380
456
|
2. Add the project to `.gogo`
|
|
381
457
|
3. Add the path to `.gitignore` (unless `--no-clone`)
|
|
@@ -392,12 +468,12 @@ gogo npm i # Alias
|
|
|
392
468
|
gogo npm install --parallel
|
|
393
469
|
```
|
|
394
470
|
|
|
395
|
-
| Option
|
|
396
|
-
|
|
471
|
+
| Option | Description |
|
|
472
|
+
| ----------------------- | ---------------------------------- |
|
|
397
473
|
| `--include-only <dirs>` | Only install in specified projects |
|
|
398
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
399
|
-
| `--parallel`
|
|
400
|
-
| `--concurrency <n>`
|
|
474
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
475
|
+
| `--parallel` | Run in parallel |
|
|
476
|
+
| `--concurrency <n>` | Max parallel installs |
|
|
401
477
|
|
|
402
478
|
---
|
|
403
479
|
|
|
@@ -410,12 +486,12 @@ gogo npm ci
|
|
|
410
486
|
gogo npm ci --parallel
|
|
411
487
|
```
|
|
412
488
|
|
|
413
|
-
| Option
|
|
414
|
-
|
|
489
|
+
| Option | Description |
|
|
490
|
+
| ----------------------- | ------------------------------ |
|
|
415
491
|
| `--include-only <dirs>` | Only run in specified projects |
|
|
416
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
417
|
-
| `--parallel`
|
|
418
|
-
| `--concurrency <n>`
|
|
492
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
493
|
+
| `--parallel` | Run in parallel |
|
|
494
|
+
| `--concurrency <n>` | Max parallel processes |
|
|
419
495
|
|
|
420
496
|
---
|
|
421
497
|
|
|
@@ -431,11 +507,11 @@ gogo npm link
|
|
|
431
507
|
gogo npm link --all
|
|
432
508
|
```
|
|
433
509
|
|
|
434
|
-
| Option
|
|
435
|
-
|
|
436
|
-
| `--all`
|
|
437
|
-
| `--include-only <dirs>` | Only link specified projects
|
|
438
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
510
|
+
| Option | Description |
|
|
511
|
+
| ----------------------- | -------------------------------------------------------- |
|
|
512
|
+
| `--all` | Link all projects bidirectionally (symlink dependencies) |
|
|
513
|
+
| `--include-only <dirs>` | Only link specified projects |
|
|
514
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
439
515
|
|
|
440
516
|
---
|
|
441
517
|
|
|
@@ -454,13 +530,13 @@ gogo npm run test --parallel
|
|
|
454
530
|
gogo npm run lint --if-present
|
|
455
531
|
```
|
|
456
532
|
|
|
457
|
-
| Option
|
|
458
|
-
|
|
459
|
-
| `--if-present`
|
|
460
|
-
| `--include-only <dirs>` | Only run in specified projects
|
|
461
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
462
|
-
| `--parallel`
|
|
463
|
-
| `--concurrency <n>`
|
|
533
|
+
| Option | Description |
|
|
534
|
+
| ----------------------- | --------------------------------------------- |
|
|
535
|
+
| `--if-present` | Only run if the script exists in package.json |
|
|
536
|
+
| `--include-only <dirs>` | Only run in specified projects |
|
|
537
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
538
|
+
| `--parallel` | Run in parallel |
|
|
539
|
+
| `--concurrency <n>` | Max parallel processes |
|
|
464
540
|
|
|
465
541
|
---
|
|
466
542
|
|
|
@@ -514,8 +590,9 @@ gogo git status --include-pattern "^libs/"
|
|
|
514
590
|
|
|
515
591
|
## Requirements
|
|
516
592
|
|
|
517
|
-
-
|
|
518
|
-
-
|
|
593
|
+
- **npm install**: Node.js 24 or higher, Git
|
|
594
|
+
- **Docker**: Docker
|
|
595
|
+
- **From source**: Bun 1.x or higher, Git
|
|
519
596
|
|
|
520
597
|
## License
|
|
521
598
|
|