|
| 1 | +# To-Do List Functionality |
| 2 | + |
| 3 | +Amazon Q CLI includes built-in to-do list functionality that allows Q to create, manage, and track multi-step tasks. This feature helps organize complex workflows and provides persistence across chat sessions. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The to-do list functionality consists of two main components: |
| 8 | + |
| 9 | +1. **`todo_list` tool** - A built-in tool that Q uses to create and manage to-do lists |
| 10 | +2. **`/todos` slash command** - User commands for viewing and managing existing to-do lists |
| 11 | + |
| 12 | +## The todo_list Tool |
| 13 | + |
| 14 | +The `todo_list` tool is automatically available to all agents and is trusted by default. Q uses this tool to: |
| 15 | + |
| 16 | +- Create structured to-do lists for multi-step tasks |
| 17 | +- Mark tasks as completed as work progresses |
| 18 | +- Track context and modified files for each task |
| 19 | +- Load and resume existing to-do lists |
| 20 | + |
| 21 | +### Tool Commands |
| 22 | + |
| 23 | +#### `create` |
| 24 | +Creates a new to-do list with specified tasks and description. |
| 25 | + |
| 26 | +**Parameters:** |
| 27 | +- `tasks` (required): Array of distinct task descriptions |
| 28 | +- `todo_list_description` (required): Brief summary of the to-do list |
| 29 | + |
| 30 | +#### `complete` |
| 31 | +Marks tasks as completed and updates context. |
| 32 | + |
| 33 | +**Parameters:** |
| 34 | +- `completed_indices` (required): Array of 0-indexed task numbers to mark complete |
| 35 | +- `context_update` (required): Important context about completed tasks |
| 36 | +- `modified_files` (optional): Array of file paths that were modified |
| 37 | +- `current_id` (required): ID of the currently loaded to-do list |
| 38 | + |
| 39 | +#### `load` |
| 40 | +Loads an existing to-do list by ID. |
| 41 | + |
| 42 | +**Parameters:** |
| 43 | +- `load_id` (required): ID of the to-do list to load |
| 44 | + |
| 45 | +#### `add` |
| 46 | +Adds new tasks to an existing to-do list. |
| 47 | + |
| 48 | +**Parameters:** |
| 49 | +- `new_tasks` (required): Array of new task descriptions |
| 50 | +- `insert_indices` (required): Array of 0-indexed positions to insert tasks |
| 51 | +- `new_description` (optional): Updated description for the to-do list |
| 52 | +- `current_id` (required): ID of the currently loaded to-do list |
| 53 | + |
| 54 | +#### `remove` |
| 55 | +Removes tasks from an existing to-do list. |
| 56 | + |
| 57 | +**Parameters:** |
| 58 | +- `remove_indices` (required): Array of 0-indexed positions of tasks to remove |
| 59 | +- `new_description` (optional): Updated description for the to-do list |
| 60 | +- `current_id` (required): ID of the currently loaded to-do list |
| 61 | + |
| 62 | +### Tool Behavior |
| 63 | + |
| 64 | +- Q automatically creates to-do lists when given multi-step tasks |
| 65 | +- Tasks are marked as completed immediately after Q finishes each step |
| 66 | +- The tool displays progress visually with checkboxes (☐ for incomplete, ■ for complete) |
| 67 | +- To-do lists are stored locally in `.amazonq/cli-todo-lists/` |
| 68 | +- Each to-do list has a unique timestamp-based ID |
| 69 | + |
| 70 | +## User Commands (/todos) |
| 71 | + |
| 72 | +Users can manage their to-do lists using the `/todos` slash command with various subcommands. |
| 73 | + |
| 74 | +### `/todos resume` |
| 75 | + |
| 76 | +Allows you to select and resume work on an existing to-do list. Q will load the selected list and continue working on incomplete tasks. |
| 77 | + |
| 78 | +**Usage:** |
| 79 | +``` |
| 80 | +/todos resume |
| 81 | +``` |
| 82 | + |
| 83 | +This opens an interactive selector showing all available to-do lists with their completion status. |
| 84 | + |
| 85 | +### `/todos view` |
| 86 | + |
| 87 | +View the contents of a to-do list without resuming work on it. |
| 88 | + |
| 89 | +**Usage:** |
| 90 | +``` |
| 91 | +/todos view |
| 92 | +``` |
| 93 | + |
| 94 | +This opens an interactive selector and displays the selected to-do list with all tasks and their completion status. |
| 95 | + |
| 96 | +### `/todos delete` |
| 97 | + |
| 98 | +Delete one or more to-do lists. |
| 99 | + |
| 100 | +**Usage:** |
| 101 | +``` |
| 102 | +/todos delete # Delete a single selected to-do list |
| 103 | +/todos delete --all # Delete all to-do lists |
| 104 | +``` |
| 105 | + |
| 106 | +### `/todos clear-finished` |
| 107 | + |
| 108 | +Remove all completed to-do lists (where all tasks are marked as complete). |
| 109 | + |
| 110 | +**Usage:** |
| 111 | +``` |
| 112 | +/todos clear-finished |
| 113 | +``` |
| 114 | + |
| 115 | +## Storage and Persistence |
| 116 | + |
| 117 | +### Local Storage |
| 118 | +To-do lists are stored locally in the current working directory under: |
| 119 | +``` |
| 120 | +.amazonq/cli-todo-lists/ |
| 121 | +``` |
| 122 | + |
| 123 | +Each to-do list is saved as a JSON file named with its unique ID (e.g., `1693234567890.json`). |
| 124 | + |
| 125 | +### Data Structure |
| 126 | +Each to-do list contains: |
| 127 | +- **tasks**: Array of task descriptions |
| 128 | +- **completed**: Array of boolean values indicating completion status |
| 129 | +- **description**: Brief summary of the to-do list |
| 130 | +- **context**: Array of context updates from completed tasks |
| 131 | +- **modified_files**: Array of file paths that were modified during task execution |
| 132 | +- **id**: Unique identifier for the to-do list |
| 133 | + |
| 134 | +### Conversation Integration |
| 135 | +To-do list IDs are automatically included in conversation summaries, allowing Q to resume work on to-do lists when conversations are loaded from history. |
| 136 | + |
| 137 | +## Best Practices |
| 138 | + |
| 139 | +### For Users |
| 140 | +- Use `/todos resume` to continue work on incomplete tasks |
| 141 | +- Regularly use `/todos clear-finished` to clean up completed lists |
| 142 | +- Use `/todos view` to check progress without resuming work |
| 143 | + |
| 144 | +### For Q's Usage |
| 145 | +- Create to-do lists for any multi-step task before beginning work |
| 146 | +- Mark tasks as completed immediately after finishing each step |
| 147 | +- Provide meaningful context updates when completing tasks |
| 148 | +- Track modified files to maintain a record of changes |
| 149 | + |
| 150 | +## Example Workflow |
| 151 | + |
| 152 | +1. User asks Q to implement a new feature |
| 153 | +2. Q creates a to-do list with steps like: |
| 154 | + - Analyze requirements |
| 155 | + - Create necessary files |
| 156 | + - Implement core functionality |
| 157 | + - Add tests |
| 158 | + - Update documentation |
| 159 | +3. Q works through tasks, marking each as complete with context |
| 160 | +4. User can check progress with `/todos view` |
| 161 | +5. If interrupted, user can resume with `/todos resume` |
| 162 | +6. When finished, user can clean up with `/todos clear-finished` |
| 163 | + |
| 164 | +## Limitations |
| 165 | + |
| 166 | +- To-do lists are stored locally and not synchronized across different working directories |
| 167 | +- The interactive selectors require terminal support for user input |
| 168 | +- Very long task descriptions may be truncated in the display |
| 169 | +- No built-in backup or export functionality for to-do lists |
0 commit comments