mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-24 21:10:43 -07:00
feat(workspaces): consolidate cleanup commands and add safety confirmations
This commit is contained in:
@@ -26,8 +26,11 @@ This skill enables the agent to utilize **Gemini Workspaces**—a high-performan
|
||||
npm run workspace <PR_NUMBER> [action]
|
||||
```
|
||||
- Actions: `review` (default), `fix`, `ready`.
|
||||
3. **Check Status**: Poll the progress using `npm run workspace:check <PR_NUMBER>` or see the global state with `npm run workspace:status`.
|
||||
4. **Prune/Clean**: Cleanup old worktrees and dead sessions with `npm run workspace:clean` (all) or `npm run workspace:remove <PR_NUMBER>` (specific).
|
||||
3. **Check Status**: See global state and active sessions with `npm run workspace:status`, or deep-dive into specific PR logs with `npm run workspace:check <PR_NUMBER>`.
|
||||
4. **Cleanup**:
|
||||
- **Bulk**: Clear all sessions/worktrees with `npm run workspace:clean-all`.
|
||||
- **Surgical**: Kill a specific PR task with `npm run workspace:kill <PR_NUMBER> <action>`.
|
||||
5. **Fleet**: Manage VM lifecycle with `npm run workspace:fleet [stop|provision|list]`.
|
||||
|
||||
## ⚠️ Important Constraints
|
||||
- **Absolute Paths**: Always use absolute paths (e.g., `/mnt/disks/data/...`) when orchestrating remote commands.
|
||||
|
||||
@@ -61,7 +61,14 @@ export async function runCleanup(args: string[], env: NodeJS.ProcessEnv = proces
|
||||
}
|
||||
|
||||
// --- Bulk Cleanup ---
|
||||
console.log(`🧹 Starting BULK cleanup on ${targetVM}...`);
|
||||
console.log(`⚠️ DANGER: You are about to perform a BULK cleanup on ${targetVM}.`);
|
||||
const confirmed = await confirm(' Are you sure you want to kill ALL sessions and worktrees?');
|
||||
if (!confirmed) {
|
||||
console.log('❌ Cleanup cancelled.');
|
||||
return 0;
|
||||
}
|
||||
|
||||
console.log(`🧹 Starting BULK cleanup...`);
|
||||
|
||||
// 1. Standard Cleanup
|
||||
console.log(' - Killing ALL remote tmux sessions...');
|
||||
|
||||
@@ -67,13 +67,12 @@
|
||||
"workspace": "tsx .gemini/skills/workspaces/scripts/orchestrator.ts",
|
||||
"workspace:setup": "tsx .gemini/skills/workspaces/scripts/setup.ts",
|
||||
"workspace:check": "tsx .gemini/skills/workspaces/scripts/check.ts",
|
||||
"workspace:clean": "tsx .gemini/skills/workspaces/scripts/clean.ts",
|
||||
"workspace:prune": "tsx .gemini/skills/workspaces/scripts/clean.ts",
|
||||
"workspace:clean-all": "tsx .gemini/skills/workspaces/scripts/clean.ts",
|
||||
"workspace:kill": "tsx .gemini/skills/workspaces/scripts/clean.ts",
|
||||
"workspace:fleet": "tsx .gemini/skills/workspaces/scripts/fleet.ts",
|
||||
"workspace:status": "tsx .gemini/skills/workspaces/scripts/status.ts",
|
||||
"workspace:attach": "tsx .gemini/skills/workspaces/scripts/attach.ts",
|
||||
"workspace:logs": "tsx .gemini/skills/workspaces/scripts/logs.ts",
|
||||
"workspace:remove": "tsx .gemini/skills/workspaces/scripts/clean.ts",
|
||||
"pre-commit": "node scripts/pre-commit.js"
|
||||
},
|
||||
"overrides": {
|
||||
|
||||
Reference in New Issue
Block a user