diff --git a/.gemini/skills/deep-review/README.md b/.gemini/skills/deep-review/README.md index 15afc4b183..086037ab04 100644 --- a/.gemini/skills/deep-review/README.md +++ b/.gemini/skills/deep-review/README.md @@ -44,8 +44,16 @@ workstation. - **Terminal Automation**: Your preferred terminal emulator (for example, `iterm2` or `terminal`). -The setup script automatically installs `tsx` and the nightly version of Gemini -CLI on the remote host in an isolated directory. +**Pre-existing environments**: If your remote host is already set up for Gemini +CLI development, you can point the **Remote Work Directory** to your existing +repository instance. The skill will detect your existing GitHub CLI and Gemini +CLI installations and use them directly without redundant setup. + +**Isolation and safety**: By default, the skill attempts to isolate its +configuration using a dedicated profile (`~/.gemini-deep-review`) on the remote +host. This ensures that the automated verification tasks do not impact your +primary Gemini CLI environment or machine state, following development best +practices. ### Launching a review diff --git a/.gemini/skills/deep-review/scripts/setup.ts b/.gemini/skills/deep-review/scripts/setup.ts index 1a88141e14..d01b3d3fda 100644 --- a/.gemini/skills/deep-review/scripts/setup.ts +++ b/.gemini/skills/deep-review/scripts/setup.ts @@ -81,11 +81,19 @@ async function main() { const terminalType = await prompt('\nTerminal Automation (iterm2 / terminal / none)', 'iterm2'); // Local Dependencies Install (Isolated) - console.log(`\nšŸ“¦ Installing isolated dependencies (nightly CLI & tsx) in ${remoteWorkDir}...`); const envLoader = 'export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] && \\. "$NVM_DIR/nvm.sh"; [ -s "$NVM_DIR/bash_completion" ] && \\. "$NVM_DIR/bash_completion"'; - // Note: we create a package.json first to prevent npm from walking up the tree looking for one - const installCmd = `${envLoader} && cd ${remoteWorkDir} && npm init -y > /dev/null && npm install tsx @google/gemini-cli@nightly`; - spawnSync('ssh', [remoteHost, q(installCmd)], { stdio: 'inherit', shell: true }); + + console.log(`\nšŸ“¦ Checking isolated dependencies in ${remoteWorkDir}...`); + const depCheck = spawnSync('ssh', [remoteHost, `${envLoader} && [ -f ${remoteWorkDir}/node_modules/.bin/tsx ] && [ -f ${remoteWorkDir}/node_modules/.bin/gemini ]`], { shell: true }); + + if (depCheck.status !== 0) { + console.log(`šŸ“¦ Installing isolated dependencies (nightly CLI & tsx) in ${remoteWorkDir}...`); + // Note: we create a package.json first to prevent npm from walking up the tree looking for one if it doesn't exist + const installCmd = `${envLoader} && mkdir -p ${remoteWorkDir} && cd ${remoteWorkDir} && [ -f package.json ] || npm init -y > /dev/null && npm install tsx @google/gemini-cli@nightly`; + spawnSync('ssh', [remoteHost, q(installCmd)], { stdio: 'inherit', shell: true }); + } else { + console.log('āœ… Isolated dependencies already present.'); + } // Save Settings const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');