@@ -38,13 +38,13 @@ async function setup() {
3838 console . log ( " ⚠ `nemoclaw setup` is deprecated. Use `nemoclaw onboard` instead." ) ;
3939 console . log ( " Running legacy setup.sh for backwards compatibility..." ) ;
4040 console . log ( "" ) ;
41- await ensureApiKey ( ) ;
42- run ( `bash "${ SCRIPTS } /setup.sh"` ) ;
41+ const key = await ensureApiKey ( ) ;
42+ run ( `bash "${ SCRIPTS } /setup.sh"` , { env : { NVIDIA_API_KEY : key } } ) ;
4343}
4444
4545async function setupSpark ( ) {
46- await ensureApiKey ( ) ;
47- run ( `sudo -E NVIDIA_API_KEY=" ${ process . env . NVIDIA_API_KEY } " bash "${ SCRIPTS } /setup-spark.sh"` ) ;
46+ const key = await ensureApiKey ( ) ;
47+ run ( `sudo -E bash "${ SCRIPTS } /setup-spark.sh"` , { env : { NVIDIA_API_KEY : key } } ) ;
4848}
4949
5050async function deploy ( instanceName ) {
@@ -57,10 +57,14 @@ async function deploy(instanceName) {
5757 console . error ( " nemoclaw deploy nemoclaw-test" ) ;
5858 process . exit ( 1 ) ;
5959 }
60- await ensureApiKey ( ) ;
60+
61+ const env = { ...process . env } ;
62+ env . NVIDIA_API_KEY = await ensureApiKey ( ) ;
63+
6164 if ( isRepoPrivate ( "NVIDIA/OpenShell" ) ) {
62- await ensureGithubToken ( ) ;
65+ env . GITHUB_TOKEN = await ensureGithubToken ( ) ;
6366 }
67+
6468 const name = instanceName ;
6569 const gpu = process . env . NEMOCLAW_GPU || "a2-highgpu-1g:nvidia-tesla-a100:1" ;
6670
@@ -83,12 +87,12 @@ async function deploy(instanceName) {
8387
8488 if ( ! exists ) {
8589 console . log ( ` Creating Brev instance '${ name } ' (${ gpu } )...` ) ;
86- run ( `brev create ${ name } --gpu "${ gpu } "` ) ;
90+ run ( `brev create ${ name } --gpu "${ gpu } "` , { env } ) ;
8791 } else {
8892 console . log ( ` Brev instance '${ name } ' already exists.` ) ;
8993 }
9094
91- run ( `brev refresh` , { ignoreError : true } ) ;
95+ run ( `brev refresh` , { ignoreError : true , env } ) ;
9296
9397 console . log ( " Waiting for SSH..." ) ;
9498 for ( let i = 0 ; i < 60 ; i ++ ) {
0 commit comments