A command-line todo list management tool written in Java, aiming to provide lightweight, modular, and extensible task management features. Supports quick adding, viewing, editing, completing, and deleting tasks via the command line, and also supports packaging the program into a standalone .exe file.
- Core data structures built using the Java Collections Framework
- Task model designed with object-oriented principles, supporting fields such as priority, category, tags, and timestamps
- Command-driven architecture allowing users to operate tasks quickly via commands
- Clear modular separation (model layer, task management layer, command parsing layer, etc.)
- Supports future extensions: subtask system, tag search, persistent storage, customizable output formats, and more
- CLI tool as the core goal, Unix-like tool style, aiming for semantic command experience
- Add tasks
- List all tasks
- Delete tasks by task ID
- Complete tasks by task ID
- Query task details by ID
- Edit task information
- Command line help system (
helpcommand)
# View available commands
todo help
# Add a task
todo add --title "Write README" --priority 2 --category "Documentation" --description "Write a clear and structured README for the project"
# List tasks
todo list
# Show a specific task
todo show --id 3
# Edit a task
todo edit --id 3 --title "Write README.md" --priority 1
# Delete a task
todo delete --id 3
# Complete a task
todo complete --id 3- Clone the project:
git clone https://github.com/yourname/todo-cli.git
cd todo-cli- Compile the project:
javac -d out src/**/*.java- Run a command:
java -cp out Main add --title "Learn Java"- Package as
.exe(optional):
You can use tools like Launch4j or jpackage to convert the .jar into an .exe.
src/
├── model/ # Entity classes like Task, TaskStatus, etc.
├── manager/ # TaskManager, responsible for task CRUD logic
├── command/ # Parsing and dispatching various commands (e.g., AddCommand, HelpCommand)
├── parser/ # Command line argument parser
├── cli/ # CLI main program entry and dispatching
└── util/ # Time utilities, formatting utilities, etc.
- The model layer’s
Taskclass is designed with future extensibility in mind, such as adding subtasks (e.g., via aList<Task> subtasksfield or parent-child mapping) - All features are modularized, making it easy to add command aliases, custom output formats, configuration files, network sync, and more later
- The command system follows a “single-command execution then exit” pattern; the program responds to one command per run, aligning with CLI tool conventions (like
scoop,git) - Commit history maintains atomicity, each commit contains a single independent feature change for easier version tracking and rollback
-
The main branch is
main, containing only stable release versions -
Development should be done on the
devbranch, with feature branches named likefeature/xxxfor individual modules -
Commit messages should follow a standardized format, for example:
feat: add command parser frameworkfix: fix null pointer issue when deleting tasksdocs: improve command help information
MIT License. Free to use and modify.
This project is intended for learning Java Collections, CLI tool design, and object-oriented architecture. Inspiration is drawn from CLI tools like scoop, git, and npm.