Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-task-tracker

go-task-tracker is a small, interactive command-line task manager written in Go. It provides a REPL-style CLI to create, update, delete, list, and change the status of tasks. All tasks are persisted in a JSON file named data.json in the current working directory.

This repository contains the source code for the CLI and is intended for learning and small personal uses.

Quick highlights

  • Interactive REPL-style CLI (type commands at the prompt)
  • Persisted to data.json in the current directory
  • Simple task model: id, description, status, created_at, updated_at

Prerequisites

  • Go toolchain (go 1.16+ should work)

Build and run

  1. Run without building (for development):
go run .
  1. Build a standalone binary and run it:
go build -o task-cli .
./task-cli

When started the program prints a short help text and shows a prompt task-cli:. Enter commands described below.

Basic usage (interactive) Type the commands at the task-cli: prompt. The CLI is not a one-shot command runner; it reads commands from stdin in a loop until you type exit.

Supported commands

  • add "Task description"

    • Create a new task. New tasks default to status todo and will receive a numeric ID.

    • Example:

      add "Buy groceries"

  • update "New description"

    • Update the description for the task with the given ID. updated_at will be set when you update.

    • Example:

      update 1 "Buy groceries and cook dinner"

  • delete

    • Remove the task with the given ID from the list.

    • Example:

      delete 1

  • mark-in-progress

    • Set the status of the task to in-progress.

    • Example:

      mark-in-progress 2

  • mark-done

    • Set the status of the task to done.

    • Example:

      mark-done 2

  • list

    • List all tasks.

    • Example:

      list

  • list

    • List tasks filtered by status. Valid statuses: todo, in-progress, done.

    • Example:

      list done

  • show

    • Show the task with the given ID in a compact formatted view.

    • Example:

      show 3

  • exit

    • Quit the application.

Example interactive session

$ go run .
Welcome to our task manager: you are able to perform the following operations:
  1. Add, Update and Delete tasks
  2. Mark a task as in progress or done
  3. List all the tasks
  4. List all the tasks that are done
  5. List all the tasks that are not done
  6. List all the tasks that are in progress

Here are some examples on how to use this app:
> add "Buy groceries"
Task added successfully: (ID: 1)
Successfully saved data to the file

> list
[
{
    id: 1
    description: Buy groceries
    status: todo
    createdAt: 2026-06-04 12:34:56 +0000 UTC
    updatedAt: 0001-01-01 00:00:00 +0000 UTC
}
]

> mark-in-progress 1
Task status was updated successfully
Successfully saved data to the file

> update 1 "Buy groceries and cook dinner"
Task updated successfully...
Successfully saved data to the file

> exit

Data file

  • The application stores tasks in data.json in the current working directory. The file is created automatically if it doesn't exist.
  • JSON shape (fields):
[
  {
    "id": 1,
    "description": "Buy groceries",
    "status": "todo",
    "created_at": "2026-06-04T12:34:56Z",
    "updated_at": "0001-01-01T00:00:00Z"
  }
]

Notes and limitations

  • The CLI is intentionally small and simple. It is a single-process REPL that reads and writes data.json directly; there is no file locking or concurrent-run protection. Do not run multiple instances against the same file concurrently.
  • Input parsing is simple: commands are recognized by prefix and arguments are split by spaces. For the description arguments use double quotes as shown in examples.

Reference

License

  • This project is provided as-is for learning purposes.

About

Task tracker in Go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages