forgemap 0.7.0 → 0.8.0-dev.133-c1be991
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 +16 -10
- package/dist/bin/forgemap.mjs +669 -276
- package/dist/bin/forgemap.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -21,14 +21,14 @@ $ forgemap clone kirchDev/laravel-pbac
|
|
|
21
21
|
✔ Cloned kirchDev/laravel-pbac → ~/projects/comGithub/kirchDev/laravel-pbac
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
That's it. Every repo lands at a predictable `<root>/<forge.dir>/<
|
|
24
|
+
That's it. Every repo lands at a predictable `<root>/<forge.dir>/<namespace…>/<repo>` path — one namespace level on GitHub, as many as you like on GitLab — and `forgemap cd <slug>` jumps into any of them from anywhere: exact slug, fuzzy match, or interactive picker.
|
|
25
25
|
|
|
26
26
|
## ✨ Features
|
|
27
27
|
|
|
28
|
-
- **🗂️ Predictable layout** — every clone goes to `<root>/<forge.dir>/<
|
|
29
|
-
- **🚪 Flexible slug syntax** — `owner/repo`, `forge:
|
|
28
|
+
- **🗂️ Predictable layout** — every clone goes to `<root>/<forge.dir>/<namespace…>/<repo>`, configured once. GitLab subgroups nest as deeply as they do upstream.
|
|
29
|
+
- **🚪 Flexible slug syntax** — `owner/repo`, `forge:group/sub/repo`, full HTTPS URLs (a pasted `…/repo/-/merge_requests/1` still resolves to the repo), or SSH (`git@…:…`).
|
|
30
30
|
- **🔍 List & fuzzy search** — `forgemap list` shows every local repo, `forgemap list <term>` filters by owner or repo name (powered by [Fuse.js](https://www.fusejs.io/)); `cd`, `path` and `open` take the same fuzzy terms.
|
|
31
|
-
- **🤖 Forge-aware** — `type: 'github'` shells out to `gh
|
|
31
|
+
- **🤖 Forge-aware** — `type: 'github'` shells out to `gh`, `type: 'gitlab'` to `glab` (subgroups included); `type: 'git'` uses plain `git clone` with no extra dependencies.
|
|
32
32
|
- **🔁 Mass sync + status** — `forgemap sync` fetches every clone in parallel, `forgemap status` shows branch / dirty / ahead / behind per repo — narrow either to given owners or forges with a repeatable `--filter`.
|
|
33
33
|
- **📥 Import existing trees** — `forgemap import <path>` adopts a folder already laid out as `<server>/<owner>/<repo>`, reconciles each repo against its git remote (spotting moved or deleted remotes), and derives a config.
|
|
34
34
|
- **🧹 Safe cleanup** — `forgemap cleanup` deletes long-idle clones, `forgemap delete <slug>` drops a single one — both only when it is clean, fully pushed, free of stashed work, and still on its remote, so nothing unbacked-up is ever lost.
|
|
@@ -39,7 +39,7 @@ That's it. Every repo lands at a predictable `<root>/<forge.dir>/<owner>/<repo>`
|
|
|
39
39
|
## 📦 Install & run
|
|
40
40
|
|
|
41
41
|
> [!IMPORTANT]
|
|
42
|
-
> Needs **Node 24+** and **`git`** on `PATH`. [`gh`](https://cli.github.com/) (GitHub CLI) is only required when a `type: 'github'` forge is configured — run `forgemap validate` for an exact rundown of what your config needs.
|
|
42
|
+
> Needs **Node 24+** and **`git`** on `PATH`. [`gh`](https://cli.github.com/) (GitHub CLI) is only required when a `type: 'github'` forge is configured, and [`glab`](https://gitlab.com/gitlab-org/cli) (GitLab CLI) when a `type: 'gitlab'` one is — run `forgemap validate` for an exact rundown of what your config needs.
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
45
|
npm install -g forgemap # or: pnpm add -g forgemap
|
|
@@ -88,6 +88,7 @@ Prints where a repo lives — or *would* live, if it isn't cloned yet, which mak
|
|
|
88
88
|
forgemap list # every repo as a pretty tree
|
|
89
89
|
forgemap list forgemap # pretty tree (one line per match)
|
|
90
90
|
forgemap list forgemap | fzf # pipe-friendly path output
|
|
91
|
+
forgemap ls # `ls` is an alias for `list`
|
|
91
92
|
forgemap pick # interactive picker (consola prompt)
|
|
92
93
|
forgemap pick kirch # picker pre-filtered by fuzzy query
|
|
93
94
|
```
|
|
@@ -137,7 +138,7 @@ forgemap import ~/projects --no-write-config # only report, don't touch the conf
|
|
|
137
138
|
forgemap import ~/projects --format json
|
|
138
139
|
```
|
|
139
140
|
|
|
140
|
-
For each repo `import` compares the folder's `<
|
|
141
|
+
For each repo `import` compares the folder's `<namespace…>/<repo>` against the git `origin`, checks whether the remote still exists or was moved/renamed (GitHub via a batched `gh` GraphQL query, other forges via `git ls-remote`), and derives `root` + one forge per server directory. Read-only by default — `--fix` is the only thing that touches the filesystem.
|
|
141
142
|
|
|
142
143
|
### Reclaim disk — `cleanup`
|
|
143
144
|
|
|
@@ -169,7 +170,7 @@ forgemap validate # pretty checklist with ✓ / ! / ✗ per c
|
|
|
169
170
|
forgemap validate --json | jq # machine-readable for pre-commit hooks
|
|
170
171
|
```
|
|
171
172
|
|
|
172
|
-
Validates the schema, required CLI tools (`git` always, `gh` when a `type: 'github'` forge is configured
|
|
173
|
+
Validates the schema, required CLI tools (`git` always, `gh` when a `type: 'github'` forge is configured, `glab` when a `type: 'gitlab'` one is), each CLI's auth status, that the configured root exists, and that no directory under a forge dir is sitting there without a git repo in it.
|
|
173
174
|
|
|
174
175
|
### Shell integration & completion
|
|
175
176
|
|
|
@@ -209,9 +210,14 @@ export default defineForgeMapConfig({
|
|
|
209
210
|
dir: 'comGithub'
|
|
210
211
|
},
|
|
211
212
|
work: {
|
|
212
|
-
type: '
|
|
213
|
+
type: 'gitlab', // uses `glab repo clone`, subgroups included
|
|
213
214
|
host: 'gitlab.acme.com',
|
|
214
|
-
dir: 'comGitlabAcme'
|
|
215
|
+
dir: 'comGitlabAcme'
|
|
216
|
+
},
|
|
217
|
+
other: {
|
|
218
|
+
type: 'git', // plain `git clone` — no forge CLI needed
|
|
219
|
+
host: 'git.example.com',
|
|
220
|
+
dir: 'comGitExample',
|
|
215
221
|
protocol: 'ssh' // optional, ssh is the default
|
|
216
222
|
}
|
|
217
223
|
}
|
|
@@ -230,7 +236,7 @@ The config is discovered by walking **up** from your current directory (so `forg
|
|
|
230
236
|
| :------------------- | :-------------------------------------------------------------------------------------------------------- |
|
|
231
237
|
| `root` | Base directory for all clones. Relative paths resolve against the config file's directory. |
|
|
232
238
|
| `defaultForge` | Forge alias used when a slug is just `owner/repo` (no host or forge prefix). |
|
|
233
|
-
| `forges.<name>.type` | `'github'` (shells out to `gh`) or `'git'` (plain `git clone`). `
|
|
239
|
+
| `forges.<name>.type` | `'github'` (shells out to `gh`), `'gitlab'` (shells out to `glab`, namespaces may nest) or `'git'` (plain `git clone`). `gitea` / `codeberg` reserved. |
|
|
234
240
|
| `forges.<name>.host` | Hostname used to map full URLs and (for `git`) build the clone URL. |
|
|
235
241
|
| `forges.<name>.dir` | Subdirectory under `root` where this forge's clones live. |
|
|
236
242
|
| `forges.<name>.protocol` | `git`-type only. `'ssh'` (default) or `'https'`. Override per call with `--ssh` / `--https`. |
|