Skip to content

dohu012/tasks_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Task Tracker CLI

A simple command-line task tracker built with Python. Add, update, delete, and track tasks from your terminal, with data persisted in a local JSON file.

This project is an implementation of the Task Tracker challenge from roadmap.sh.

Features

  • Add, update, and delete tasks
  • Mark tasks as in-progress or done
  • List all tasks, or filter by status (todo, in-progress, done)
  • All data persisted to a local tasks.json file
  • No external dependencies — uses only the Python standard library

Requirements

  • Python 3.7+

No installation needed. Just clone and run.

Usage

# Add a new task
python task_cli.py add "Buy groceries"
# Output: Task added successfully (ID: 1)

# Update a task
python task_cli.py update 1 "Buy groceries and cook dinner"

# Delete a task
python task_cli.py delete 1

# Mark task status
python task_cli.py mark-in-progress 1
python task_cli.py mark-done 1

# List tasks
python task_cli.py list                 # all tasks
python task_cli.py list todo            # only todo
python task_cli.py list in-progress     # only in-progress
python task_cli.py list done            # only done

Task Structure

Each task is stored with the following fields:

Field Description
id Auto-incrementing unique identifier
description Task description
status One of todo, in-progress, done
createdAt ISO 8601 creation timestamp
updatedAt ISO 8601 last-update timestamp

Data Storage

Tasks are stored as a JSON array in tasks.json in the current working directory. The file is created automatically on the first add command.

Example tasks.json:

[
  {
    "id": 1,
    "description": "Buy groceries",
    "status": "todo",
    "createdAt": "2026-05-27T10:00:00",
    "updatedAt": "2026-05-27T10:00:00"
  }
]

Error Handling

The CLI handles common error cases gracefully:

  • Missing arguments → usage hint
  • Non-numeric IDs → clear error message
  • Non-existent task IDs → Task not found
  • Unknown commands or statuses → error message

Project Structure

task-tracker/
├── task_cli.py    # Main CLI script
├── tasks.json     # Auto-generated data file (gitignored)
└── README.md

License

MIT

About

A simple CLI task tracker built with Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages