A simple and effective Command-Line Interface (CLI) application to manage tasks. This Task Manager allows you to add, list, complete, and remove tasks with varying priorities. Tasks are stored in a JSON file, making it easy to persist and manage your tasks over time.
- Add Tasks: Add new tasks with a priority level (Low, Medium, or High).
- List Tasks: View all tasks sorted by their priority.
- Complete Tasks: Mark tasks as completed.
- Remove Tasks: Remove tasks from the list.
- Python 3.6 or higher
click
library
-
Clone the repository:
git clone https://github.com/kanishkdhebana/Todo_CLI cd Todo_CLI
-
Install the required packages:
Install the dependencies using
pip
:pip install click
-
Make the script executable:
If you want to run the script directly:
chmod +x todo.py
-
Add alias to .bashrc or .zshrc:
Add this line to
.bashrc
or.zshrc
to create a convenient alias for the script:alias todo='python /path/to/todo.py'
Replace
/path/to/todo.py
with the actual path to thetodo.py
file. -
Reload your shell configuration:
After adding the alias, reload your shell configuration to apply the changes:
source ~/.bashrc # For bash users source ~/.zshrc # For zsh users
Once you have set up the alias, you can use the todo
command to interact with the Task Manager CLI.
To add a new task, use the add
command followed by the task description and an optional priority flag:
todo add "Buy groceries" -p h
or
todo add "Buy groceries" --priority h
This command adds a new task "Buy groceries" with High priority.
To list all tasks, use the list command:
todo list
To mark a task as complete, use the complete command followed by the task index:
todo complete 1
This will mark the first task as complete.
To remove a task, use the remove command followed by the task index:
todo remove 1
This will remove the first task from your list.
- Low (l): Tasks with low importance.
- Medium (m): Tasks with medium importance. (Default)
- High (h): Tasks with high importance.
- task_manager.py: The main Python script containing the task manager CLI.
- tasks.json: The JSON file where tasks are stored.
- File Not Found: If the tasks.json file is not found, a new file is created automatically.
- Invalid Task Index: If you try to complete or remove a task that does not exist, an error message will be displayed.
Contributions are welcome! Please feel free to submit a Pull Request or open an issue.