docs/cli/tutorials/task-planning.md
Keep complex jobs on the rails with Gemini CLI's built-in task planning. In this guide, you'll learn how to ask for a plan, execute it step-by-step, and monitor progress with the todo list.
Standard LLMs have a limited context window and can "forget" the original goal after 10 turns of code generation. Task planning provides:
The best way to trigger task planning is to explicitly ask for it.
Prompt:
I want to migrate this project from JavaScript to TypeScript. Please make a plan first.
Gemini will analyze your codebase and use the write_todos tool to generate a
structured list.
Example Plan:
tsconfig.json..js files to .ts.utils.js.server.js.Once the plan is generated, it appears in your CLI. Review it.
@types/node."The agent will update the todo list dynamically.
Tell the agent to proceed.
Prompt: Looks good. Start with the first step.
As the agent works, you'll see the todo list update in real-time above the input box.
[IN_PROGRESS] Create tsconfig.json).Ctrl+T)For a long-running task, the full todo list might be hidden to save space. You can toggle the full view at any time.
Action: Press Ctrl+T.
This shows the complete list, including pending, in-progress, and completed items. It's a great way to check "how much is left?" without scrolling back up.
Plans change. Maybe you discover a library is incompatible halfway through.
Prompt:
Actually, let's skip the 'server.js' refactor for now. It's too risky.
The agent will mark that task as cancelled or remove it, and move to the next
item. This dynamic adjustment is what makes the todo system powerful—it's a
living document, not a static text block.