mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
docs: clarify setup with pre-existing environments and isolation benefits
This commit is contained in:
@@ -44,8 +44,16 @@ workstation.
|
|||||||
- **Terminal Automation**: Your preferred terminal emulator (for example,
|
- **Terminal Automation**: Your preferred terminal emulator (for example,
|
||||||
`iterm2` or `terminal`).
|
`iterm2` or `terminal`).
|
||||||
|
|
||||||
The setup script automatically installs `tsx` and the nightly version of Gemini
|
**Pre-existing environments**: If your remote host is already set up for Gemini
|
||||||
CLI on the remote host in an isolated directory.
|
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
|
### Launching a review
|
||||||
|
|
||||||
|
|||||||
@@ -81,11 +81,19 @@ async function main() {
|
|||||||
const terminalType = await prompt('\nTerminal Automation (iterm2 / terminal / none)', 'iterm2');
|
const terminalType = await prompt('\nTerminal Automation (iterm2 / terminal / none)', 'iterm2');
|
||||||
|
|
||||||
// Local Dependencies Install (Isolated)
|
// 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"';
|
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`;
|
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 });
|
spawnSync('ssh', [remoteHost, q(installCmd)], { stdio: 'inherit', shell: true });
|
||||||
|
} else {
|
||||||
|
console.log('✅ Isolated dependencies already present.');
|
||||||
|
}
|
||||||
|
|
||||||
// Save Settings
|
// Save Settings
|
||||||
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
||||||
|
|||||||
Reference in New Issue
Block a user