mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-05 02:40:55 -07:00
chore(offload): organize configuration into .gemini/offload sub-folder
This commit is contained in:
@@ -6,17 +6,5 @@
|
||||
},
|
||||
"general": {
|
||||
"devtools": true
|
||||
},
|
||||
"maintainer": {
|
||||
"deepReview": {
|
||||
"projectId": "gemini-cli-team-quota",
|
||||
"zone": "us-west1-a",
|
||||
"remoteHost": "gcli-worker",
|
||||
"remoteWorkDir": "~/dev/main",
|
||||
"userFork": "google-gemini/gemini-cli",
|
||||
"upstreamRepo": "google-gemini/gemini-cli",
|
||||
"useContainer": false,
|
||||
"terminalType": "iterm2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@ export async function runChecker(args: string[], env: NodeJS.ProcessEnv = proces
|
||||
return 1;
|
||||
}
|
||||
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/offload/settings.json');
|
||||
if (!fs.existsSync(settingsPath)) {
|
||||
console.error('❌ Settings not found. Run "npm run offload:setup" first.');
|
||||
return 1;
|
||||
}
|
||||
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
||||
const config = settings.maintainer?.deepReview;
|
||||
const config = settings.deepReview;
|
||||
if (!config) {
|
||||
console.error('❌ Deep Review configuration not found.');
|
||||
return 1;
|
||||
|
||||
@@ -17,11 +17,11 @@ const INSTANCE_PREFIX = `gcli-offload-${USER}`;
|
||||
const DEFAULT_ZONE = 'us-west1-a';
|
||||
|
||||
function getProjectId(): string {
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/offload/settings.json');
|
||||
if (fs.existsSync(settingsPath)) {
|
||||
try {
|
||||
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
||||
return settings.maintainer?.deepReview?.projectId;
|
||||
return settings.deepReview?.projectId;
|
||||
} catch (e) {}
|
||||
}
|
||||
return process.env.GOOGLE_CLOUD_PROJECT || '';
|
||||
@@ -79,13 +79,13 @@ async function stopWorker() {
|
||||
}
|
||||
|
||||
async function remoteStatus() {
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/offload/settings.json');
|
||||
if (!fs.existsSync(settingsPath)) {
|
||||
console.error('❌ Settings not found. Run "npm run offload:setup" first.');
|
||||
return;
|
||||
}
|
||||
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
||||
const config = settings.maintainer?.deepReview;
|
||||
const config = settings.deepReview;
|
||||
|
||||
const provider = ProviderFactory.getProvider({
|
||||
projectId: config?.projectId || getProjectId(),
|
||||
|
||||
@@ -23,13 +23,13 @@ export async function runOrchestrator(args: string[], env: NodeJS.ProcessEnv = p
|
||||
}
|
||||
|
||||
// 1. Load Settings
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/offload/settings.json');
|
||||
if (!fs.existsSync(settingsPath)) {
|
||||
console.error('❌ Settings not found. Run "npm run offload:setup" first.');
|
||||
return 1;
|
||||
}
|
||||
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
||||
const config = settings.maintainer?.deepReview;
|
||||
const config = settings.deepReview;
|
||||
if (!config) {
|
||||
console.error('❌ Deep Review configuration not found.');
|
||||
return 1;
|
||||
|
||||
@@ -22,8 +22,10 @@ export class GceCosProvider implements WorkerProvider {
|
||||
this.projectId = projectId;
|
||||
this.zone = zone;
|
||||
this.instanceName = instanceName;
|
||||
this.sshConfigPath = path.join(repoRoot, '.gemini/offload_ssh_config');
|
||||
this.knownHostsPath = path.join(repoRoot, '.gemini/offload_known_hosts');
|
||||
const offloadDir = path.join(repoRoot, '.gemini/offload');
|
||||
if (!fs.existsSync(offloadDir)) fs.mkdirSync(offloadDir, { recursive: true });
|
||||
this.sshConfigPath = path.join(offloadDir, 'ssh_config');
|
||||
this.knownHostsPath = path.join(offloadDir, 'known_hosts');
|
||||
}
|
||||
|
||||
async provision(): Promise<number> {
|
||||
|
||||
@@ -68,8 +68,9 @@ export async function runSetup(env: NodeJS.ProcessEnv = process.env) {
|
||||
const setupRes = await provider.setup({ projectId, zone, dnsSuffix });
|
||||
if (setupRes !== 0) return setupRes;
|
||||
|
||||
const sshConfigPath = path.join(REPO_ROOT, '.gemini/offload_ssh_config');
|
||||
const knownHostsPath = path.join(REPO_ROOT, '.gemini/offload_known_hosts');
|
||||
const offloadDir = path.join(REPO_ROOT, '.gemini/offload');
|
||||
const sshConfigPath = path.join(offloadDir, 'ssh_config');
|
||||
const knownHostsPath = path.join(offloadDir, 'known_hosts');
|
||||
|
||||
// 1b. Security Fork Management (Temporarily Disabled)
|
||||
const upstreamRepo = 'google-gemini/gemini-cli';
|
||||
@@ -133,13 +134,12 @@ export async function runSetup(env: NodeJS.ProcessEnv = process.env) {
|
||||
}
|
||||
|
||||
// Save Settings
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/settings.json');
|
||||
const settingsPath = path.join(REPO_ROOT, '.gemini/offload/settings.json');
|
||||
let settings: any = {};
|
||||
if (fs.existsSync(settingsPath)) {
|
||||
try { settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8')); } catch (e) {}
|
||||
}
|
||||
settings.maintainer = settings.maintainer || {};
|
||||
settings.maintainer.deepReview = {
|
||||
settings.deepReview = {
|
||||
projectId, zone,
|
||||
remoteHost: 'gcli-worker',
|
||||
remoteWorkDir, userFork, upstreamRepo,
|
||||
|
||||
Reference in New Issue
Block a user