abhigyanpatwari/GitNexus · error · RegistryNotFoundError

No registered repo matches "${target}".${hint}

Error message

No registered repo matches "${target}".${hint}

What it means

Target resolution missed at every tier: no canonical path match and no case-insensitive name match — the registry has no such repo. The error embeds the available names as a hint, with 'name (/path)' disambiguated labels for names that appear in multiple entries, mirroring the hint shape used by -r <name> errors.

Source

Thrown at gitnexus/src/storage/repo-manager.ts:1349

  const nameMatches = entries.filter((e) => e.name.toLowerCase() === targetLower);
  if (nameMatches.length === 1) return nameMatches[0];
  if (nameMatches.length > 1) {
    throw new RegistryAmbiguousTargetError(target, nameMatches);
  }

  // Tier 3: miss. Build the available-names hint ONCE; resolveRepo-style
  // disambiguated labels (`app (/path)`) are applied when the same name
  // appears in multiple entries so the user sees the same hint shape as
  // `-r <name>` errors.
  const nameCounts = new Map<string, number>();
  for (const e of entries) {
    const key = e.name.toLowerCase();
    nameCounts.set(key, (nameCounts.get(key) ?? 0) + 1);
  }
  const availableNames = entries.map((e) =>
    (nameCounts.get(e.name.toLowerCase()) ?? 0) > 1 ? `${e.name} (${e.path})` : e.name,
  );
  throw new RegistryNotFoundError(target, availableNames);
};

/**
 * List all registered repos from the global registry.
 *
 * With `validate: true`, prunes only entries whose metadata is *provably* gone
 * (fs.access on both gitnexus.json and legacy meta.json fails with ENOENT or
 * ENOTDIR) and persists the result on a best-effort basis: the pruned view is
 * always returned, even when the write fails. Entries that are merely "not provably
 * absent" — any other fs.access failure (EIO/EAGAIN/EBUSY/EACCES, etc.) — are
 * KEPT, so a transient I/O storm cannot wipe the registry. A kept entry is
 * therefore "not confirmed present," not "confirmed present"; downstream DB
 * opens are independently and lazily guarded.
 */
export const listRegisteredRepos = async (opts?: {
  validate?: boolean;
}): Promise<RegistryEntry[]> => {
  const entries = await readRegistry();

View on GitHub (pinned to aac7515d2a)

Solutions

  1. Run gitnexus analyze on the repo first, then retry with its name or absolute path
  2. Compare your spelling against the available-names hint embedded in the error (names match case-insensitively)
  3. Use the absolute repo path to sidestep name issues entirely
  4. If the entry was pruned, re-index to re-register it
Defensive patterns

Strategy: validation

Validate before calling

import path from 'node:path';
const registered = entries.some(
  (e) =>
    path.resolve(e.path) === path.resolve(target) ||
    e.name.toLowerCase() === target.toLowerCase(),
);
if (!registered) {
  throw new Error(`"${target}" is not registered — run gitnexus analyze first`);
}

Prevention

When it happens

Trigger: `gitnexus remove typo`, or passing -r <name> / an MCP repo argument for a repo that was never analyzed on this machine.

Common situations: Fresh machine or CI container where analyze hasn't run yet; typo or renamed directory; different user account (~/.gitnexus is per-user); the entry was pruned earlier by registry validation because its storage went provably missing.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@aac7515d2a (2026-08-20). Data as JSON: /api/errors/2ceb648856a82a16. Report an issue: GitHub.