File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ export async function startCLI(): Promise<void> {
6666 . name ( 'genkit' )
6767 . description ( 'Genkit CLI' )
6868 . version ( version )
69+ . option ( '--no-update-notification' , 'Do not show update notification' )
6970 . hook ( 'preAction' , async ( _ , actionCommand ) => {
7071 await notifyAnalyticsIfFirstRun ( ) ;
7172
@@ -87,12 +88,19 @@ export async function startCLI(): Promise<void> {
8788 await record ( new RunCommandEvent ( commandName ) ) ;
8889 } ) ;
8990
90- // Check for updates and show notification if available
91+ // Parse argv early to get global options
92+ program . parseOptions ( process . argv ) ;
93+
94+ // Check for updates and show notification if available,
95+ // unless --no-update-notification is set
9196 // Run this synchronously to ensure it shows before command execution
92- try {
93- await showUpdateNotification ( ) ;
94- } catch {
95- // Silently ignore errors - update notifications shouldn't break the CLI
97+ const opts = program . opts ( ) ;
98+ if ( ! opts . noUpdateNotification ) {
99+ try {
100+ await showUpdateNotification ( ) ;
101+ } catch {
102+ // Silently ignore errors - update notifications shouldn't break the CLI
103+ }
96104 }
97105
98106 // When running as a spawned UI server process, argv[1] will be '__server-harness'
You can’t perform that action at this time.
0 commit comments