forgemap 0.4.0-dev.42-19c7093 โ 0.4.0-dev.46-3e37b68
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 +42 -41
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
[](https://www.npmjs.com/package/forgemap)
|
|
12
12
|
[](LICENSE)
|
|
13
13
|
|
|
14
|
+

|
|
15
|
+
|
|
14
16
|
</div>
|
|
15
17
|
|
|
16
18
|
---
|
|
@@ -35,53 +37,41 @@ That's it. Every repo lands at a predictable `<root>/<forge.dir>/<owner>/<repo>`
|
|
|
35
37
|
- **๐งฐ Typed config** โ `forgemap.config.ts` with `defineForgeMapConfig()`, parent walk-up discovery, and a global fallback.
|
|
36
38
|
- **๐ Shell-friendly** โ `forgemap shell-init --install` wires up real `forgemap cd <slug>` **and** tab-completion in one step.
|
|
37
39
|
|
|
38
|
-
## ๐ฆ
|
|
40
|
+
## ๐ฆ Install & run
|
|
41
|
+
|
|
42
|
+
> [!IMPORTANT]
|
|
43
|
+
> 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.
|
|
39
44
|
|
|
40
45
|
```bash
|
|
41
|
-
npm install -g forgemap
|
|
42
|
-
# or
|
|
43
|
-
pnpm add -g forgemap
|
|
44
|
-
```
|
|
46
|
+
npm install -g forgemap # or: pnpm add -g forgemap
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
cd ~/projects # the directory that should hold all your repos
|
|
49
|
+
forgemap config init # write a starter forgemap.config.ts
|
|
50
|
+
forgemap shell-init --install # cd wrapper + completion โ your rc file (idempotent)
|
|
51
|
+
source ~/.zshrc # re-source once, then it's automatic
|
|
47
52
|
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
forgemap clone kirchDev/laravel-pbac # any slug form works: owner/repo, forge:owner/repo, URL, SSH
|
|
54
|
+
forgemap cd laravel # fuzzy match โ jump in; bare `forgemap cd` opens a picker
|
|
55
|
+
```
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
`forgemap cd` resolves the slug, walks/picks across your cloned repos, and actually changes directory because the shell wrapper from `shell-init` intercepts it before the binary runs. Every other subcommand falls through to the real binary unchanged. Hacking on forgemap itself? See [CONTRIBUTING.md โ Trying the CLI locally](CONTRIBUTING.md#trying-the-cli-locally) โ covers `pnpm setup`, `pnpm link --global .` and the shell-wrapper source.
|
|
53
58
|
|
|
54
|
-
|
|
59
|
+
<details>
|
|
60
|
+
<summary><strong>All commands</strong> โ clone, cd, search, open, sync/status, import, cleanup, validate, shell-init, config</summary>
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
### Clone & jump
|
|
57
63
|
|
|
58
64
|
```bash
|
|
59
|
-
|
|
60
|
-
cd ~/projects
|
|
61
|
-
forgemap config init
|
|
62
|
-
|
|
63
|
-
# 2. Wire up the shell integration once โ real `forgemap cd` + tab-completion.
|
|
64
|
-
forgemap shell-init --install # appends loaders to ~/.zshrc (or bashrc/fish)
|
|
65
|
-
source ~/.zshrc # re-source once, then it's automatic
|
|
66
|
-
# Prefer manual? eval "$(forgemap shell-init)" ยท fish: forgemap shell-init fish | source
|
|
67
|
-
|
|
68
|
-
# 3. Clone โ any slug form works.
|
|
69
|
-
forgemap clone kirchDev/laravel-pbac
|
|
65
|
+
forgemap clone kirchDev/laravel-pbac # default forge
|
|
70
66
|
forgemap clone github:TitusKirch/forgemap
|
|
71
67
|
forgemap clone https://github.com/foo/bar
|
|
72
68
|
|
|
73
|
-
# 4. Jump into a repo from anywhere.
|
|
74
69
|
forgemap cd kirchDev/laravel-pbac # exact slug โ direct cd
|
|
75
70
|
forgemap cd laravel # fuzzy single match โ direct cd
|
|
76
71
|
forgemap cd kirch # multiple matches โ interactive picker
|
|
77
72
|
forgemap cd # no arg โ picker over every clone
|
|
78
73
|
```
|
|
79
74
|
|
|
80
|
-
`forgemap cd` resolves the slug, walks/picks across your cloned repos,
|
|
81
|
-
and actually changes directory because the shell wrapper from
|
|
82
|
-
`shell-init` intercepts it before the binary runs. Every other
|
|
83
|
-
subcommand falls through to the real binary unchanged.
|
|
84
|
-
|
|
85
75
|
### Search and pick on demand
|
|
86
76
|
|
|
87
77
|
```bash
|
|
@@ -154,6 +144,7 @@ Validates the schema, required CLI tools (`git` always, `gh` when a `type: 'gith
|
|
|
154
144
|
forgemap shell-init --install # cd wrapper + completion โ your rc file (idempotent)
|
|
155
145
|
forgemap completion --install # completion only, if you don't want the cd wrapper
|
|
156
146
|
forgemap shell-init # print the wrapper (manual: eval "$(โฆ)")
|
|
147
|
+
forgemap shell-init fish | source # fish: source the wrapper directly
|
|
157
148
|
forgemap completion bash # print the completion script for bash/zsh/fish
|
|
158
149
|
```
|
|
159
150
|
|
|
@@ -166,6 +157,8 @@ forgemap config init # write a starter forgemap.config.ts
|
|
|
166
157
|
forgemap config show # print the resolved config + which file it came from
|
|
167
158
|
```
|
|
168
159
|
|
|
160
|
+
</details>
|
|
161
|
+
|
|
169
162
|
## โ๏ธ Configuration
|
|
170
163
|
|
|
171
164
|
`forgemap config init` writes a `forgemap.config.ts` like this:
|
|
@@ -192,6 +185,14 @@ export default defineForgeMapConfig({
|
|
|
192
185
|
});
|
|
193
186
|
```
|
|
194
187
|
|
|
188
|
+
The config is discovered by walking **up** from your current directory (so `forgemap cd` works from inside any clone), then falling back to `~/.config/forgemap/`. Override with `--config <path>` or the `FORGEMAP_CONFIG` env var.
|
|
189
|
+
|
|
190
|
+
> [!TIP]
|
|
191
|
+
> Already have a directory full of repos? Skip writing this by hand โ `forgemap import <path>` derives `root` + `forges` from the existing layout.
|
|
192
|
+
|
|
193
|
+
<details>
|
|
194
|
+
<summary><strong>All configuration options</strong></summary>
|
|
195
|
+
|
|
195
196
|
| Key | What it controls |
|
|
196
197
|
| :------------------- | :-------------------------------------------------------------------------------------------------------- |
|
|
197
198
|
| `root` | Base directory for all clones. Relative paths resolve against the config file's directory. |
|
|
@@ -203,10 +204,10 @@ export default defineForgeMapConfig({
|
|
|
203
204
|
|
|
204
205
|
The config file is discovered by walking **up** from your current directory (so `forgemap cd` works from inside any clone, not just the root), then falling back to a global `$XDG_CONFIG_HOME/forgemap/forgemap.config.*` (i.e. `~/.config/forgemap/`) so commands work from anywhere. Override with `--config <path>` or the `FORGEMAP_CONFIG` env var.
|
|
205
206
|
|
|
206
|
-
>
|
|
207
|
-
> Already have a directory full of repos? Skip writing this by hand โ `forgemap import <path>` derives `root` + `forges` from the existing layout.
|
|
207
|
+
</details>
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
<details>
|
|
210
|
+
<summary><strong>Repo layout & slug syntax</strong></summary>
|
|
210
211
|
|
|
211
212
|
```
|
|
212
213
|
<root>/
|
|
@@ -227,8 +228,6 @@ Example with the default config rooted at `~/projects`:
|
|
|
227
228
|
โโโ forgemap/
|
|
228
229
|
```
|
|
229
230
|
|
|
230
|
-
## ๐ช Slug syntax
|
|
231
|
-
|
|
232
231
|
| Form | Resolves to |
|
|
233
232
|
| :---------------------------------- | :----------------------------------------------------- |
|
|
234
233
|
| `kirchDev/laravel-pbac` | Default forge, `kirchDev/laravel-pbac`. |
|
|
@@ -237,7 +236,14 @@ Example with the default config rooted at `~/projects`:
|
|
|
237
236
|
| `https://github.com/foo/bar.git` | Same, `.git` suffix stripped. |
|
|
238
237
|
| `git@github.com:foo/bar.git` | SSH form, host matched against `forges[].host`. |
|
|
239
238
|
|
|
240
|
-
|
|
239
|
+
</details>
|
|
240
|
+
|
|
241
|
+
## ๐ค Contributing
|
|
242
|
+
|
|
243
|
+
PRs welcome. Conventional Commits required (enforced via commitlint); Husky runs lint-staged on every commit. Run `pnpm check:fix` before pushing โ CI will catch what husky missed.
|
|
244
|
+
|
|
245
|
+
<details>
|
|
246
|
+
<summary><strong>Dev scripts</strong></summary>
|
|
241
247
|
|
|
242
248
|
```bash
|
|
243
249
|
pnpm install
|
|
@@ -249,12 +255,7 @@ pnpm bench # microbench scanRepos / cache hit / cache rebuild
|
|
|
249
255
|
|
|
250
256
|
Tune the bench layout via env vars (`FORGEMAP_BENCH_FORGES`, `FORGEMAP_BENCH_OWNERS`, `FORGEMAP_BENCH_REPOS`, `FORGEMAP_BENCH_RUNS`).
|
|
251
257
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
PRs welcome. Conventional Commits required (enforced via commitlint). Husky runs lint-staged on every commit.
|
|
255
|
-
|
|
256
|
-
> [!TIP]
|
|
257
|
-
> Run `pnpm check:fix` before pushing โ CI will catch what husky missed.
|
|
258
|
+
</details>
|
|
258
259
|
|
|
259
260
|
## ๐ฃ๏ธ Versioning
|
|
260
261
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "forgemap",
|
|
4
|
-
"version": "0.4.0-dev.
|
|
4
|
+
"version": "0.4.0-dev.46-3e37b68",
|
|
5
5
|
"description": "CLI that manages a local repo layout grouped by git server, organization and repository name.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|