From aad024518a6c5308d577f9bea27b88ab8b9bd6c3 Mon Sep 17 00:00:00 2001 From: GreyC <4105526+GreyC@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:35:54 +0000 Subject: [PATCH 1/3] perf: replace synchronous I/O with asynchronous I/O in setup command The `setup` command was using synchronous file system calls (`fs.mkdirSync` and `fs.writeFileSync`) within an asynchronous action handler. These have been replaced with `fs.promises.mkdir` and `fs.promises.writeFile` to avoid blocking the event loop. The redundant `fs.existsSync` check was also removed as `mkdir` with `recursive: true` is idempotent. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- packages/cli/src/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 6f8f328..8ed543c 100755 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -75,12 +75,10 @@ program await JulesClient.validateKey(apiKey); const configDir = path.join(os.homedir(), '.config', 'jules'); - if (!fs.existsSync(configDir)) { - fs.mkdirSync(configDir, { recursive: true }); - } + await fs.promises.mkdir(configDir, { recursive: true }); const configPath = path.join(configDir, 'config.json'); - fs.writeFileSync(configPath, JSON.stringify({ apiKey }, null, 2)); + await fs.promises.writeFile(configPath, JSON.stringify({ apiKey }, null, 2)); console.log('Setup complete. API key saved to ~/.config/jules/config.json'); } catch (error: any) { From 9262ead089cd33f0f70c773cb703830be2f16d93 Mon Sep 17 00:00:00 2001 From: GreyC <4105526+GreyC@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:42:53 +0000 Subject: [PATCH 2/3] perf: replace synchronous I/O with asynchronous I/O in setup command The `setup` command was using synchronous file system calls (`fs.mkdirSync` and `fs.writeFileSync`) within an asynchronous action handler. These have been replaced with `fs.promises.mkdir` and `fs.promises.writeFile` to avoid blocking the event loop. The redundant `fs.existsSync` check was also removed as `mkdir` with `recursive: true` is idempotent. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> From 889c77bc8509175950879d6634aaf37701acb30f Mon Sep 17 00:00:00 2001 From: GreyC <4105526+GreyC@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:49:16 +0000 Subject: [PATCH 3/3] perf: replace synchronous I/O with asynchronous I/O in setup command The `setup` command was using synchronous file system calls (`fs.mkdirSync` and `fs.writeFileSync`) within an asynchronous action handler. These have been replaced with `fs.promises.mkdir` and `fs.promises.writeFile` to avoid blocking the event loop. The redundant `fs.existsSync` check was also removed as `mkdir` with `recursive: true` is idempotent. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>