Skip to content

Implement CLI commands (add, list, done, remove) #2

@sharpHL

Description

@sharpHL

Goal

Wire up the CLI argument parser and connect to the storage module.

Acceptance Criteria

  • task add "text" — adds a new task
  • task list — shows all tasks with status
  • task done <id> — marks task as complete
  • task remove <id> — deletes a task
  • Helpful error messages for invalid input
  • Unit tests for argument parsing

Technical Notes


Status: 🟢 Complete — PR pending

Current Context

  • Branch: feat/2-cli-commands
  • Last session: 2026-03-03 17:50 GMT+8
  • Working on: Done, awaiting PR merge

Completed

  • src/cli.js — full CLI with add, list, done, remove, help commands
  • src/cli.test.js — 13 tests, all passing
  • Error handling for missing args, invalid IDs, unknown commands
  • All 22 tests pass (store + cli combined)

Decisions Made

  • No external arg parser — process.argv.slice(2) + switch is sufficient for 4 commands
  • done command toggles (not just marks done) — more useful for correcting mistakes
  • Checkmark in list output for visual clarity

Gotchas

  • None

Next Session Start Here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions