mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-10 03:27:59 +00:00
merge main
This commit is contained in:
parent
c0d8afbbe9
commit
ac5923716e
3 changed files with 39 additions and 9 deletions
37
README.md
37
README.md
|
|
@ -398,7 +398,6 @@ gitnexus analyze --workers <n> # Parse worker pool size (>=1; default: cores-1
|
|||
# auto-sized to the repo). 0 is rejected — there is no sequential mode.
|
||||
gitnexus analyze --wal-checkpoint-threshold 67108864 # LadybugDB WAL auto-checkpoint threshold in bytes
|
||||
# (default 67108864 = 64 MiB; -1 keeps Ladybug stock ~16 MiB)
|
||||
gitnexus watch [init|start|restart|stop|status] # Control auto-sync from GITNEXUS_HOME/watch_config.yml
|
||||
```
|
||||
|
||||
If `analyze` reports a worker parse timeout on a large or unusual repository, it keeps running and falls back safely. To give slow worker jobs more time, use `--worker-timeout 60` or set `GITNEXUS_WORKER_SUB_BATCH_TIMEOUT_MS=60000`. For very large files, `GITNEXUS_WORKER_SUB_BATCH_MAX_BYTES` controls the worker job byte budget.
|
||||
|
|
@ -415,6 +414,42 @@ If embeddings are skipped on a large repository, the indexed graph likely exceed
|
|||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Keep remote repositories indexed with <code>gitnexus watch</code></strong></summary>
|
||||
|
||||
`gitnexus watch` clones or pulls configured repositories, analyzes new commits, and optionally syncs their group. It runs once immediately, then repeats on the configured interval. It runs in the foreground; use your process manager if it must survive a shell session.
|
||||
|
||||
```bash
|
||||
# 1. Create the config once. It never overwrites an existing file.
|
||||
gitnexus watch init
|
||||
|
||||
# 2. Edit $GITNEXUS_HOME/watch_config.yml, then start it.
|
||||
gitnexus watch start # `gitnexus watch` is equivalent
|
||||
gitnexus watch status
|
||||
gitnexus watch restart # Required after config changes
|
||||
gitnexus watch stop
|
||||
```
|
||||
|
||||
`GITNEXUS_HOME` defaults to `~/.gitnexus`. A minimal configuration:
|
||||
|
||||
```yaml
|
||||
sync_interval_minutes: 10
|
||||
projects:
|
||||
- local_path: /absolute/path/to/clones
|
||||
branches: [main, master]
|
||||
remote_urls:
|
||||
- git@github.com:owner/repo.git
|
||||
```
|
||||
|
||||
- `sync_interval_minutes` must be at least `5`; `local_path` must be an absolute path.
|
||||
- Remote URLs must use SSH SCP form and are limited to GitHub, GitLab, or Gitee.
|
||||
- `branches` are tried in order. The legacy `branch` field is supported, but do not set both.
|
||||
- Add `group_name` only after creating that group with `gitnexus group create <name>`.
|
||||
|
||||
See the [full watch configuration and runtime reference](gitnexus/README.md#gitnexus-watch) for concurrency, timeouts, failure thresholds, and runtime files.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Repository groups</strong> (multi-repo / monorepo service tracking)</summary>
|
||||
|
||||
|
|
|
|||
|
|
@ -277,7 +277,7 @@ gitnexus group impact <name> --target <symbol> --repo <groupPath> # Cross-repo
|
|||
|
||||
### `gitnexus watch`
|
||||
|
||||
`gitnexus watch` is the explicit long-running auto-sync entrypoint. `gitnexus watch init` creates a default `GITNEXUS_HOME/watch_config.yml`. Bare `gitnexus watch` is the same as `gitnexus watch start`; `restart`, `stop`, and `status` manage the same `GITNEXUS_HOME` instance. It reads only `GITNEXUS_HOME/watch_config.yml`, runs once immediately, then repeats on `sync_interval_minutes`. Watch runtime artifacts live under `GITNEXUS_HOME/watch/`: `project_commit_info.txt` is the human-readable per-loop snapshot, `auto-sync-state.json` is the machine state used for commit skipping and analyze failure thresholds, `watch.pid`, `watch.lock`, and `watch.status.json` prevent multiple watch processes for one home, and `quarantine/` stores partial clone output.
|
||||
`gitnexus watch` is the explicit long-running auto-sync entrypoint. `GITNEXUS_HOME` defaults to `~/.gitnexus`; `gitnexus watch init` creates its default `$GITNEXUS_HOME/watch_config.yml`. Bare `gitnexus watch` is the same as `gitnexus watch start`; `restart`, `stop`, and `status` manage the same `GITNEXUS_HOME` instance. `start` runs in the foreground, reads the configuration once at startup, runs once immediately, then repeats on `sync_interval_minutes`; restart it after changing the configuration. Watch runtime artifacts live under `$GITNEXUS_HOME/watch/`: `project_commit_info.txt` is the human-readable per-loop snapshot, `auto-sync-state.json` is the machine state used for commit skipping and analyze failure thresholds, `watch.lock` prevents multiple watch processes for one home, `watch.pid` and `watch.status.json` expose process state, and `quarantine/` stores partial clone output.
|
||||
|
||||
```yaml
|
||||
sync_interval_minutes: 10
|
||||
|
|
@ -294,7 +294,7 @@ projects:
|
|||
- git@gitee.com:owner/repo.git
|
||||
```
|
||||
|
||||
`remote_urls` must use SSH SCP form for github.com, gitlab.com, or gitee.com. `repo_git_timeout` applies to each repo clone/pull and defaults to `10s`; a bare number such as `10` is interpreted as seconds, while `10000ms`, `10s`, and `1m` keep their explicit units. `max_concurrency` defaults to `1` and is capped at runtime by `floor(availableMemoryGB / 2)` with a minimum of `1`; the effective value is printed at the start of each loop. `analyze_failure_threshold` defaults to `3`, must be at least `2`, and skips repeated failing analyze runs for the same repo branch until the auto-sync state is cleared. Use `branches` to try branches in order; legacy `branch` remains supported. If all branches are unavailable or time out, watch logs an error, records the repo status, and skips that repo for the loop. Leave `group_name` empty or omit it to skip group add/sync for that project. `GITNEXUS_HOME/watch/project_commit_info.txt` is for inspection only; GitNexus stores machine state separately in `GITNEXUS_HOME/watch/auto-sync-state.json`.
|
||||
`sync_interval_minutes` must be an integer of at least `5`. `local_path` must be an absolute path without traversal. `remote_urls` must use SSH SCP form for github.com, gitlab.com, or gitee.com. `repo_git_timeout` applies to each repo clone/pull and defaults to `10s`; a bare number such as `10` is interpreted as seconds, while `10000ms`, `10s`, and `1m` keep their explicit units. `max_concurrency` defaults to `1` and is capped at runtime by `floor(availableMemoryGB / 2)` with a minimum of `1`; the effective value is printed at the start of each loop. `analyze_failure_threshold` defaults to `3`, must be at least `2`, and skips repeated failing analyze runs for the same repo branch until the auto-sync state is cleared. Use `branches` to try branches in order; legacy `branch` remains supported, but the two fields cannot be set together. If all branches are unavailable or time out, watch logs an error, records the repo status, and skips that repo for the loop. Leave `group_name` empty or omit it to skip group add/sync for that project; otherwise create the group first with `gitnexus group create <name>`. `$GITNEXUS_HOME/watch/project_commit_info.txt` is for inspection only; GitNexus stores machine state separately in `$GITNEXUS_HOME/watch/auto-sync-state.json`.
|
||||
|
||||
> **`gitnexus uninstall`** reverses `gitnexus setup` — it removes the GitNexus MCP entries, hooks, and skill directories it added to each detected editor. Skill directories are identified **by bundled gitnexus skill name** (e.g. `gitnexus-cli/`), so if you customized files inside an installed skill directory, back them up first. It is a dry-run preview by default and prints the exact paths it would remove; pass `--force` to apply. Per-repo indexes (`gitnexus clean --all`) and the global npm package (`npm uninstall -g gitnexus`) are left for you to remove.
|
||||
|
||||
|
|
|
|||
|
|
@ -20,16 +20,11 @@ function runHelpArgs(args: string[], env: NodeJS.ProcessEnv = {}) {
|
|||
}
|
||||
|
||||
function runCliArgs(args: string[], env: NodeJS.ProcessEnv = {}) {
|
||||
return spawnSync(process.execPath, ['--import', 'tsx', cliEntry, ...args], {
|
||||
return spawnSync(process.execPath, [...CLI_SPAWN_PREFIX, ...args], {
|
||||
cwd: repoRoot,
|
||||
encoding: 'utf8',
|
||||
env: { ...process.env, ...env },
|
||||
});
|
||||
// return spawnSync(process.execPath, [...CLI_SPAWN_PREFIX, ...args, '--help'], {
|
||||
// cwd: repoRoot,
|
||||
// encoding: 'utf8',
|
||||
// env: { ...process.env, ...env },
|
||||
// });
|
||||
}
|
||||
|
||||
function runRootHelp(env: NodeJS.ProcessEnv = {}) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue