A simple and efficient command-line task management tool built with Go. Manage your tasks with full CRUD operations directly from your terminal.
- β Add tasks - Quickly add new tasks to your list
- π List tasks - View all tasks or filter by status
- β Complete tasks - Mark tasks as done
- ποΈ Delete tasks - Remove tasks and auto-resequence IDs
- πΎ CSV storage - Simple file-based storage
- β° Time tracking - See when tasks were created with relative time
- Go 1.18+ - Download Go
- Git - For cloning the repository
-
Clone the repository:
git clone https://github.com/ceckles/GO-Task-Cli.git cd GO-Task-Cli -
Install dependencies:
go mod download
-
Build the project:
go build -o task
-
Install globally (optional):
# Linux/macOS sudo mv task /usr/local/bin/ # Or add to your PATH export PATH=$PATH:$(pwd)
You can run the tool directly without building:
go run main.go [command]List all tasks (short view):
task list
# or
go run main.go listList all tasks with full details:
task list -a
# or
go run main.go list -aAdd a new task:
task add "Complete the project documentation"
# or
go run main.go add "Complete the project documentation"Mark a task as complete:
task complete 1
# or
go run main.go complete 1Delete a task:
task delete 1
# or
go run main.go delete 1Show help:
task --help
task [command] --helpList all tasks. By default shows a short view (ID, Task, Created time). Use the -a or --all flag to see all details including completion status.
task list # Short view
task list -a # Full view with all details
task list --all # Same as -aAdd a new task to your list. The task will be assigned an auto-incremented ID.
task add "Your task description here"Example:
$ task add "Review pull request #42"
Task added: Review pull request #42Mark a task as complete by providing its ID. The command will check if the task is already completed.
task complete [task-id]Example:
$ task complete 1
Task completed successfullyDelete a task by its ID. All remaining task IDs will be automatically re-sequenced.
task delete [task-id]Example:
$ task delete 2
Task ID 2 deleted and remaining IDs re-sequenced.-
Install Go dependencies:
go mod download
-
Run the application:
go run main.go
-
Build the binary:
go build -o task
This project uses Cobra for CLI command management.
Install Cobra CLI (if not already installed):
go install github.com/spf13/cobra-cli@latestAdd a new command:
cobra-cli add <command-name>Example:
cobra-cli add editThis will create a new command file in the cmd/ directory that you can customize.
go test ./...The tasks are stored in a CSV file (tasks.csv) with the following format:
ID,Task,Created,Done
1,Example task,2024-01-15 10:30:00 -0500 EST,false
GO-Task-Cli/
βββ cmd/
β βββ root.go # Root command and CLI setup
β βββ add.go # Add task command
β βββ list.go # List tasks command
β βββ complete.go # Complete task command
β βββ delete.go # Delete task command
βββ utils/
β βββ file_utils.go # File operations utilities
β βββ time_utils.go # Time formatting utilities
βββ main.go # Application entry point
βββ go.mod # Go module dependencies
βββ go.sum # Go module checksums
βββ tasks.csv # Task storage file (created on first use)
βββ readme.md # This file
- Go - Programming language
- Cobra - CLI framework for building command-line applications
- timediff - Library for human-readable time differences
Contributions are welcome! Please feel free to submit a Pull Request.