@@ -66,8 +66,7 @@ const TEMPLATES: Record<TemplateKey, TemplateInfo> = {
6666 } ,
6767 [ TEMPLATE_ADVANCED_SAMPLE ] : {
6868 name : "Advanced Samples" ,
69- description :
70- "Implements sample actions with advanced Kernel configs" ,
69+ description : "Implements sample actions with advanced Kernel configs" ,
7170 languages : [ LANGUAGE_TYPESCRIPT , LANGUAGE_PYTHON ] ,
7271 } ,
7372 [ TEMPLATE_COMPUTER_USE ] : {
@@ -91,8 +90,7 @@ const INVOKE_SAMPLES: Record<
9190 'kernel invoke ts-basic get-page-title --payload \'{"url": "https://www.google.com"}\'' ,
9291 [ TEMPLATE_STAGEHAND ] :
9392 'kernel invoke ts-stagehand stagehand-task --payload \'{"query": "Best wired earbuds"}\'' ,
94- [ TEMPLATE_ADVANCED_SAMPLE ] :
95- 'kernel invoke ts-advanced test-captcha-solver' ,
93+ [ TEMPLATE_ADVANCED_SAMPLE ] : "kernel invoke ts-advanced test-captcha-solver" ,
9694 [ TEMPLATE_COMPUTER_USE ] :
9795 'kernel invoke ts-cu cu-task --payload \'{"query": "Return the first url of a search result for NYC restaurant reviews Pete Wells"}\'' ,
9896 [ TEMPLATE_CUA ] :
@@ -104,7 +102,7 @@ const INVOKE_SAMPLES: Record<
104102 [ TEMPLATE_BROWSER_USE ] :
105103 'kernel invoke python-bu bu-task --payload \'{"task": "Compare the price of gpt-4o and DeepSeek-V3"}\'' ,
106104 [ TEMPLATE_ADVANCED_SAMPLE ] :
107- ' kernel invoke python-advanced test-captcha-solver' ,
105+ " kernel invoke python-advanced test-captcha-solver" ,
108106 [ TEMPLATE_COMPUTER_USE ] :
109107 'kernel invoke python-cu cu-task --payload \'{"query": "Return the first url of a search result for NYC restaurant reviews Pete Wells"}\'' ,
110108 [ TEMPLATE_CUA ] :
@@ -117,28 +115,18 @@ const REGISTERED_APP_NAMES: Record<
117115 Partial < Record < TemplateKey , string > >
118116> = {
119117 [ LANGUAGE_TYPESCRIPT ] : {
120- [ TEMPLATE_SAMPLE_APP ] :
121- 'ts-basic' ,
122- [ TEMPLATE_STAGEHAND ] :
123- 'ts-stagehand' ,
124- [ TEMPLATE_ADVANCED_SAMPLE ] :
125- 'ts-advanced' ,
126- [ TEMPLATE_COMPUTER_USE ] :
127- 'ts-cu' ,
128- [ TEMPLATE_CUA ] :
129- 'ts-cua' ,
118+ [ TEMPLATE_SAMPLE_APP ] : "ts-basic" ,
119+ [ TEMPLATE_STAGEHAND ] : "ts-stagehand" ,
120+ [ TEMPLATE_ADVANCED_SAMPLE ] : "ts-advanced" ,
121+ [ TEMPLATE_COMPUTER_USE ] : "ts-cu" ,
122+ [ TEMPLATE_CUA ] : "ts-cua" ,
130123 } ,
131124 [ LANGUAGE_PYTHON ] : {
132- [ TEMPLATE_SAMPLE_APP ] :
133- 'python-basic' ,
134- [ TEMPLATE_BROWSER_USE ] :
135- 'python-bu' ,
136- [ TEMPLATE_ADVANCED_SAMPLE ] :
137- 'python-advanced' ,
138- [ TEMPLATE_COMPUTER_USE ] :
139- 'python-cu' ,
140- [ TEMPLATE_CUA ] :
141- 'python-cua' ,
125+ [ TEMPLATE_SAMPLE_APP ] : "python-basic" ,
126+ [ TEMPLATE_BROWSER_USE ] : "python-bu" ,
127+ [ TEMPLATE_ADVANCED_SAMPLE ] : "python-advanced" ,
128+ [ TEMPLATE_COMPUTER_USE ] : "python-cu" ,
129+ [ TEMPLATE_CUA ] : "python-cua" ,
142130 } ,
143131} ;
144132
@@ -311,14 +299,14 @@ function copyTemplateFiles(
311299 fs . copySync ( templatePath , appPath , {
312300 filter : ( src , dest ) => {
313301 const filename = path . basename ( src ) ;
314- if ( filename === ' _gitignore' ) {
302+ if ( filename === " _gitignore" ) {
315303 fs . copyFileSync ( src , dest ) ;
316304 // Rename it to .gitignore
317- fs . renameSync ( dest , path . join ( path . dirname ( dest ) , ' .gitignore' ) ) ;
305+ fs . renameSync ( dest , path . join ( path . dirname ( dest ) , " .gitignore" ) ) ;
318306 return false ; // Skip the original copy since we handled it
319307 }
320308 return true ; // Copy all other files normally
321- }
309+ } ,
322310 } ) ;
323311}
324312
@@ -363,15 +351,18 @@ function printNextSteps(
363351) : void {
364352 // Determine which sample command to show based on language and template
365353 const deployCommand =
366- language === LANGUAGE_TYPESCRIPT && ( template === TEMPLATE_SAMPLE_APP || template === TEMPLATE_ADVANCED_SAMPLE )
354+ language === LANGUAGE_TYPESCRIPT &&
355+ ( template === TEMPLATE_SAMPLE_APP || template === TEMPLATE_ADVANCED_SAMPLE )
367356 ? "kernel deploy index.ts"
368357 : language === LANGUAGE_TYPESCRIPT && template === TEMPLATE_STAGEHAND
369358 ? "kernel deploy index.ts --env OPENAI_API_KEY=XXX"
370359 : language === LANGUAGE_TYPESCRIPT && template === TEMPLATE_COMPUTER_USE
371360 ? "kernel deploy index.ts --env ANTHROPIC_API_KEY=XXX"
372361 : language === LANGUAGE_TYPESCRIPT && template === TEMPLATE_CUA
373362 ? "kernel deploy index.ts --env OPENAI_API_KEY=XXX"
374- : language === LANGUAGE_PYTHON && ( template === TEMPLATE_SAMPLE_APP || template === TEMPLATE_ADVANCED_SAMPLE )
363+ : language === LANGUAGE_PYTHON &&
364+ ( template === TEMPLATE_SAMPLE_APP ||
365+ template === TEMPLATE_ADVANCED_SAMPLE )
375366 ? "kernel deploy main.py"
376367 : language === LANGUAGE_PYTHON && template === TEMPLATE_BROWSER_USE
377368 ? "kernel deploy main.py --env OPENAI_API_KEY=XXX"
@@ -388,11 +379,11 @@ function printNextSteps(
388379Next steps:
389380 brew install onkernel/tap/kernel
390381 cd ${ appName }
391- export KERNEL_API_KEY=<YOUR_API_KEY>
382+ kernel login # or: export KERNEL_API_KEY=<YOUR_API_KEY>
392383 ${ deployCommand }
393384 ${ INVOKE_SAMPLES [ language ] [ template ] }
394385 # Do this in a separate tab
395- export KERNEL_API_KEY=<YOUR_API_KEY>
386+ kernel login # or: export KERNEL_API_KEY=<YOUR_API_KEY>
396387 kernel logs ${ REGISTERED_APP_NAMES [ language ] [ template ] } --follow
397388 ` )
398389 ) ;
0 commit comments