fix: Prompt before global npm install during installer

The installer previously ran `npm install -g` silently without user
consent. Now it asks for confirmation first, explains why the global
install is needed (hooks & MCP server), and gracefully skips if declined.
README updated to document this step.

Closes #69

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-04-01 14:10:01 -05:00
co-authored by Claude Opus 4.6
parent 8f5f88b813
commit 12b0414900
2 changed files with 28 additions and 17 deletions
+8 -6
View File
@@ -162,6 +162,7 @@ npx @colbymchenry/codegraph
```
The interactive installer will:
- Prompt to install `codegraph` globally (needed for hooks & MCP server to work)
- Configure the MCP server in `~/.claude.json`
- Set up auto-allow permissions for CodeGraph tools
- Add global instructions to `~/.claude/CLAUDE.md` (teaches Claude how to use CodeGraph)
@@ -306,12 +307,13 @@ npx @colbymchenry/codegraph # Run via npx (no global install needed)
```
The installer will:
1. Ask for installation location (global `~/.claude` or local `./.claude`)
2. Configure the MCP server in `claude.json`
3. Optionally set up auto-allow permissions
4. Add global instructions to `~/.claude/CLAUDE.md` (teaches Claude how to use CodeGraph)
5. Install Claude Code hooks for automatic index syncing
6. For local installs: initialize and index the current project
1. Prompt to install `codegraph` globally (needed for hooks & MCP server)
2. Ask for installation location (global `~/.claude` or local `./.claude`)
3. Configure the MCP server in `claude.json`
4. Optionally set up auto-allow permissions
5. Add global instructions to `~/.claude/CLAUDE.md` (teaches Claude how to use CodeGraph)
6. Install Claude Code hooks for automatic index syncing
7. For local installs: initialize and index the current project
### `codegraph init [path]`