- 🍀 Task Management: Add, delete, edit, and list all sorts of different tasks.
- 🍀 Multithreaded Persistent Storage: Everything can be saved to
tasks.datand it is then loaded on start. Thesavecommand usespthreadto save in the background, so you can keep working. - 🍀 Task Details: Add notes, priority status, due dates, and tags to each task.
- 🍀 Dependencies: Define task dependencies (e.g., Task 1 must be done before Task 2, which has to be done before Task 4, etc.).
- 🍀 Sorting: Sort your list by name, priority, or due date.
- 🍀 Searching: Full-text search on descriptions/notes, or find tasks by a specific tag.
- 🍀 Safe & Dynamic: All data is dynamically allocated using
malloc/realloc, withpthread_mutex_tlocks to ensure thread safety.
gcc task_manager.c task.c -o task_manager -pthread # POSIX threads library here as well
./task_manager #Linux,MacOs
./task_manager.exe #Windowsadd <description>- Add a regular priority taskp-add <description>- Add a high priority tasklist- Display all tasks with formatted outputview <id>- Show detailed information about a specific taskdone <id>- Mark a task as completed (with dependency checking)edit <id> <new description>- Modify a task's descriptionnote <id> <note text>- Add or update notes for a taskdelete <id>- Remove a task and update dependencies
due <id> <YYYY-MM-DD>- Set a due date for a tasktag <id> <tag>- Add a tag to a taskuntag <id> <tag>- Remove a tag from a taskfindtag <tag>- Find all tasks with a specific tagdepend <id1> <id2>- Make task id1 depend on task id2sort <name|pri|date>- Sort tasks by different criteriafind <term>- Search for tasks by text in description or notes
save- Save all tasks to file in the backgroundconfig color <on|off>- Enable or disable color outputhelp- Display the complete command menuquit- Exit the program
The task manager uses pthread_mutex_t locks to ensure thread-safe operations across all functions. The main data structure (TaskList) contains a mutex that protects access to the task array and all task data.
- All strings are dynamically allocated using
malloc/realloc - Memory is properly freed when tasks are deleted or the program exits
- Helper functions like
safe_strdup()handle both allocation and reallocation safely
- Tasks are saved to
tasks.datin a structured text format - The save operation runs in a background thread to avoid blocking the main program
- Configuration settings (like color preferences) are also persisted
The save file uses a pipe-delimited (|) format with comma-separated lists for arrays:
status|due_date|dep_count|dep1,dep2|tag_count|tag1,tag2|description|notes
The system supports optional color output for better visual distinction:
- Red for high priority tasks
- Green for completed tasks
- Yellow for due dates
- Cyan for tags
- Gray for completed task text
Color output can be toggled with config color on/off(probaly works still i think).
The system implements a dependency graph where tasks can depend on other tasks being completed first. When marking a task as complete, the system checks all dependencies and warns if any are incomplete. Users can override this check if needed.
Tasks can be sorted by three different criteria:
- Name - Alphabetical order by description
- Priority - High priority tasks first, then by name
- Due Date - Earliest dates first, tasks without dates go to the end
Two search methods are available:
- Full-text search (
find) - Searches both descriptions and notes - Tag search (
findtag) - Finds tasks by specific tags
Each task contains:
- Description - The main task text
- Notes - Optional additional information
- Status flags - Completion status and priority level
- Due date - Optional deadline (Unix timestamp)
- Tags - Array of string tags for categorization
- Dependencies - Array of task IDs that must be completed first
The save operation uses a separate thread to avoid blocking the main command loop. This allows users to continue working while their data is being saved in the background. The mutex ensures that the save thread has exclusive access to the data during the save operation.
Copyright © 2026 Je0Dev
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.