@@ -48,66 +48,54 @@ const TOKENIZER_URL =
4848// ─── CLI Definition ───────────────────────────────────────────────────────────
4949
5050const program = new Command ( ) ;
51-
52- program
53- . command ( "index" )
54- . description ( "Build a symbol index of the local repository for context-aware reviews" )
55- . action ( async ( ) => {
56- await runIndexer ( ) ;
57- } ) ;
51+ const opts : {
52+ branch : string ;
53+ format: "markdown" | "json" ;
54+ output ? : string ;
55+ minSeverity: Severity ;
56+ stdin: boolean ;
57+ color: boolean ;
58+ context ? : string ;
59+ } = { } as any ;
5860
5961program
6062 . name ( "diffmind" )
6163 . description ( "Local-first AI code review for your git diffs" )
62- . version ( "0.3.2 " )
64+ . version ( "0.3.3 " )
6365 . option ( "-b, --branch <name>" , "Target branch to diff against" , "main" )
64- . option (
65- "-f, --format <type>" ,
66- 'Output format: "markdown" or "json"' ,
67- "markdown"
68- )
66+ . option ( "-f, --format <type>" , 'Output format: "markdown" or "json"' , "markdown" )
6967 . option ( "-o, --output <file>" , "Write output to a file instead of stdout" )
70- . option (
71- "-c, --context <text|file>" ,
72- "Business context (ticket description, acceptance criteria)"
73- )
74- . option (
75- "--min-severity <level>" ,
76- 'Minimum severity to report: "high", "medium", or "low"' ,
77- "low"
78- )
68+ . option ( "-c, --context <text|file>" , "Business context (ticket description, acceptance criteria)" )
69+ . option ( "--min-severity <level>" , 'Minimum severity to report: "high", "medium", or "low"' , "low" )
7970 . option ( "--stdin" , "Read git diff from stdin instead of running git diff" )
80- . option ( "--no-color" , "Disable colored output" ) ;
71+ . option ( "--no-color" , "Disable colored output" )
72+ . action ( async ( options ) => {
73+ // This is the default action (no subcommand used)
74+ Object . assign ( opts , options ) ;
75+ await main ( ) . catch ( ( err ) => {
76+ console . error ( chalk . red ( `Fatal Error: ${ err . message } ` ) ) ;
77+ process . exit ( 1 ) ;
78+ } ) ;
79+ } ) ;
80+
81+ program
82+ . command ( "index" )
83+ . description ( "Build a symbol index of the local repository for context-aware reviews" )
84+ . action ( async ( ) => {
85+ await runIndexer ( ) ;
86+ } ) ;
8187
8288// ─── Entry Point ──────────────────────────────────────────────────────────────
8389
8490function run ( ) {
8591 program . parse ( process . argv ) ;
86-
87- // If no subcommand is used, run the default analysis
88- if ( ! program . args . length || program . args [ 0 ] !== "index" ) {
89- main ( ) . catch ( ( err ) => {
90- console . error ( chalk . red ( `Fatal Error: ${ err . message } ` ) ) ;
91- process . exit ( 1 ) ;
92- } ) ;
93- }
9492}
9593
9694// Only run if executed directly
9795if ( require . main === module ) {
9896 run ( ) ;
9997}
10098
101- const opts = program . opts < {
102- branch : string ;
103- format: "markdown" | "json" ;
104- output ? : string ;
105- minSeverity: Severity ;
106- stdin: boolean ;
107- color: boolean ;
108- context ? : string ;
109- } > ( ) ;
110-
11199// ─── Main Logic ───────────────────────────────────────────────────────────────
112100
113101import { Worker } from "worker_threads" ;
0 commit comments