2025-12-01 11:38:48 -08:00
|
|
|
# Todo tool (`write_todos`)
|
2025-10-22 13:27:10 -07:00
|
|
|
|
|
|
|
|
This document describes the `write_todos` tool for the Gemini CLI.
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
|
|
The `write_todos` tool allows the Gemini agent to create and manage a list of
|
|
|
|
|
subtasks for complex user requests. This provides you, the user, with greater
|
2025-11-12 10:18:15 -08:00
|
|
|
visibility into the agent's plan and its current progress. It also helps with
|
|
|
|
|
alignment where the agent is less likely to lose track of its current goal.
|
2025-10-22 13:27:10 -07:00
|
|
|
|
|
|
|
|
### Arguments
|
|
|
|
|
|
|
|
|
|
`write_todos` takes one argument:
|
|
|
|
|
|
|
|
|
|
- `todos` (array of objects, required): The complete list of todo items. This
|
|
|
|
|
replaces the existing list. Each item includes:
|
|
|
|
|
- `description` (string): The task description.
|
|
|
|
|
- `status` (string): The current status (`pending`, `in_progress`,
|
|
|
|
|
`completed`, or `cancelled`).
|
|
|
|
|
|
|
|
|
|
## Behavior
|
|
|
|
|
|
|
|
|
|
The agent uses this tool to break down complex multi-step requests into a clear
|
|
|
|
|
plan.
|
|
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
- **Progress tracking:** The agent updates this list as it works, marking tasks
|
2025-10-22 13:27:10 -07:00
|
|
|
as `completed` when done.
|
2025-12-03 15:58:40 -05:00
|
|
|
- **Single focus:** Only one task will be marked `in_progress` at a time,
|
2025-10-22 13:27:10 -07:00
|
|
|
indicating exactly what the agent is currently working on.
|
2025-12-01 11:38:48 -08:00
|
|
|
- **Dynamic updates:** The plan may evolve as the agent discovers new
|
2025-10-22 13:27:10 -07:00
|
|
|
information, leading to new tasks being added or unnecessary ones being
|
|
|
|
|
cancelled.
|
|
|
|
|
|
|
|
|
|
When active, the current `in_progress` task is displayed above the input box,
|
|
|
|
|
keeping you informed of the immediate action. You can toggle the full view of
|
|
|
|
|
the todo list at any time by pressing `Ctrl+T`.
|
|
|
|
|
|
|
|
|
|
Usage example (internal representation):
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
|
write_todos({
|
|
|
|
|
todos: [
|
|
|
|
|
{ description: 'Initialize new React project', status: 'completed' },
|
|
|
|
|
{ description: 'Implement state management', status: 'in_progress' },
|
|
|
|
|
{ description: 'Create API service', status: 'pending' },
|
|
|
|
|
],
|
|
|
|
|
});
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Important notes
|
|
|
|
|
|
2025-11-12 10:18:15 -08:00
|
|
|
- **Enabling:** This tool is enabled by default. You can disable it in your
|
|
|
|
|
`settings.json` file by setting `"useWriteTodos": false`.
|
2025-10-22 13:27:10 -07:00
|
|
|
|
2025-12-01 11:38:48 -08:00
|
|
|
- **Intended use:** This tool is primarily used by the agent for complex,
|
2025-10-22 13:27:10 -07:00
|
|
|
multi-turn tasks. It is generally not used for simple, single-turn questions.
|