Skip to content

Task Manager CLI with GoLang and SQLite ๐Ÿ“Ÿ

License

Notifications You must be signed in to change notification settings

DulanHewage/go-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Task Manager CLI with GoLang and SQLite ๐Ÿ“Ÿ

The Task Manager CLI is a command-line interface (CLI) tool built with GoLang. Users can add, view, update, and delete tasks, all of which are stored in a SQLite database.

Features

  • Add Task: Add a new task with a title and description.
  • List Tasks: View all tasks with details.
  • Update Task: Modify existing tasks.
  • Delete Task: Remove a task from the list.
  • Mark as Done: Mark a task as completed.
  • Search Tasks: Search tasks by keyword.

Directory Structure

  • cmd/: Contains Go files for different commands (add, list, update, etc.).
  • db/: Manages database connection and migrations.
  • models/: Defines the Task model and related database operations.
  • main.go: The entry point of the application.

Getting Started

Prerequisites

  • Go 1.21.2 or later
  • SQLite

Installation

  1. Clone the repository:

    git clone https://github.com/dulanhewage/go-task.git
    cd go-task
  2. Install dependencies:

    go mod tidy
  3. Build the project:

    go build -o go-task

Run tests

Run all tests:

go test ./cmd/...

Run a specific test file:

go test ./cmd/add_test.go

Run tests with verbose output:

go test -v ./cmd/...

Usage

After building the project, you can use the CLI tool by running the generated binary:

./go-task --help

Example

Here is an example of how to use the Task Manager CLI:

  1. Add a new task:
./go-task add --title "Buy groceries" --description "Milk, Bread, Eggs"
  1. List all tasks:
./go-task list
  1. Update a task:
./go-task update --id 1 --title "Buy groceries and fruits" --description "Milk, Bread, Eggs, Apples"
  1. Mark a task as completed:
./go-task complete --id 1
  1. Search tasks by keyword:
./go-task search --keyword "groceries"
  1. Delete a task:
./go-task delete --id 1

About

Task Manager CLI with GoLang and SQLite ๐Ÿ“Ÿ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages