Skip to content

Task CLI, A simple command-line tool built in Go for managing tasks. Add, list, complete, and delete tasks with data stored in a JSON file. Perfect for lightweight task management!

License

Notifications You must be signed in to change notification settings

Prajwal-kp-18/learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Task CLI

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.

Features

  • Add new tasks with a title.
  • List all tasks with their status (completed or not).
  • Mark tasks as completed.
  • Delete tasks.

Prerequisites

  • Go installed on your system (version 1.16 or later).

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_folder>
  2. Build the application:

    go build -o learn
  3. Move the binary to a directory in your PATH for easy access (optional):

    mv learn /usr/local/bin/

Usage

General Command Format

learn <command> [arguments]

Commands

  1. Add a Task Add a new task by specifying its title:

    learn add "Task title"

    Example:

    learn add "Buy groceries"
  2. List All Tasks Display all tasks along with their statuses (completed or not):

    learn list
  3. Mark a Task as Completed Mark a specific task as completed by its ID:

    learn complete <task_id>

    Example:

    learn complete 1
  4. Delete a Task Delete a specific task by its ID:

    learn delete <task_id>

    Example:

    learn delete 1

Example Workflow

  1. Add tasks:

    learn add "Read a book"
    learn add "Write Go code"
  2. List tasks:

    learn list

    Output:

    1. Read a book [❌]
    2. Write Go code [❌]
    
  3. Mark the first task as completed:

    learn complete 1
  4. List tasks again:

    learn list

    Output:

    1. Read a book [✅]
    2. Write Go code [❌]
    
  5. Delete a task:

    learn delete 2

File Structure

  • 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.

Error Handling

  • If an invalid task ID is provided for complete or delete commands, the application will notify you that the task was not found.
  • If no tasks are present, the list command will notify you accordingly.

Contribution

Feel free to fork the repository, submit issues, and make pull requests. Contributions are always welcome!

License

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

Author

Prajwal-kp-18

About

Task CLI, A simple command-line tool built in Go for managing tasks. Add, list, complete, and delete tasks with data stored in a JSON file. Perfect for lightweight task management!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages