gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Background task processing for long operations

Open shivas1432 opened this issue 1 year ago • 2 comments

What would you like to be added?

Run long operations in background while continuing other work.

Why is this needed?

Analyzing large codebases takes 20+ minutes and blocks all CLI usage. Developers must wait idle or use separate terminals, breaking workflow. Modern tools (VS Code, IDEs) handle heavy operations in background.

Additional context

example : /task start "Analyze codebase" --background /task status 1234 # Progress: 67/120 files (56%), ETA: 8min /task result 1234 # Get results when done /task list # Show all running tasks

Notifications:

🔔 Task #1234 completed! Use /task result 1234

shivas1432 avatar Aug 10 '25 15:08 shivas1432

This would be a great enhancement — background task support could really improve workflow efficiency.
Until it’s officially implemented, here are a few possible workarounds you might try:

  • Run the CLI in multiple terminal windows/tabs — one for the long-running task, another for regular commands.
  • Use nohup or & on Unix-like systems to run operations in the background (e.g., nohup cli analyze codebase &).
  • Redirect logs to a file so you can monitor progress without blocking your main session.
  • Leverage screen or tmux to keep tasks running persistently in the background.
  • Use OS-level notifications (e.g., notify-send on Linux, AppleScript on macOS, or msg on Windows) to get alerts when the task finishes.

These aren’t as seamless as native background execution with /task start ... --background,
but they can help maintain productivity until proper background task management is added.

MustafaKemal0146 avatar Aug 10 '25 16:08 MustafaKemal0146

This is something we've looked into but decided to table for now. You can use a terminal multiplexer like tmux for working with multiple GCLI instances at the same time without having to leave your window.

scidomino avatar Aug 14 '25 20:08 scidomino