forgemap 0.7.0-dev.115-dc2b700 → 0.7.0-dev.117-ac8b2c6
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 +15 -10
- package/dist/bin/forgemap.mjs +504 -170
- 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
|
|
@@ -137,7 +137,7 @@ forgemap import ~/projects --no-write-config # only report, don't touch the conf
|
|
|
137
137
|
forgemap import ~/projects --format json
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
For each repo `import` compares the folder's `<
|
|
140
|
+
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
141
|
|
|
142
142
|
### Reclaim disk — `cleanup`
|
|
143
143
|
|
|
@@ -169,7 +169,7 @@ forgemap validate # pretty checklist with ✓ / ! / ✗ per c
|
|
|
169
169
|
forgemap validate --json | jq # machine-readable for pre-commit hooks
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
Validates the schema, required CLI tools (`git` always, `gh` when a `type: 'github'` forge is configured
|
|
172
|
+
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
173
|
|
|
174
174
|
### Shell integration & completion
|
|
175
175
|
|
|
@@ -209,9 +209,14 @@ export default defineForgeMapConfig({
|
|
|
209
209
|
dir: 'comGithub'
|
|
210
210
|
},
|
|
211
211
|
work: {
|
|
212
|
-
type: '
|
|
212
|
+
type: 'gitlab', // uses `glab repo clone`, subgroups included
|
|
213
213
|
host: 'gitlab.acme.com',
|
|
214
|
-
dir: 'comGitlabAcme'
|
|
214
|
+
dir: 'comGitlabAcme'
|
|
215
|
+
},
|
|
216
|
+
other: {
|
|
217
|
+
type: 'git', // plain `git clone` — no forge CLI needed
|
|
218
|
+
host: 'git.example.com',
|
|
219
|
+
dir: 'comGitExample',
|
|
215
220
|
protocol: 'ssh' // optional, ssh is the default
|
|
216
221
|
}
|
|
217
222
|
}
|
|
@@ -230,7 +235,7 @@ The config is discovered by walking **up** from your current directory (so `forg
|
|
|
230
235
|
| :------------------- | :-------------------------------------------------------------------------------------------------------- |
|
|
231
236
|
| `root` | Base directory for all clones. Relative paths resolve against the config file's directory. |
|
|
232
237
|
| `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`). `
|
|
238
|
+
| `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
239
|
| `forges.<name>.host` | Hostname used to map full URLs and (for `git`) build the clone URL. |
|
|
235
240
|
| `forges.<name>.dir` | Subdirectory under `root` where this forge's clones live. |
|
|
236
241
|
| `forges.<name>.protocol` | `git`-type only. `'ssh'` (default) or `'https'`. Override per call with `--ssh` / `--https`. |
|