docs: clarify setup with pre-existing environments and isolation benefits

This commit is contained in:
mkorwel
2026-03-13 17:57:00 -07:00
parent 350f4dcd5c
commit d5434f21d5
2 changed files with 22 additions and 6 deletions

View File

@@ -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

View File

@@ -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');