Project from roadmap.sh built using Go.
Create a simple TODO application that allows users to manage tasks efficiently. Each task includes an ID, subject, creation date, and last updated timestamp. The application stores tasks in a .json file, ensuring persistence across sessions.
- Clone this repo
git clone [email protected]:rltran-codex/mytask-cli.git
cd mytask-cli
- Build the application
go build -o task-cli.exe
go build -o task-cli
On the first usage or absence of appdata folder, the application will
initialize a new tasks.json
file.
Run the application from the command line.
> task-cli
Usage:
task-cli <command> [options]
Available commands:
add Add a new task
update Update an existing task
delete Delete a task
list List tasks based on criteria
Use 'task-cli <command> -h' for more information on a specific command.
> task-cli add -h
Usage of add:
-subj string
REQUIRED. Define the new task's subject.
Example
> task-cli add -subj "Buy groceries"
> task-cli update -h
Usage of update:
-id int
REQUIRED. Update task with id. (default -1)
-stat string
OPTIONAL. Update task's status.
-subj string
OPTIONAL. Update task's subject.
Example
> task-cli update -id 1 -stat "in-progress"
> task-cli update -id 1 -stat "done"
> task-cli update -id 1 -subj "Buy groceries and cook dinner"
> task-cli delete -h
Usage of delete:
-id int
REQUIRED. Delete task with id. (default -1)
Example
> task-cli delete -id 1
> task-cli list -h
Usage of list:
-stat string
OPTIONAL. List all tasks with specified status.
Example
> task-cli list
> task-cli list -stat "done"
> task-cli list -stat "todo"
> task-cli list -stat "in-progress"