fix: Always use npx — stop silent global install failures

Remove the npm install -g attempt from the installer that silently
fails on many systems (permissions, PATH, node version managers).
All configs (MCP server, hooks, next-steps) now always use
npx @colbymchenry/codegraph. Global install offered as an optional tip.

Fixes #37, #38
This commit is contained in:
Colby McHenry
2026-02-19 15:28:56 -06:00
parent 3be779f6f6
commit 675aab386a
4 changed files with 26 additions and 73 deletions
+6 -6
View File
@@ -1015,17 +1015,17 @@ program
process.exit(0);
}
// Spawn `codegraph sync` as a detached background process
// so this hook exits immediately and doesn't block Claude Code
const isWindows = process.platform === 'win32';
// Spawn sync as a detached background process
// so this hook exits immediately and doesn't block Claude Code.
// Uses process.argv[0]/[1] (e.g. node /path/to/codegraph.js) so it
// works whether invoked via global install, npx, or directly.
const child = spawn(
isWindows ? 'codegraph' : process.argv[0]!,
isWindows ? ['sync', '--quiet', projectRoot!] : [process.argv[1]!, 'sync', '--quiet', projectRoot!],
process.argv[0]!,
[process.argv[1]!, 'sync', '--quiet', projectRoot!],
{
detached: true,
stdio: 'ignore',
windowsHide: true,
shell: isWindows,
}
);
child.unref();