A simple C++ task tracker application that allows you to manage your tasks through a command-line interface. It supports adding, updating, deleting, marking tasks as done or in-progress, and listing tasks. The task data is stored in a JSON file (tasks.json), which is automatically created if it doesn't exist.
- Add new tasks
- Update task descriptions
- Delete tasks
- Mark tasks as "in-progress" or "done"
- List all tasks or filter by status
- Tasks are stored in a JSON file for persistence
- C++11 or later
- CMake for building the project
- The nlohmann/json library for JSON manipulation
https://roadmap.sh/projects/task-tracker
-
Install C++ tools:
On Ubuntu or other Debian-based systems, install the required tools with:
sudo apt update sudo apt install cmake g++ make
-
Set up the nlohmann/json library:: The nlohmann/json library is used to handle JSON data in the project. Follow these steps to manually include the library:
- Download the json.hpp file from the official GitHub repository:
wget https://raw.githubusercontent.com/nlohmann/json/develop/single_include/nlohmann/json.hpp -P include/nlohmann/
This command downloads the json.hpp file inside your root project. Ensure that your project's include directory is correctly set up for the compiler to find the file.
-
Clone the repository:
git clone https://github.com/AlexisF27/task-tracker.git cd task-tracker -
Create a build directory:
mkdir build cd build -
Create a build directory:
cmake .. make
-
Run the application: After building the project, the task_tracker executable will be available in the build directory:
./task_tracker
Once the application is running, you can use the following commands to interact with the task manager.
- Add a task:
./task_tracker add "Task description" - Update a task:
./task_tracker update <Task ID> "New task description"
- Delete a task:
./task_tracker delete <Task ID>
- Mark a task as in-progress:
./task_tracker mark-in-progress <Task ID>
- Mark a task as done:
./task_tracker mark-done <Task ID>
- List all tasks:
./task_tracker list
- List tasks with a specific filter (e.g., by status):
Where can be "in-progress", "done", etc.
./task_tracker list <status>
- Add a task:
./task_tracker add "Complete homework" - List all tasks:
./task_tracker list
- Update the task with ID 1:
./task_tracker update 1 "Complete math homework" - Mark the task with ID 1 as done:
./task_tracker mark-done 1
- List tasks with a specific status (e.g., "in-progress"):
./task_tracker list "in-progress" - Delete the task with ID 1:
./task_tracker delete 1