Skip to content

A Go-based CLI for todo task management using Cobra. Supports adding, listing, completing, and deleting tasks with CSV persistence.

Notifications You must be signed in to change notification settings

m3hu1/golang-todo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo CLI

A simple command-line application for managing tasks using Go. This CLI app allows users to perform CRUD operations on tasks, including adding, listing, completing, and deleting tasks.

Features

  • Add new tasks
  • List all tasks (completed and uncompleted)
  • Mark tasks as complete
  • Delete tasks

Requirements

  • Go 1.16 or higher

Installation

  1. Clone the repository:

    git clone https://github.com/m3hu1/golang-todo-cli.git
  2. Navigate into the cloned repo:

    cd golang-todo-cli
  3. Install dependencies:

    go mod tidy
  4. (Optional) Build the executable:

    go build -o tasks

Usage

You can run the application using the following commands:

Add a Task

./tasks add "Your task description"

List Tasks

To list all uncompleted tasks:

./tasks list

To list all tasks (including completed ones):

./tasks list --all

Complete a Task

To mark a task as complete, use its ID:

./tasks complete <taskid>

Delete a Task

To delete a task by its ID:

./tasks delete <taskid>

Example Workflow

  1. Add tasks:

    ./tasks add "Buy groceries"
    ./tasks add "Clean the house"
  2. List tasks:

    ./tasks list
  3. Complete a task (e.g., ID 1):

    ./tasks complete 1
  4. List all tasks:

    ./tasks list --all
  5. Delete a task (e.g., ID 2):

    ./tasks delete 2

Contributing

Feel free to open issues or submit pull requests. Contributions are welcome!

About

A Go-based CLI for todo task management using Cobra. Supports adding, listing, completing, and deleting tasks with CSV persistence.

Resources

Stars

Watchers

Forks

Languages