Skip to content

nirmit27/todo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo CLI 📝

Gophers

This is a lightweight, terminal-based task management application built with Go. It allows you to add, update, delete, and list tasks using simple commands. The tasks are written into and read from a JSON file for persistence.

This is a sample solution for the task-tracker project from roadmap.sh projects.

Features

  • Add tasks with descriptions. 📝
  • Update tasks by their ID. ✍️
  • Delete tasks by their ID. 🗑️
  • Mark tasks as in-progress or done. ☑️
  • List tasks, optionally filtered by status (todo, in-progress, done). 📃
  • Tasks are stored in a tasks.json file in the current directory. 📁

Installation

1. Clone the Repository

git clone https://github.com/nirmit27/todo-cli.git
cd todo-cli

2. Build the Executable

Run the following command to build the executable:

go build -o todo-cli

This will create an executable file named todo-cli in the current directory.

Usage

The task-cli application supports the following commands:

1. Add a Task

Add a new task with a description.

./todo-cli add "<description>"

Output:

Task added successfully! ID : n

2. Update a Task

Update the description of an existing task by its ID.

./todo-cli update <id> "<new description>"

Output:

Task [n] updated successfully!

3. Delete a Task

Delete a task by its ID.

./todo-cli delete <id>

Output:

Task [n] deleted successfully!

4. Mark a Task as todo, in-progress or done

Update the status of a task by its ID.

./todo-cli mark <id> <new-status>

5. View Task details

Get the detailed view of a task by its ID.

./todo-cli details <id>

Output:

 --- Task [<id>] ---

 Description : <description>
 Status : <status>
 Created at : <time-of-creation>
 Updated at : <time-of-updation>

6. List All Tasks

List all the tasks stored in the JSON file.

./todo-cli list

7. List Tasks by Status

List tasks filtered by their status (todo, in-progress, or done).

./todo-cli list <status>

Dependencies

This application is built using only Go's standard library. No external libraries are required.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Languages