11import * as path from "node:path" ;
2- import { Command } from "commander" ;
2+ import { Command , Option } from "commander" ;
33import type { AnalysisOptions , CallGraphProviderName , EmitTarget } from "./options" ;
44
55/**
@@ -16,10 +16,25 @@ export function buildProgram(): Command {
1616 . option ( "-o, --output <dir>" , "output directory (omit ⇒ compact output to stdout)" )
1717 . option ( "--emit <target>" , "output target: json (analysis.json, default) | neo4j (graph.cypher or live push) | schema (the Neo4j schema.json contract)" , "json" )
1818 . option ( "--app-name <name>" , "logical application name for the graph :Application anchor (default: input dir name)" )
19- . option ( "--neo4j-uri <uri>" , "push the graph to a live Neo4j over Bolt (incremental); omit to write graph.cypher" )
20- . option ( "--neo4j-user <user>" , "Neo4j username" , "neo4j" )
21- . option ( "--neo4j-password <password>" , "Neo4j password" , "neo4j" )
22- . option ( "--neo4j-database <db>" , "Neo4j database name (default: server default)" )
19+ // The four Neo4j connection options also read the standard NEO4J_* environment variables when
20+ // the flag is omitted (an explicit flag wins). Prefer NEO4J_PASSWORD over the flag — a flag
21+ // value is visible in shell history / the process list. Commander renders the `(env: …)` hint.
22+ . addOption (
23+ new Option (
24+ "--neo4j-uri <uri>" ,
25+ "push the graph to a live Neo4j over Bolt (incremental); omit to write graph.cypher" ,
26+ ) . env ( "NEO4J_URI" ) ,
27+ )
28+ . addOption ( new Option ( "--neo4j-user <user>" , "Neo4j username" ) . env ( "NEO4J_USERNAME" ) . default ( "neo4j" ) )
29+ . addOption (
30+ new Option (
31+ "--neo4j-password <password>" ,
32+ "Neo4j password (prefer the env var; a flag is visible in shell history / process list)" ,
33+ )
34+ . env ( "NEO4J_PASSWORD" )
35+ . default ( "neo4j" ) ,
36+ )
37+ . addOption ( new Option ( "--neo4j-database <db>" , "Neo4j database name" ) . env ( "NEO4J_DATABASE" ) )
2338 . option ( "-a, --analysis-level <n>" , "analysis depth: 1 = symbol table + tsc resolver call graph + RTA (default); 2 = call graph" , "1" )
2439 . option ( "-t, --target-files <paths...>" , "restrict analysis to specific files (incremental)" )
2540 . option ( "--skip-tests" , "skip test trees (default)" )
0 commit comments