Task Manager CLI
π Overview
This is a simple command-line interface (CLI) task manager written in Go. It allows users to manage their daily tasks quickly and efficiently directly from the terminal. Tasks are stored in a JSON file (data.json), making the data portable and easy to read.
π How to Use
π οΈ Available Commands
tkm add <description> or tkm a <description>: Adds a new task to your list. The description must be provided in double quotes if it contains spaces. The task is created with a "todo" status.
tkm list or tkm l: Lists all tasks.
- Flags to filter the list:
--todo: Lists only tasks with "todo" status.
--done: Lists only tasks with "done" status.
--in-progress: Lists only tasks with "in-progress" status.
tkm update <id> <new_description> or tkm u <id> <new_description>: Updates the description of a task based on its ID.
tkm mark <id> --done or tkm m <id> --done: Marks a task as "done".
tkm mark <id> --in-progress or tkm m <id> --in-progress: Marks a task as "in-progress".
tkm delete <id> or tkm d <id>: Deletes a task based on its ID.
π Examples
Here are some examples of how to run the commands:
-
Adding a new task:
tkm add "Study for the Go exam"
-
Listing all tasks:
tkm list
-
Listing only 'todo' tasks:
tkm list --todo
-
Marking a task as 'done':
tkm mark 1 --done
-
Updating a task's description:
tkm update 1 "Study Go for the final project"
-
Deleting a task:
tkm delete 2
π§ Installation
To install this CLI, you must have Go installed on your system.
One-line installation:
Manual Installation:
-
Clone the repository to your local machine:
git clone https://github.com/louis0113/tkm.git
cd tkm
-
Build the executable file:
go build -o tkm
-
(Optional) Move the executable to a directory in your system's PATH to run the command from any location:
# For Linux/macOS
sudo mv tkm /usr/local/bin/
# For Windows, move the .exe file to a directory in your PATH manually.
π Data Structure
Tasks are stored in a JSON file in the following format:
[
{
"id": 1,
"desc": "Study Go for the project",
"status": "in-progress",
"createdAt": "2025-08-06T21:57:05.123456Z",
"updateAt": "2025-08-07T09:28:05.123456Z"
},
{
"id": 2,
"desc": "Go grocery shopping",
"status": "todo",
"createdAt": "2025-08-07T09:28:05.123456Z"
}
]