Task CLI is a simple command-line interface application written in Go that allows users to manage tasks. You can add, list, complete, and delete tasks, with all data stored in a JSON file for persistence.
- Add new tasks with a title.
- List all tasks with their status (completed or not).
- Mark tasks as completed.
- Delete tasks.
- Go installed on your system (version 1.16 or later).
-
Clone the repository:
git clone <repository_url> cd <repository_folder>
-
Build the application:
go build -o learn
-
Move the binary to a directory in your PATH for easy access (optional):
mv learn /usr/local/bin/
learn <command> [arguments]
-
Add a Task Add a new task by specifying its title:
learn add "Task title"
Example:
learn add "Buy groceries"
-
List All Tasks Display all tasks along with their statuses (completed or not):
learn list
-
Mark a Task as Completed Mark a specific task as completed by its ID:
learn complete <task_id>
Example:
learn complete 1
-
Delete a Task Delete a specific task by its ID:
learn delete <task_id>
Example:
learn delete 1
-
Add tasks:
learn add "Read a book" learn add "Write Go code"
-
List tasks:
learn list
Output:
1. Read a book [❌] 2. Write Go code [❌]
-
Mark the first task as completed:
learn complete 1
-
List tasks again:
learn list
Output:
1. Read a book [✅] 2. Write Go code [❌]
-
Delete a task:
learn delete 2
- tasks.json: The application stores task data in a
tasks.json
file in the current directory. If the file does not exist, it will be created automatically.
- If an invalid task ID is provided for
complete
ordelete
commands, the application will notify you that the task was not found. - If no tasks are present, the
list
command will notify you accordingly.
Feel free to fork the repository, submit issues, and make pull requests. Contributions are always welcome!
This project is licensed under the MIT License. See the LICENSE file for details.
Prajwal-kp-18