Skip to content

i-ape/todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Go ToDo List

๐Ÿ“Œ Project Overview

This is a simple command-line To-Do List application written in Go.
The goal of this project is to explore Go as a language while building a useful tool.

It covers:

  • Structs and JSON serialization
  • File handling for data persistence
  • Command-line arguments processing
  • Basic concurrency concepts (can be extended)

Features

  • Add tasks with optional due dates
  • Support for natural language dates (e.g. tomorrow, in 3 days, fri)
  • Mark tasks as complete
  • Edit due dates after creation
  • Delete or clear tasks
  • Search by keyword
  • Reset/delete the entire task database
  • Color-coded task listing (due, overdue, complete)
  • Add and edit tags with @ or # syntax
  • Filter tasks by tag (e.g. todo tags @work)
  • bubble tea ui

Installation

go build -o todo
chmod +x todo
./todo list
```bash

## ๐Ÿ“‚ Project Structure

- todo/
- โ”œโ”€โ”€ main.go          # Entry point, dispatch commands
- โ”œโ”€โ”€ commands.go      # All CLI logic (add/edit/list/etc)
- โ”œโ”€โ”€ task.go          # Task struct and core logic
- โ”œโ”€โ”€ storage.go       # JSON file read/write
- โ”œโ”€โ”€ tasks.json       # Auto-generated task data
+ .
+ โ”œโ”€โ”€ cmd/
+ โ”‚   โ”œโ”€โ”€ main.go
+ โ”‚   โ”œโ”€โ”€ commands.go
+ โ”‚   โ”œโ”€โ”€ handlers.go
+ โ”‚   โ””โ”€โ”€ tui.go
+ โ”œโ”€โ”€ todo.int/
+ โ”‚   โ”œโ”€โ”€ task.go
+ โ”‚   โ”œโ”€โ”€ storage.go
+ โ”‚   โ”œโ”€โ”€ due.go
+ โ”‚   โ”œโ”€โ”€ fzf.go
+ โ”‚   โ”œโ”€โ”€ utils.go
+ โ”œโ”€โ”€ config/
+ โ”‚   โ””โ”€โ”€ config.go
+ โ”œโ”€โ”€ tasks.json       # Generated user data


## ๐Ÿ”ง Installation

1. Install Go: [Download Go](https://go.dev/dl/)
2. Clone this repository:

   ```sh
   git clone https://github.com/i-ape/todo.git
   cd todo

โšก๏ธ Optional Dependency:
- Install [`fzf`](https://github.com/junegunn/fzf) for interactive task selection:
  ```bash
  brew install fzf # or apt install fzf

3. Initialize Go module:

go mod init todo

๐Ÿƒ Usage

1๏ธโƒฃ Build the Program

go build -o todo
chmod +x todo
./todo list

## Commands

| Command            | Example usage                      | What to check                                 |
| ------------------ | ---------------------------------- | --------------------------------------------- |
| `add`              | `todo add "Write blog post" today` | Adds task with optional due date              |
| `list`             | `todo list`                        | Shows task list with correct labels, subtasks |
| `done`             | `todo done`                        | Marks selected task(s) done                   |
| `edit`             | `todo edit`                        | Updates task text                             |
| `delete`           | `todo delete`                      | Deletes selected task(s)                      |
| `due`              | `todo due 1 next week`             | Updates due date                              |
| `priority`         | `todo priority`                    | Prompts and updates priority                  |
| `tag`              | `todo tag`                         | Adds or edits tags                            |
| `search`           | `todo search blog`                 | Matches text and returns task(s)              |
| `note`             | `todo note 1 "Update with links"`  | Adds or edits notes                           |
| `move`             | `todo move`                        | Reorders task in list                         |
| `sub` or `subtask` | `todo sub 1 "Write draft"`         | Creates subtask under parent                  |
| `clear`            | `todo clear`                       | Clears all tasks (confirm it empties list)    |
| `reset`            | `todo reset`                       | Deletes `tasks.json`                          |


## Example

```sh
todo add "Write blog post"
todo add "Call mom every sunday"
todo list --tag=home
todo done 1
todo due 2 tomorrow
todo delete 1
todo edit
todo search "report"
todo tag
todo clear
todo reset
todo add "Gym @health" every mon,wed,fri
todo add "Standup meeting @work" every weekday @ 09:00
todo add "Call mom" every sunday @ 18:00
todo add "Quarterly report" bonm
todo add "End of month close" eom
todo due 4 eow
todo list --tag=work --priority=high --pending --json
todo add "Meeting @work" friday @ 14:00 for 45m
todo add "Call mom @family" sunday @ 18:00 for 1h for 3weeks
todo tui        # launch interactive interface
todo --tui list # use tui selection for list
todo list --fzf         # Launch FZF to filter
todo list --json        # Export filtered task list
todo move                  โ†’ Reorder a task to new position


## flags

| Flag                   | Example                     | Expected                        |
| ---------------------- | --------------------------- | ------------------------------- |
| `--tui`                | `todo --tui`                | Launches TUI (if implemented)   |
| `--no-fzf`             | `todo list --no-fzf`        | Bypasses interactive FZF        |
| `--json`               | `todo list --json`          | Returns JSON output             |
| `--today`              | `todo list --today`         | Filters todayโ€™s tasks           |
| `--done` / `--pending` | `todo list --done`          | Shows only completed/incomplete |
| `--tag=work`           | `todo list --tag=work`      | Filters by tag                  |
| `--priority=high`      | `todo list --priority=high` | Filters by priority             |

---

## TUI Keybindings and Configuration

| Flag / Keybinding             | Example                             | Expected                                              |
|-------------------------------|-------------------------------------|-------------------------------------------------------|
| `n`                           | Press `n` in TUI                    | Prompts for new task (name, priority, due date, tags) |
| `j` / `k` or `down` / `up`    | Press `j` or `k` in TUI             | Navigates to next/previous task                       |
| `Enter` / `space`             | Press `Enter` or `space` in TUI     | Toggles task completion status                        |
| `x` / `backspace`             | Press `x` or `backspace` in TUI     | Deletes selected task                                 |
| `d`                           | Press `d` in TUI                    | Prompts to set due date for selected task             |
| `e`                           | Press `e` in TUI                    | Prompts to edit selected taskโ€™s text                  |
| `t`                           | Press `t` in TUI                    | Prompts to set tags for selected task                 |
| `p`                           | Press `p` in TUI                    | Prompts to set priority for selected task             |
| `s`                           | Press `s` in TUI                    | Prompts to add a subtask to selected task             |
| `f`                           | Press `f` in TUI                    | Opens fzf to select a task (if fzf enabled)           |
| `r`                           | Press `r` in TUI                    | Sorts tasks based on TODO_SORT order                  |
| `q` / `Ctrl+C`                | Press `q` or `Ctrl+C` in TUI        | Quits the TUI                                         |
| `TODO_TUI`                    | `export TODO_TUI=true; todo`        | Enables TUI by default (`true`/`false`, default: `false`) |
| `TODO_DEFAULT_PRIORITY`       | `export TODO_DEFAULT_PRIORITY=high` | Sets default task priority (`high`/`medium`/`low`, default: `medium`) |
| `TODO_SORT`                   | `export TODO_SORT=due`              | Sets sort order (`id`/`due`/`priority`/`text`, default: `id`) |


### ๐Ÿงช `todo pick` Flags

| Flag         | Example               | Description                                  |
| ------------ | --------------------- | -------------------------------------------- |
| `--json`     | `todo pick --json`    | Output selected task(s) in JSON              |
| `--edit`     | `todo pick --edit`    | Edit selected task(s) in place               |
| `--note`     | `todo pick --note`    | Add/edit notes for selected task(s)          |
|              | `todo pick`           | Print ID(s) of selected task(s)       


## ๐Ÿง  Learning Goals

โœ… Structs & methods
โœ… File I/O with JSON
โœ… Command-line tools
โœ… Natural language date parsing
โœ… Optional interactivity with FZF
โณ Potential: concurrency, custom DSL, Bubble Tea UI, cron



---

## ๐Ÿ”ฎ Future Ideas

Advanced tagging system (#tag, @context, filter/search by t

Recurring tasks (e.g. daily, weekly, every Mon,Wed)

Time-specific reminders (e.g. at 10am, 8:30p)

Agenda/week views (todo agenda, todo week)

fzf-powered interactive mode (todo pick, todo edit --fzf)

Task priorities (high, medium, low โ€” visual indicators)

Archiving/completed history (todo archive, todo stats)

Multi-task selection (bulk delete/done/edit)

Task templates/snippets (e.g. meeting prep, habit task)

Custom aliasing system (e.g. shortcut commands or templates)

Sync/export support (e.g. sync to GitHub issues, export CSV)

Optional Bubble Tea TUI (interactive full-screen mode)

Push notifications/integrations (via cron, ntfy, or APIs)

 ๐Ÿท๏ธ Advanced tagging system (#tag, @context, filter/search/assign)

 ๐Ÿ” Recurring tasks (e.g. every Monday at 10:00)

 ๐Ÿ—“๏ธ Calendar / agenda views (todo week)

 ๐Ÿšจ Notifications (ntfy, cron, push)

 ๐Ÿ“Š Stats & history (archive completed tasks)

 ๐Ÿ”Œ Integration with GitHub issues, CSV export

 ๐ŸŽญ Templates/snippets (todo new meeting)

 ๐Ÿ’… Bubble Tea full-screen TUI

 ๐Ÿง  Custom aliases / shortcuts


 # notes:

i have a error with # include <linux/errno.h>
it seems kernal related cause i didnt have ubove file 
update to linux-api-headers fixed but issue persists
this is a bad commit but it is a learning experience.
EDIT: I fixed the issue by updating extension in ide
i am quite the fool although it was only pre release version that worked.

About

i wanna get good at go since typescript uses it :)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages