Add interactive CLI installer for Claude Code integration

- New `codegraph install` command and auto-run when invoked with no args
- Beautiful ASCII banner using figlet
- Interactive prompts for global (~/.claude) or local (./.claude) installation
- Writes MCP server config to claude.json
- Writes auto-allow permissions to settings.json
- For local installs: auto-initializes project, indexes, and installs git hooks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-01-19 14:31:29 -06:00
co-authored by Claude Opus 4.5
parent 0a1b78854a
commit 9baf59e5f0
7 changed files with 584 additions and 5 deletions
+28
View File
@@ -5,6 +5,8 @@
* Command-line interface for CodeGraph code intelligence.
*
* Usage:
* codegraph Run interactive installer (when no args)
* codegraph install Run interactive installer
* codegraph init [path] Initialize CodeGraph in a project
* codegraph index [path] Index all files in the project
* codegraph sync [path] Sync changes since last index
@@ -20,6 +22,20 @@ import * as path from 'path';
import * as fs from 'fs';
import CodeGraph from '../index';
import type { IndexProgress } from '../index';
import { runInstaller } from '../installer';
// Check if running with no arguments - run installer
if (process.argv.length === 2) {
runInstaller().catch((err) => {
console.error('Installation failed:', err.message);
process.exit(1);
});
} else {
// Normal CLI flow
main();
}
function main() {
const program = new Command();
@@ -721,5 +737,17 @@ program
}
});
/**
* codegraph install
*/
program
.command('install')
.description('Run interactive installer for Claude Code integration')
.action(async () => {
await runInstaller();
});
// Parse and run
program.parse();
} // end main()