td-task 0.2.7__tar.gz → 0.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {td_task-0.2.7 → td_task-0.2.9}/PKG-INFO +1 -1
  2. {td_task-0.2.7 → td_task-0.2.9}/pyproject.toml +1 -1
  3. {td_task-0.2.7 → td_task-0.2.9}/src/td/CHANGELOG.md +12 -0
  4. {td_task-0.2.7 → td_task-0.2.9}/src/td/__main__.py +134 -10
  5. {td_task-0.2.7 → td_task-0.2.9}/src/td/db.py +14 -0
  6. {td_task-0.2.7 → td_task-0.2.9}/tests/test_resize.py +1 -1
  7. {td_task-0.2.7 → td_task-0.2.9}/uv.lock +1 -1
  8. {td_task-0.2.7 → td_task-0.2.9}/.env.enc +0 -0
  9. {td_task-0.2.7 → td_task-0.2.9}/.github/workflows/pages.yml +0 -0
  10. {td_task-0.2.7 → td_task-0.2.9}/.github/workflows/publish.yml +0 -0
  11. {td_task-0.2.7 → td_task-0.2.9}/.gitignore +0 -0
  12. {td_task-0.2.7 → td_task-0.2.9}/.python-version +0 -0
  13. {td_task-0.2.7 → td_task-0.2.9}/README.md +0 -0
  14. {td_task-0.2.7 → td_task-0.2.9}/assets/demo.gif +0 -0
  15. {td_task-0.2.7 → td_task-0.2.9}/demo.tape +0 -0
  16. {td_task-0.2.7 → td_task-0.2.9}/index.html +0 -0
  17. {td_task-0.2.7 → td_task-0.2.9}/src/td/__init__.py +0 -0
  18. {td_task-0.2.7 → td_task-0.2.9}/src/td/backup.py +0 -0
  19. {td_task-0.2.7 → td_task-0.2.9}/src/td/config.py +0 -0
  20. {td_task-0.2.7 → td_task-0.2.9}/src/td/terminal.py +0 -0
  21. {td_task-0.2.7 → td_task-0.2.9}/src/td/tui.py +0 -0
  22. {td_task-0.2.7 → td_task-0.2.9}/tests/test_backup.py +0 -0
  23. {td_task-0.2.7 → td_task-0.2.9}/tests/test_cli_notes.py +0 -0
  24. {td_task-0.2.7 → td_task-0.2.9}/tests/test_notes.py +0 -0
  25. {td_task-0.2.7 → td_task-0.2.9}/tests/test_tui_notes.py +0 -0
  26. {td_task-0.2.7 → td_task-0.2.9}/tests/test_update.py +0 -0
  27. {td_task-0.2.7 → td_task-0.2.9}/website/README.md +0 -0
  28. {td_task-0.2.7 → td_task-0.2.9}/website/favicon.svg +0 -0
  29. {td_task-0.2.7 → td_task-0.2.9}/website/main.js +0 -0
  30. {td_task-0.2.7 → td_task-0.2.9}/website/style.css +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: td-task
3
- Version: 0.2.7
3
+ Version: 0.2.9
4
4
  Summary: Fast TUI and CLI manager for tasks and Markdown notes
5
5
  Requires-Python: >=3.14
6
6
  Requires-Dist: cryptography>=42.0.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "td-task"
3
- version = "0.2.7"
3
+ version = "0.2.9"
4
4
  description = "Fast TUI and CLI manager for tasks and Markdown notes"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.14"
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.9] - 2026-11-30
4
+ - Add `td rm <id>`, `td edit <id> <text>`, `td star <id>`.
5
+ - Add `td note <id>` to display task note content.
6
+ - Add `td append <id> <text>` to add to task notes.
7
+ - Add `td find <query>` to search all lists.
8
+ - Improve CLI help with comprehensive command documentation.
9
+
10
+ ## [0.2.8] - 2026-11-30
11
+ - Add `td tick <task_id>` CLI command to toggle task completion.
12
+ - Add `td lists` and `td tasks` CLI commands.
13
+ - Make `td -l <listname>` list tasks and notes directly in the CLI.
14
+
3
15
  ## [0.2.7] - 2026-11-10
4
16
  - Raise default max tasks per list from 15 to 100, and the max tasks setting range to 3–100.
5
17
 
@@ -68,6 +68,120 @@ def main() -> None:
68
68
  print("✗ Error: list name is required. Pass list name with -l <name> or --list <name>.")
69
69
  sys.exit(1)
70
70
  _run_list(list_name)
71
+ elif len(args) > 1 and args[1] in ("tick", "-tick", "--tick"):
72
+ if len(args) < 3:
73
+ print("Usage: td tick <task_id>")
74
+ sys.exit(1)
75
+ try:
76
+ task_id = int(args[2])
77
+ from . import db
78
+ db.toggle_done(task_id)
79
+ print(f"✓ Task {task_id} toggled.")
80
+ except ValueError:
81
+ print("✗ Invalid task ID")
82
+ sys.exit(1)
83
+ except Exception as e:
84
+ print(f"✗ Failed to toggle task: {e}")
85
+ sys.exit(1)
86
+ elif len(args) > 1 and args[1] == "lists":
87
+ from . import db
88
+ lists = db.get_all_lists()
89
+ for name in lists:
90
+ print(name)
91
+ elif len(args) > 1 and args[1] == "tasks":
92
+ if not has_list:
93
+ from . import db
94
+ lists = db.get_all_lists()
95
+ list_name = lists[0] if lists else "main"
96
+ _run_list(list_name)
97
+ elif len(args) > 1 and args[1] == "rm":
98
+ if len(args) < 3:
99
+ print("Usage: td rm <task_id>")
100
+ sys.exit(1)
101
+ try:
102
+ task_id = int(args[2])
103
+ from . import db
104
+ db.delete_task(task_id)
105
+ print(f"✓ Task {task_id} deleted.")
106
+ except ValueError:
107
+ print("✗ Invalid task ID")
108
+ sys.exit(1)
109
+ elif len(args) > 1 and args[1] == "edit":
110
+ if len(args) < 4:
111
+ print("Usage: td edit <task_id> <new_text>")
112
+ sys.exit(1)
113
+ try:
114
+ task_id = int(args[2])
115
+ text = args[3]
116
+ from . import db
117
+ db.update_task_text(task_id, text)
118
+ print(f"✓ Task {task_id} updated.")
119
+ except ValueError:
120
+ print("✗ Invalid task ID")
121
+ sys.exit(1)
122
+ elif len(args) > 1 and args[1] == "star":
123
+ if len(args) < 3:
124
+ print("Usage: td star <task_id>")
125
+ sys.exit(1)
126
+ try:
127
+ task_id = int(args[2])
128
+ from . import db
129
+ if db.toggle_starred(task_id):
130
+ print(f"✓ Task {task_id} starred.")
131
+ else:
132
+ print(f"✗ Failed to star task {task_id} (or max starred reached).")
133
+ except ValueError:
134
+ print("✗ Invalid task ID")
135
+ sys.exit(1)
136
+ elif len(args) > 1 and args[1] == "note":
137
+ if len(args) < 3:
138
+ print("Usage: td note <task_id>")
139
+ sys.exit(1)
140
+ try:
141
+ task_id = int(args[2])
142
+ from . import db
143
+ note = db.get_note_by_task_id(task_id)
144
+ if note:
145
+ print(note["content"])
146
+ else:
147
+ print("✗ No note found for task.")
148
+ except ValueError:
149
+ print("✗ Invalid task ID")
150
+ sys.exit(1)
151
+ elif len(args) > 1 and args[1] == "append":
152
+ if len(args) < 4:
153
+ print("Usage: td append <task_id> <text>")
154
+ sys.exit(1)
155
+ try:
156
+ task_id = int(args[2])
157
+ text = args[3]
158
+ from . import db
159
+ note = db.get_note_by_task_id(task_id)
160
+ if note:
161
+ db.update_note_content(note["id"], note["content"] + "\n" + text)
162
+ print(f"✓ Appended to note {note['id']}.")
163
+ else:
164
+ print("✗ No note found for task.")
165
+ except ValueError:
166
+ print("✗ Invalid task ID")
167
+ sys.exit(1)
168
+ elif len(args) > 1 and args[1] == "find":
169
+ if len(args) < 3:
170
+ print("Usage: td find <query>")
171
+ sys.exit(1)
172
+ query = args[2].lower()
173
+ from . import db
174
+ lists = db.get_all_lists()
175
+ found = False
176
+ for l in lists:
177
+ tasks = db.get_active_tasks(l)
178
+ for t in tasks:
179
+ if query in t["text"].lower() or (t.get("note_title") and query in t["note_title"].lower()):
180
+ print(f"[{l}] {t['id']}: {t['text']}")
181
+ found = True
182
+ if not found:
183
+ print("No matches found.")
184
+
71
185
  elif len(args) > 1 and args[1] in ("export", "-export", "--export"):
72
186
  _run_export(args)
73
187
  elif len(args) > 1 and args[1] in ("import", "-import", "--import"):
@@ -83,6 +197,11 @@ def main() -> None:
83
197
  db.create_list("main")
84
198
  lists = ["main"]
85
199
  active_list = list_name if has_list else (lists[0] if lists else "main")
200
+
201
+ if has_list and len(args) == 1:
202
+ _run_list(active_list)
203
+ return
204
+
86
205
  run_main(active_list, lock_list=has_list)
87
206
  except KeyboardInterrupt:
88
207
  sys.exit(0)
@@ -120,16 +239,21 @@ def _run_help() -> None:
120
239
  commands_table.add_column(style="green")
121
240
  commands_table.add_column()
122
241
 
123
- commands_table.add_row(" (default)", "Launch interactive TUI todo app (defaults to 'main' list)")
124
- commands_table.add_row(" add <text>", "Add a new task to active or specified list")
125
- commands_table.add_row(" list", "Print active tasks sequentially between dividers")
126
- commands_table.add_row(" notes <action>", "Add, list, show, update, or delete Markdown notes")
127
- commands_table.add_row(" archive", "Open TUI directly in the completed archive screen")
128
- commands_table.add_row(" export [file]", "Export database to JSON file or print to stdout")
129
- commands_table.add_row(" import <file>", "Import and merge database records from a JSON file")
130
- commands_table.add_row(" backup github [repo]", "Encrypt and upload a backup to a private GitHub repo")
131
- commands_table.add_row(" restore github [repo]", "Download and restore an encrypted GitHub backup")
132
- commands_table.add_row(" update", "Upgrade the `td` package to the latest version")
242
+ commands_table.add_row(" add <text>", "Add task to active list")
243
+ commands_table.add_row(" tick <id>", "Toggle task completion")
244
+ commands_table.add_row(" rm <id>", "Delete task")
245
+ commands_table.add_row(" edit <id> <text>", "Update task text")
246
+ commands_table.add_row(" star <id>", "Toggle task star/pin")
247
+ commands_table.add_row(" note <id>", "Display task note content")
248
+ commands_table.add_row(" append <id> <text>", "Append to task note")
249
+ commands_table.add_row(" find <query>", "Search all tasks/notes")
250
+ commands_table.add_row(" lists", "List all available lists")
251
+ commands_table.add_row(" tasks", "List tasks in active/default list")
252
+ commands_table.add_row(" notes <action>", "Manage Markdown notes")
253
+ commands_table.add_row(" archive", "Open TUI archive screen")
254
+ commands_table.add_row(" export/import", "Manage database files")
255
+ commands_table.add_row(" backup/restore", "GitHub backup operations")
256
+ commands_table.add_row(" update", "Upgrade td package")
133
257
 
134
258
  console.print(commands_table)
135
259
  console.print()
@@ -1057,6 +1057,20 @@ def get_note(note_id: int) -> dict | None:
1057
1057
  conn.close()
1058
1058
 
1059
1059
 
1060
+ def get_note_by_task_id(task_id: int) -> dict | None:
1061
+ conn = _connect()
1062
+ try:
1063
+ row = conn.execute(
1064
+ "SELECT notes.id FROM notes WHERE task_id = ?",
1065
+ (task_id,),
1066
+ ).fetchone()
1067
+ if row is None:
1068
+ return None
1069
+ return get_note(row["id"])
1070
+ finally:
1071
+ conn.close()
1072
+
1073
+
1060
1074
  def get_note_list_name(note_id: int) -> str | None:
1061
1075
  conn = _connect()
1062
1076
  try:
@@ -289,7 +289,7 @@ class LiveTuiResizeTests(unittest.TestCase):
289
289
  "PYTHONPATH": str(Path(__file__).resolve().parents[1] / "src"),
290
290
  })
291
291
  process = subprocess.Popen(
292
- [sys.executable, "-m", "td", "--list", "main"],
292
+ [sys.executable, "-m", "td"],
293
293
  stdin=slave, stdout=slave, stderr=slave,
294
294
  env=environment, start_new_session=True,
295
295
  )
@@ -142,7 +142,7 @@ wheels = [
142
142
 
143
143
  [[package]]
144
144
  name = "td-task"
145
- version = "0.2.7"
145
+ version = "0.2.9"
146
146
  source = { editable = "." }
147
147
  dependencies = [
148
148
  { name = "cryptography" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes