A command-line to-do application built with Go and SQLite for managing tasks. This application allows you to add, update, delete, and view tasks directly from the terminal. It uses an SQLite database to store the tasks persistently.
- Add a new task.
- View all tasks.
- Update task status (mark as complete).
- Delete a task.
- Clear the terminal screen.
- Exit the application.
Before running the application, make sure you have the following installed on your system:
- Go (version 1.16 or later)
- SQLite (SQLite is included via the
modernc.org/sqlitepackage for Go, but you may want the SQLite CLI for manual database management)
git clone https://github.com/yourusername/todo_cli.git
cd todo_cligo mod tidygo run main.goThe app will automatically connect to an SQLite database (todo_cli.db) and create a todo table to store your tasks.
Once the application is running, you will be presented with the following options:
- View all tasks: Displays a list of all tasks in the database.
- Add a new task: Allows you to add a new task to the list.
- Update task status: Marks a specific task as completed.
- Delete a task: Removes a task from the list.
- Clear terminal: Clears the terminal screen.
- Exit: Exits the application.
Enter a number to continue: 1 - view todos, 2-add, 3-update, 4-delete, 5-clear, 6-exit- 1: View all tasks.
- 2: Add a new task.
- 3: Update a task (mark as completed).
- 4: Delete a task.
- 5: Clear the terminal screen.
- 6: Exit the application.
Enter a number to continue: 1 - view todos, 2-add, 3-update, 4-delete, 5-clear, 6-exit
2
Enter a task to add: Buy groceries
success
Enter a number to continue: 1 - view todos, 2-add, 3-update, 4-delete, 5-clear, 6-exit
1
Todo's:
{1 Buy groceries false}- The tasks are stored in an SQLite database (
todo_cli.db). - A
todotable is created with columns forid,task, andstatus. - The status column indicates whether the task is completed (
true) or pending (false).
- Fork the repository.
- Create a new branch (
git checkout -b feature-name). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-name). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.