A simple and powerful command-line todo application written in Go. Manage your tasks efficiently with support for multiple storage backends (JSON, CSV, and SQL).
- Multiple storage backends (JSON, CSV, SQL)
- Flexible column display configuration
- Human-friendly date parsing
- Persistent configuration
- Task completion tracking
- Customizable task views
go install github.com/ncfex/tasks@latest
The application stores its data in the ~/.tasks
directory. For SQL storage mode, you need to set the DB_URL
environment variable.
Default configuration will be created automatically on first run.
tasks [command] [flags]
-m, --format string
: Storage format (json, csv, or sql) (json is default configured mode)-h, --help
: Help for any command
tasks add [description] [flags]
Flags:
-d, --due string Due date for the task (defaults to "tomorrow")
The --due
flag supports human-readable time formats:
-
Special keywords:
tomorrow
- Sets due date to tomorrow
-
Relative past time (for recurring tasks):
tasks add "Weekly review" --due "1 week ago"
Supported formats:
X seconds ago
X minutes ago
X hours ago
X days ago
X weeks ago
X months ago
X years ago
-
Future time:
tasks add "Team meeting" --due "in 2 hours"
Supported formats:
in X seconds
in X minutes
in X hours
in X days
in X weeks
in X months
in X years
Examples:
# Due tomorrow
tasks add "Review pull requests" --due tomorrow
# Due in the future
tasks add "Team meeting" --due "in 2 hours"
tasks add "Quarterly review" --due "in 3 months"
tasks add "Weekly sync" --due "in 1 week"
# Recurring tasks from past
tasks add "Weekly report" --due "1 week ago"
tasks add "Monthly maintenance" --due "1 month ago"
Note: The time expressions are case-insensitive and support both singular and plural units (e.g., both "1 hour" and "2 hours" work).
When listing tasks, the due dates are automatically formatted into human-readable relative time using the timediff
package.
tasks list [flags]
Flags:
-a, --all Show all tasks (including completed)
-c, --columns strings Columns to display
-s, --save Save selected columns to config
Available columns:
id
: Task identifierdescription
: Task descriptioniscompleted
: Completion statuscreatedat
: Creation timestampduedate
: Due date
Example:
tasks list --columns id,description,duedate --save
tasks complete [task_id]
Example:
tasks complete abc123
tasks delete [task_id]
Example:
tasks delete abc123
tasks set-mode [mode]
Supported modes:
json
: Store tasks in a JSON filecsv
: Store tasks in a CSV filesql
: Store tasks in a SQL database
Example:
tasks set-mode json
Tasks are stored in ~/.tasks/tasks.json
Tasks are stored in ~/.tasks/tasks.csv
Requires a database connection string in the DB_URL
environment variable.
- Add a new task:
tasks add "Write blog post" --due "next monday"
- List all pending tasks:
tasks list
- Complete a task:
tasks complete abc123
- View all tasks including completed:
tasks list --all
- Customize column display:
tasks list --columns id,description,duedate --save
.
├── internal/
│ ├── cli/ # CLI implementation
│ ├── config/ # Configuration management
│ ├── storage/ # Storage backends
│ │ ├── csv/
│ │ ├── json/
│ │ └── sql/
│ ├── task/ # Core task domain
│ └── utils/ # Utility functions
└── main.go
- Implement new functionality in appropriate package
- Add new command in
internal/cli/commands.go
- Register command in
setupCommands()
ininternal/cli/app.go
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.