A powerful, elegant command-line todo list manager built with Java and Maven. Keep track of your tasks, mark them complete, and manage your productivity directly from your terminal!
- ๐ Add Tasks - Quickly create new todos with a simple command
- ๐ View Active Tasks - Display all your pending tasks at a glance
- โ Mark as Complete - Archive completed tasks without deleting them
- ๐๏ธ Delete Tasks - Permanently remove tasks you no longer need
- ๐ View Completed Tasks - Review your accomplishments in a separate list
- ๐พ Persistent Storage - All tasks are automatically saved in JSON format
- ๐ค User Profiles - Personalized experience with user registration
- ๐ Smart Renumbering - Tasks are automatically renumbered after modifications
- ๐ฏ Intuitive Interface - Clean, menu-driven interface for easy navigation
- ๐ณ Docker Support - Run anywhere with Docker containerization
- ๐ CI/CD Pipeline - Automated builds and deployments with GitHub Actions
- Java - Core programming language
- Maven - Dependency management and build tool
- Gson - JSON serialization/deserialization
- Docker - Containerization platform
- GitHub Actions - CI/CD automation
- Java 17 or higher
- Maven 3.8+
- Docker Desktop installed
- Docker Hub account (for CI/CD)
-
Clone the repository
git clone https://github.com/NeonWest/ToDoList-CLI.git cd ToDoList-CLI -
Build the project
mvn clean install
-
Run the application
mvn exec:java -Dexec.mainClass="com.omar.todo.TodoMain"
-
Clone the repository
git clone https://github.com/NeonWest/ToDoList-CLI.git cd ToDoList-CLI -
Build and run with Docker
docker build -t todo-cli . docker run -it --rm -v $(pwd)/data:/app/data todo-cli
-
Or use Docker Compose
docker-compose up --build
Then in another terminal:
docker attach todo-app
-
Pull from Docker Hub (after CI/CD setup)
docker pull <your-dockerhub-username>/todo-cli:latest docker run -it --rm -v $(pwd)/data:/app/data <your-dockerhub-username>/todo-cli:latest
Add to your ~/.zshrc or ~/.bashrc:
alias runtodo="docker run -it --rm -v $(pwd)/data:/app/data todo-cli"Then simply run:
runtodoWhen you launch the application, you'll see an interactive menu:
---To Do Cli Application---
Options:
1: Add a new task
2: Show your tasks
3: Delete a task
4: Mark task as complete
5: View completed tasks
6: Quit
- Select option
1 - Enter your task description
- Task is automatically numbered and saved
- Select option
2 - All incomplete tasks are displayed with their numbers
- Completed tasks are hidden from this view
- Select option
3 - Enter the task number you want to delete
- Task is permanently removed and remaining tasks are renumbered
- Select option
4 - Enter the task number to mark as done
- Task is archived but not deleted
- Task becomes unnumbered and moves to completed list
- Select option
5 - All completed tasks are displayed with checkmarks
- These tasks don't show numbers (archived state)
Select option 6 to quit the application
todo-cli/
โโโ .github/
โ โโโ workflows/
โ โโโ docker-build.yml # CI/CD pipeline
โโโ src/
โ โโโ main/
โ โโโ java/
โ โโโ com/
โ โโโ omar/
โ โโโ todo/
โ โโโ TodoMain.java # Main application entry
โ โโโ UserData.java # User data model
โ โโโ Todoformat.java # Todo item model
โ โโโ JsonEditor.java # JSON operations
โโโ data/
โ โโโ todolist.json # Data storage (auto-generated)
โโโ Dockerfile # Docker build instructions
โโโ docker-compose.yml # Docker Compose configuration
โโโ .dockerignore # Docker ignore rules
โโโ pom.xml # Maven configuration
โโโ README.md
- Multi-stage build for optimized image size
- Stage 1: Maven build environment
- Stage 2: Lightweight JRE runtime (Alpine-based)
- Persistent data storage via volumes
- Todo data is stored in
/app/data/todolist.jsoninside the container - Volume mount
-v $(pwd)/data:/app/dataensures data persists on your host machine - Your tasks survive container restarts and removals
Every push to main or master branch triggers:
- โ Code checkout
- โ Java 17 setup
- โ Maven build
- โ Docker image creation
- โ
Push to Docker Hub with two tags:
latest- always points to the newest version<commit-sha>- specific version for rollbacks
- Fork/clone this repository
- Create a Docker Hub account
- Generate Docker Hub access token (Settings โ Security โ New Access Token)
- Add secrets to GitHub repository:
- Go to Settings โ Secrets and variables โ Actions
- Add
DOCKER_USERNAME(your Docker Hub username) - Add
DOCKER_PASSWORD(your Docker Hub access token)
- Push to trigger the workflow
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>---To Do Cli Application---
Please enter your name for registration
> Omar
Options:
1: Add a new task
2: Show your tasks
3: Delete a task
4: Mark task as complete
5: View completed tasks
6: Quit
> 1
Please enter the task:
> Buy groceries
Task added successfully!
> 2
Your Tasks:
1. Buy groceries
2. Finish project
3. Call dentist
> 4
Which task is completed? (ID):
> 2
Task marked as complete!
> 5
Completed Tasks:
โ Finish project
- Active tasks are numbered sequentially (1, 2, 3...)
- Completed tasks become unnumbered (archived state)
- Automatic renumbering keeps your list clean after deletions
- All tasks are saved to
todolist.jsonautomatically - Your data persists between sessions and container restarts
- First-time users are prompted to register their name
- Invalid inputs are caught and user is prompted to retry
- Task IDs are verified before operations
- Helpful error messages guide the user
- Consistency - Runs the same everywhere
- Portability - Share via Docker Hub
- Isolation - No dependency conflicts
- Easy deployment - One command to run
- Edit existing tasks
- Task priorities (high, medium, low)
- Due dates and reminders
- Categories/tags for organization
- Search functionality
- Sort and filter options
- Export to different formats (CSV, PDF)
- Undo/redo functionality
- Recurring tasks
- Unit tests integration
- Kubernetes deployment manifests
- Helm charts
- Multi-architecture Docker builds (ARM64 support)
- Automated testing in CI pipeline
- Code coverage reports
Contributions are welcome! Feel free to submit issues and pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Container exits immediately: Ensure you're using
-itflag for interactive mode - Data not persisting: Check volume mount path is correct
- Permission errors: Ensure Docker has access to the data directory
- Maven build fails: Verify Java 17+ is installed
- Docker build fails: Check Dockerfile syntax and base image availability
This project demonstrates:
- Java CLI application development
- Maven dependency management
- Docker containerization (multi-stage builds)
- Docker Compose orchestration
- GitHub Actions CI/CD pipelines
- Volume management for data persistence
Omar Atakishiyev
- GitHub: @NeonWest
โญ If you find this project useful, please consider giving it a star!
Built with โ and Java | Containerized with ๐ณ