@imfelixyeung/git-swarm 0.0.3 → 0.1.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 +137 -1
  2. package/dist/cli.js +5966 -194
  3. package/package.json +15 -3
package/README.md CHANGED
@@ -1,3 +1,139 @@
1
- # Git Swarm
1
+ # git-swarm
2
2
 
3
3
  Manage multiple Git repositories with ease.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ bun install --global @imfelixyeung/git-swarm
9
+ ```
10
+
11
+ Once installed, `git-swarm` is available as a Git subcommand:
12
+
13
+ ```bash
14
+ git swarm [global options] <command> [options]
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Navigate to a parent directory containing multiple Git repositories, then run any command. `git-swarm` automatically discovers all repos nested below the current directory.
20
+
21
+ ```bash
22
+ # List all discovered repos
23
+ git swarm list
24
+
25
+ # Check the status of every repo
26
+ git swarm status
27
+
28
+ # Pull from remotes across all repos
29
+ git swarm pull
30
+
31
+ # Checkout a branch everywhere
32
+ git swarm checkout feature/my-branch
33
+ ```
34
+
35
+ ## Commands
36
+
37
+ <!-- prettier-ignore -->
38
+ | Command | Description |
39
+ |---|---|
40
+ | `list` | List all discovered Git repositories |
41
+ | `status` | Show working tree status for all repos |
42
+ | `pull [remote] [branch]` | Pull from remotes across all repos |
43
+ | `fetch [--prune]` | Fetch from remotes across all repos |
44
+ | `checkout <branch>` | Switch to a branch across all repos |
45
+ | `diff [--cached] [--stat]` | Show file changes across all repos |
46
+ | `grep <pattern>` | Run `git grep` across all repos |
47
+ | `find-branch <branch>` | Search all repos for a branch by name |
48
+ | `remote` | List remotes for each repo |
49
+ | `exec <command...>` | Run an arbitrary shell command in every repo |
50
+
51
+ ## Global Options
52
+
53
+ <!-- prettier-ignore -->
54
+ | Option | Description |
55
+ |---|---|
56
+ | `--where <query>` | Filter repos using a URL query-string syntax |
57
+ | `--parallel <count>` | Run operations in parallel (default: 1) |
58
+
59
+ ### Filtering with `--where`
60
+
61
+ Use `--where` to selectively target repos based on branch, clean/dirty state, or remote attributes:
62
+
63
+ ```bash
64
+ # Only repos on the main branch
65
+ git swarm --where "branch=main" status
66
+
67
+ # Only dirty repos with a GitHub remote
68
+ git swarm --where "clean=false&remote.provider=github" status
69
+
70
+ # Only repos owned by a specific user
71
+ git swarm --where "remote.owner=imfelixyeung" pull
72
+ ```
73
+
74
+ Available filter keys:
75
+
76
+ <!-- prettier-ignore -->
77
+ | Key | Description |
78
+ |---|---|
79
+ | `branch` | Current branch name |
80
+ | `clean` | Whether the working tree is clean (`true`/`false`) |
81
+ | `remote.provider` | Remote provider (`github`, `gitlab`, `bitbucket`) |
82
+ | `remote.owner` | Repository owner |
83
+ | `remote.name` | Repository name |
84
+ | `remote.host` | Remote host |
85
+ | `remote.ref` | Full remote URL |
86
+
87
+ ### Parallel Execution
88
+
89
+ ```bash
90
+ # Run fetch across 4 repos at a time
91
+ git swarm --parallel 4 fetch
92
+
93
+ # Run arbitrary commands in parallel
94
+ git swarm --parallel 8 exec "git reset --hard origin/main"
95
+ ```
96
+
97
+ ## Examples
98
+
99
+ ```bash
100
+ # Find which repos have a specific branch
101
+ git swarm find-branch release/v2
102
+
103
+ # Search for a pattern across all repos
104
+ git swarm grep "TODO"
105
+
106
+ # Run a command in every repo
107
+ git swarm exec "git clean -fd"
108
+
109
+ # Fetch and prune stale remote-tracking branches
110
+ git swarm fetch --prune
111
+
112
+ # Only pull repos that are behind their upstream
113
+ git swarm --where "branch=main&clean=true" pull
114
+ ```
115
+
116
+ ## Development
117
+
118
+ ```bash
119
+ # Install dependencies
120
+ bun install
121
+
122
+ # Build
123
+ bun run build
124
+
125
+ # Develop (build with watch mode)
126
+ bun run dev
127
+
128
+ # Typecheck
129
+ bun run typecheck
130
+
131
+ # Lint and format
132
+ bun run biome
133
+
134
+ # CI checks
135
+ bun run ci
136
+
137
+ # Test
138
+ bun test
139
+ ```