repo-do 1.2.0 → 1.3.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 +405 -333
- package/dist/cli.js +16 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +66 -4
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +1 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/find.js +1 -1
- package/dist/commands/find.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +8 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/remove.js +1 -1
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/scan.d.ts +2 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +29 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/core/config-manager.d.ts.map +1 -1
- package/dist/core/config-manager.js +7 -1
- package/dist/core/config-manager.js.map +1 -1
- package/dist/core/git-url-parser.d.ts +1 -0
- package/dist/core/git-url-parser.d.ts.map +1 -1
- package/dist/core/git-url-parser.js +27 -25
- package/dist/core/git-url-parser.js.map +1 -1
- package/dist/core/repository-manager.d.ts +11 -2
- package/dist/core/repository-manager.d.ts.map +1 -1
- package/dist/core/repository-manager.js +230 -14
- package/dist/core/repository-manager.js.map +1 -1
- package/dist/core/repository-registry.d.ts +22 -0
- package/dist/core/repository-registry.d.ts.map +1 -0
- package/dist/core/repository-registry.js +104 -0
- package/dist/core/repository-registry.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +34 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/git-executor.d.ts +16 -2
- package/dist/utils/git-executor.d.ts.map +1 -1
- package/dist/utils/git-executor.js +35 -8
- package/dist/utils/git-executor.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,333 +1,405 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# repo-do
|
|
4
|
-
|
|
5
|
-
A unified CLI tool for managing git repositories with a structured directory layout.
|
|
6
|
-
Organize all your repositories in a consistent domain-based structure.
|
|
7
|
-
Fast search, clipboard integration, and cross-platform support.
|
|
8
|
-
|
|
9
|
-
English · [简体中文](./docs/README.zh-CN.md)
|
|
10
|
-
|
|
11
|
-
[](https://www.npmjs.com/package/repo-do)
|
|
12
|
-
[](https://github.com/STDSuperman/repo-do/blob/master/LICENSE)
|
|
13
|
-
[](https://nodejs.org)
|
|
14
|
-
[](https://www.npmjs.com/package/repo-do)
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
## Overview
|
|
19
|
-
|
|
20
|
-
`repo-do` helps you organize all your git repositories in a consistent, domain-based directory structure. It automatically clones repositories to organized paths and provides fast search capabilities to find and navigate to your projects.
|
|
21
|
-
|
|
22
|
-
## Features
|
|
23
|
-
|
|
24
|
-
- **Structured Organization**: Clone repositories to `{baseDir}/{domain}/{group}/{repo}` structure
|
|
25
|
-
- **Fast Repository Search**: Quickly find repositories by name or path fragments
|
|
26
|
-
- **Clipboard Integration**: Automatically copy `cd` commands to clipboard
|
|
27
|
-
- **Cache-Based Performance**: Fast repository listing without repeated directory scans
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
repo
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
repo-do
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
-
|
|
332
|
-
-
|
|
333
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# repo-do
|
|
4
|
+
|
|
5
|
+
A unified CLI tool for managing git repositories with a structured directory layout.
|
|
6
|
+
Organize all your repositories in a consistent domain-based structure.
|
|
7
|
+
Fast search, clipboard integration, and cross-platform support.
|
|
8
|
+
|
|
9
|
+
English · [简体中文](./docs/README.zh-CN.md)
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/repo-do)
|
|
12
|
+
[](https://github.com/STDSuperman/repo-do/blob/master/LICENSE)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[](https://www.npmjs.com/package/repo-do)
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
## Overview
|
|
19
|
+
|
|
20
|
+
`repo-do` helps you organize all your git repositories in a consistent, domain-based directory structure. It automatically clones repositories to organized paths and provides fast search capabilities to find and navigate to your projects.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Structured Organization**: Clone repositories to `{baseDir}/{domain}/{group}/{repo}` structure
|
|
25
|
+
- **Fast Repository Search**: Quickly find repositories by name or path fragments
|
|
26
|
+
- **Clipboard Integration**: Automatically copy `cd` commands to clipboard
|
|
27
|
+
- **Cache-Based Performance**: Fast repository listing without repeated directory scans
|
|
28
|
+
- **Existing Repository Detection**: Track existing clones by remote URL and reuse them before cloning duplicates
|
|
29
|
+
- **Multi-Location Tracking**: Keep multiple local directories for the same remote repository when needed
|
|
30
|
+
- **Cross-Platform**: Works on Windows, macOS, and Linux
|
|
31
|
+
- **Git Clone Pass-through**: Support all git clone arguments (--depth, --branch, etc.)
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g repo-do
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
> **Tip**: After installation, you can use the shorter command `rpd` instead of `repo-do` for faster typing!
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
42
|
+
|
|
43
|
+
### 1. Initialize Configuration
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
repo-do init
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This prompts you to set a base directory for storing repositories (default: `~/.repo-do/repo`).
|
|
50
|
+
|
|
51
|
+
### 2. Clone a Repository
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
repo-do add git@github.com:STDSuperman/super-image-cropper.git
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The repository will be cloned to:
|
|
58
|
+
```
|
|
59
|
+
{baseDir}/github.com/STDSuperman/super-image-cropper
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The `cd` command is automatically copied to your clipboard!
|
|
63
|
+
|
|
64
|
+
### 3. Find a Repository
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
repo-do find super-image
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Output:
|
|
71
|
+
```
|
|
72
|
+
Found 1 repository:
|
|
73
|
+
1. D:\Code\github.com\STDSuperman\super-image-cropper
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 4. List All Repositories
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
repo-do list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Output:
|
|
83
|
+
```
|
|
84
|
+
github.com/STDSuperman/super-image-cropper
|
|
85
|
+
github.com/STDSuperman/NanoBanana-PPT-Skills
|
|
86
|
+
gitlab.com/myorg/internal-tool
|
|
87
|
+
|
|
88
|
+
Total: 3 repositories
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Commands
|
|
92
|
+
|
|
93
|
+
### `repo-do init`
|
|
94
|
+
|
|
95
|
+
Initialize configuration and set the base directory for repositories.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
repo-do init
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `repo-do add <repo_url> [git-clone-args...]`
|
|
102
|
+
|
|
103
|
+
Clone a repository to the structured directory.
|
|
104
|
+
|
|
105
|
+
**Supported URL formats:**
|
|
106
|
+
- HTTPS: `https://github.com/user/repo.git` or `https://github.com/user/repo`
|
|
107
|
+
- SSH: `git@github.com:user/repo.git` or `ssh://git@github.com/user/repo.git`
|
|
108
|
+
|
|
109
|
+
**Examples:**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Basic clone
|
|
113
|
+
repo-do add git@github.com:STDSuperman/super-image-cropper.git
|
|
114
|
+
|
|
115
|
+
# Shallow clone
|
|
116
|
+
repo-do add https://github.com/STDSuperman/super-image-cropper.git --depth 1
|
|
117
|
+
|
|
118
|
+
# Clone specific branch
|
|
119
|
+
repo-do add https://github.com/STDSuperman/super-image-cropper.git --branch develop
|
|
120
|
+
|
|
121
|
+
# SSH clone
|
|
122
|
+
repo-do add git@github.com:STDSuperman/NanoBanana-PPT-Skills.git
|
|
123
|
+
|
|
124
|
+
# JSON output (for scripts and AI models)
|
|
125
|
+
repo-do add https://github.com/user/repo.git --json
|
|
126
|
+
|
|
127
|
+
# Force a new clone even if the same remote is already tracked
|
|
128
|
+
repo-do add https://github.com/user/repo.git --force-clone
|
|
129
|
+
|
|
130
|
+
# Use an already tracked local repository without prompting
|
|
131
|
+
repo-do add https://github.com/user/repo.git --use-existing
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Before cloning, `repo-do` checks the global repository configuration for the same remote repository. SSH and HTTPS remotes such as `git@github.com:user/repo.git` and `https://github.com/user/repo` are treated as the same repository. If a matching repository already exists in another local directory, interactive mode asks whether to use the existing directory. `--json` mode uses the existing directory automatically unless `--force-clone` is provided.
|
|
135
|
+
|
|
136
|
+
**`--json` output:**
|
|
137
|
+
|
|
138
|
+
When using `--json`, the command outputs a single line of JSON to stdout with no spinner, color, or clipboard side effects:
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{"success":true,"path":"/path/to/repo","alreadyExists":false,"message":""}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
| Field | Type | Description |
|
|
145
|
+
|-------|------|-------------|
|
|
146
|
+
| `success` | boolean | `true` if the repo path is available (cloned or already exists) |
|
|
147
|
+
| `path` | string | Absolute path to the local repository |
|
|
148
|
+
| `alreadyExists` | boolean | `true` if the repository was already cloned |
|
|
149
|
+
| `adoptedExisting` | boolean | `true` if an existing repository in a different location was used |
|
|
150
|
+
| `message` | string | Error or status message |
|
|
151
|
+
|
|
152
|
+
On failure, the process exits with code 1 and outputs:
|
|
153
|
+
```json
|
|
154
|
+
{"success":false,"path":"","alreadyExists":false,"message":"error details"}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Directory structure:**
|
|
158
|
+
```
|
|
159
|
+
{baseDir}/
|
|
160
|
+
├── github.com/
|
|
161
|
+
│ └── STDSuperman/
|
|
162
|
+
│ ├── super-image-cropper/
|
|
163
|
+
│ └── NanoBanana-PPT-Skills/
|
|
164
|
+
└── gitlab.com/
|
|
165
|
+
└── myorg/
|
|
166
|
+
└── internal-tool/
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### `repo-do find <query>`
|
|
170
|
+
|
|
171
|
+
Search for repositories by name, group, or path fragment (case-insensitive).
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
repo-do find super-image
|
|
175
|
+
repo-do find STDSuperman
|
|
176
|
+
repo-do find github.com
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Output format:**
|
|
180
|
+
```
|
|
181
|
+
Found 2 repositories:
|
|
182
|
+
1. D:\Code\github.com\STDSuperman\super-image-cropper
|
|
183
|
+
2. D:\Code\github.com\STDSuperman\NanoBanana-PPT-Skills
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Each result is prefixed with a number, followed by the absolute path.
|
|
187
|
+
|
|
188
|
+
### `repo-do list [--refresh]`
|
|
189
|
+
|
|
190
|
+
List all managed repositories.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# List from cache (fast)
|
|
194
|
+
repo-do list
|
|
195
|
+
|
|
196
|
+
# Force rebuild cache
|
|
197
|
+
repo-do list --refresh
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
When `--refresh` is used, `repo-do` scans the configured base directory, records detected Git repositories in configuration, and rebuilds the fast repository cache.
|
|
201
|
+
|
|
202
|
+
### `repo-do scan [paths...]`
|
|
203
|
+
|
|
204
|
+
Scan existing Git repositories and track them in configuration.
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Scan the configured base directory
|
|
208
|
+
repo-do scan
|
|
209
|
+
|
|
210
|
+
# Scan one or more custom directories
|
|
211
|
+
repo-do scan ~/Code ~/work
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Detected repositories are grouped by normalized remote URL. If the same remote exists in multiple local directories, all directories are stored as locations for that repository.
|
|
215
|
+
|
|
216
|
+
### `repo-do remove <repo>`
|
|
217
|
+
|
|
218
|
+
Remove a repository from tracking (does not delete files).
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
repo-do remove super-image
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
If multiple matches are found, you'll be prompted to select which one to remove.
|
|
225
|
+
|
|
226
|
+
### `repo-do config [options]`
|
|
227
|
+
|
|
228
|
+
View or modify configuration.
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Show current config
|
|
232
|
+
repo-do config
|
|
233
|
+
|
|
234
|
+
# Get base directory
|
|
235
|
+
repo-do config --get baseDirectory
|
|
236
|
+
|
|
237
|
+
# Set base directory
|
|
238
|
+
repo-do config --set baseDirectory /path/to/repos
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Directory Structure
|
|
242
|
+
|
|
243
|
+
All repositories are organized in a consistent structure:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
{baseDirectory}/{domain}/{group}/{repository}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Examples:**
|
|
250
|
+
|
|
251
|
+
| Git URL | Cloned Path |
|
|
252
|
+
|---------|-------------|
|
|
253
|
+
| `git@github.com:STDSuperman/super-image-cropper.git` | `{baseDir}/github.com/STDSuperman/super-image-cropper` |
|
|
254
|
+
| `git@gitlab.com:myorg/myrepo.git` | `{baseDir}/gitlab.com/myorg/myrepo` |
|
|
255
|
+
| `https://github.com/STDSuperman/NanoBanana-PPT-Skills.git` | `{baseDir}/github.com/STDSuperman/NanoBanana-PPT-Skills` |
|
|
256
|
+
|
|
257
|
+
## Configuration
|
|
258
|
+
|
|
259
|
+
Configuration is stored in `~/.repo-do/config.json`:
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"baseDirectory": "D:\\Code",
|
|
264
|
+
"version": "1.0.0",
|
|
265
|
+
"repositories": [
|
|
266
|
+
{
|
|
267
|
+
"id": "github.com/STDSuperman/super-image-cropper",
|
|
268
|
+
"canonicalRemote": "github.com/STDSuperman/super-image-cropper",
|
|
269
|
+
"displayUrl": "git@github.com:STDSuperman/super-image-cropper.git",
|
|
270
|
+
"domain": "github.com",
|
|
271
|
+
"group": "STDSuperman",
|
|
272
|
+
"name": "super-image-cropper",
|
|
273
|
+
"preferredPath": "D:\\Code\\github.com\\STDSuperman\\super-image-cropper",
|
|
274
|
+
"locations": [
|
|
275
|
+
{
|
|
276
|
+
"path": "D:\\Code\\github.com\\STDSuperman\\super-image-cropper",
|
|
277
|
+
"remoteUrl": "git@github.com:STDSuperman/super-image-cropper.git",
|
|
278
|
+
"remoteName": "origin",
|
|
279
|
+
"source": "clone",
|
|
280
|
+
"firstSeenAt": "2026-01-11T12:00:00.000Z",
|
|
281
|
+
"lastSeenAt": "2026-01-11T12:00:00.000Z"
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
]
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## Cache System
|
|
290
|
+
|
|
291
|
+
To improve performance, `repo-do` maintains a repository cache at `~/.repo-do/repo_cache.json`.
|
|
292
|
+
|
|
293
|
+
**Cache is automatically updated when:**
|
|
294
|
+
- Adding a new repository (`repo-do add`)
|
|
295
|
+
- Removing a repository (`repo-do remove`)
|
|
296
|
+
- Forcing refresh (`repo-do list --refresh`)
|
|
297
|
+
|
|
298
|
+
**Cache format:**
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"repositories": [
|
|
302
|
+
{
|
|
303
|
+
"name": "super-image-cropper",
|
|
304
|
+
"fullPath": "D:\\Code\\github.com\\STDSuperman\\super-image-cropper",
|
|
305
|
+
"gitUrl": "git@github.com:STDSuperman/super-image-cropper.git",
|
|
306
|
+
"domain": "github.com",
|
|
307
|
+
"group": "STDSuperman",
|
|
308
|
+
"lastUpdated": "2026-01-11T12:00:00.000Z"
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"lastUpdated": "2026-01-11T12:00:00.000Z"
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
## Cross-Platform Support
|
|
316
|
+
|
|
317
|
+
### Clipboard Support
|
|
318
|
+
|
|
319
|
+
- **macOS**: Uses `pbcopy`
|
|
320
|
+
- **Linux**: Uses `xclip` or `xsel` (may require installation)
|
|
321
|
+
- **Windows**: Uses `clip` command
|
|
322
|
+
|
|
323
|
+
If clipboard fails, the path is still displayed in the terminal.
|
|
324
|
+
|
|
325
|
+
### Path Handling
|
|
326
|
+
|
|
327
|
+
All paths are handled using Node.js `path` module for cross-platform compatibility.
|
|
328
|
+
|
|
329
|
+
## Requirements
|
|
330
|
+
|
|
331
|
+
- Node.js >= 18.0.0
|
|
332
|
+
- Git installed and available in PATH
|
|
333
|
+
|
|
334
|
+
## Error Handling
|
|
335
|
+
|
|
336
|
+
`repo-do` provides clear error messages for common issues:
|
|
337
|
+
|
|
338
|
+
- **INVALID_URL**: Git URL format not recognized
|
|
339
|
+
- **CLONE_FAILED**: Git clone operation failed
|
|
340
|
+
- **CONFIG_ERROR**: Configuration file read/write error
|
|
341
|
+
- **NOT_FOUND**: Repository not found in cache
|
|
342
|
+
- **PERMISSION_DENIED**: File system permission error
|
|
343
|
+
- **GIT_NOT_INSTALLED**: Git is not installed
|
|
344
|
+
- **PATH_CONFLICT**: Target path exists but is not the requested repository
|
|
345
|
+
|
|
346
|
+
## Development
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Clone the repository
|
|
350
|
+
git clone https://github.com/your-username/repo-do.git
|
|
351
|
+
cd repo-do
|
|
352
|
+
|
|
353
|
+
# Install dependencies
|
|
354
|
+
npm install
|
|
355
|
+
|
|
356
|
+
# Run in development mode
|
|
357
|
+
npm run dev
|
|
358
|
+
|
|
359
|
+
# Build
|
|
360
|
+
npm run build
|
|
361
|
+
|
|
362
|
+
# Run tests
|
|
363
|
+
npm test
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## Project Structure
|
|
367
|
+
|
|
368
|
+
```
|
|
369
|
+
repo-do/
|
|
370
|
+
├── src/
|
|
371
|
+
│ ├── commands/ # CLI command implementations
|
|
372
|
+
│ ├── core/ # Core business logic
|
|
373
|
+
│ ├── utils/ # Utility functions
|
|
374
|
+
│ ├── types/ # TypeScript type definitions
|
|
375
|
+
│ ├── constants/ # Constants
|
|
376
|
+
│ └── index.ts # CLI entry point
|
|
377
|
+
├── bin/
|
|
378
|
+
│ └── repo-do.js # Executable entry
|
|
379
|
+
├── dist/ # Compiled output
|
|
380
|
+
└── tests/ # Test files
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## Dependencies
|
|
384
|
+
|
|
385
|
+
- **chalk**: Terminal text styling
|
|
386
|
+
- **clipboardy**: Cross-platform clipboard operations
|
|
387
|
+
- **commander**: CLI framework
|
|
388
|
+
- **inquirer**: Interactive command line prompts
|
|
389
|
+
- **ora**: Elegant terminal spinner
|
|
390
|
+
|
|
391
|
+
## License
|
|
392
|
+
|
|
393
|
+
MIT
|
|
394
|
+
|
|
395
|
+
## Contributing
|
|
396
|
+
|
|
397
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
398
|
+
|
|
399
|
+
## Changelog
|
|
400
|
+
|
|
401
|
+
### 1.0.0
|
|
402
|
+
- Initial release
|
|
403
|
+
- Core functionality: init, add, list, find, remove, config
|
|
404
|
+
- Cross-platform support
|
|
405
|
+
- Cache system for fast repository listing
|