td-task 0.2.8__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.8 → td_task-0.2.9}/PKG-INFO +1 -1
  2. {td_task-0.2.8 → td_task-0.2.9}/pyproject.toml +1 -1
  3. {td_task-0.2.8 → td_task-0.2.9}/src/td/CHANGELOG.md +7 -0
  4. {td_task-0.2.8 → td_task-0.2.9}/src/td/__main__.py +102 -10
  5. {td_task-0.2.8 → td_task-0.2.9}/src/td/db.py +14 -0
  6. {td_task-0.2.8 → td_task-0.2.9}/uv.lock +1 -1
  7. {td_task-0.2.8 → td_task-0.2.9}/.env.enc +0 -0
  8. {td_task-0.2.8 → td_task-0.2.9}/.github/workflows/pages.yml +0 -0
  9. {td_task-0.2.8 → td_task-0.2.9}/.github/workflows/publish.yml +0 -0
  10. {td_task-0.2.8 → td_task-0.2.9}/.gitignore +0 -0
  11. {td_task-0.2.8 → td_task-0.2.9}/.python-version +0 -0
  12. {td_task-0.2.8 → td_task-0.2.9}/README.md +0 -0
  13. {td_task-0.2.8 → td_task-0.2.9}/assets/demo.gif +0 -0
  14. {td_task-0.2.8 → td_task-0.2.9}/demo.tape +0 -0
  15. {td_task-0.2.8 → td_task-0.2.9}/index.html +0 -0
  16. {td_task-0.2.8 → td_task-0.2.9}/src/td/__init__.py +0 -0
  17. {td_task-0.2.8 → td_task-0.2.9}/src/td/backup.py +0 -0
  18. {td_task-0.2.8 → td_task-0.2.9}/src/td/config.py +0 -0
  19. {td_task-0.2.8 → td_task-0.2.9}/src/td/terminal.py +0 -0
  20. {td_task-0.2.8 → td_task-0.2.9}/src/td/tui.py +0 -0
  21. {td_task-0.2.8 → td_task-0.2.9}/tests/test_backup.py +0 -0
  22. {td_task-0.2.8 → td_task-0.2.9}/tests/test_cli_notes.py +0 -0
  23. {td_task-0.2.8 → td_task-0.2.9}/tests/test_notes.py +0 -0
  24. {td_task-0.2.8 → td_task-0.2.9}/tests/test_resize.py +0 -0
  25. {td_task-0.2.8 → td_task-0.2.9}/tests/test_tui_notes.py +0 -0
  26. {td_task-0.2.8 → td_task-0.2.9}/tests/test_update.py +0 -0
  27. {td_task-0.2.8 → td_task-0.2.9}/website/README.md +0 -0
  28. {td_task-0.2.8 → td_task-0.2.9}/website/favicon.svg +0 -0
  29. {td_task-0.2.8 → td_task-0.2.9}/website/main.js +0 -0
  30. {td_task-0.2.8 → 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.8
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.8"
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,12 @@
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
+
3
10
  ## [0.2.8] - 2026-11-30
4
11
  - Add `td tick <task_id>` CLI command to toggle task completion.
5
12
  - Add `td lists` and `td tasks` CLI commands.
@@ -94,6 +94,93 @@ def main() -> None:
94
94
  lists = db.get_all_lists()
95
95
  list_name = lists[0] if lists else "main"
96
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.")
97
184
 
98
185
  elif len(args) > 1 and args[1] in ("export", "-export", "--export"):
99
186
  _run_export(args)
@@ -152,16 +239,21 @@ def _run_help() -> None:
152
239
  commands_table.add_column(style="green")
153
240
  commands_table.add_column()
154
241
 
155
- commands_table.add_row(" (default)", "Launch interactive TUI todo app (defaults to 'main' list)")
156
- commands_table.add_row(" add <text>", "Add a new task to active or specified list")
157
- commands_table.add_row(" list", "Print active tasks sequentially between dividers")
158
- commands_table.add_row(" notes <action>", "Add, list, show, update, or delete Markdown notes")
159
- commands_table.add_row(" archive", "Open TUI directly in the completed archive screen")
160
- commands_table.add_row(" export [file]", "Export database to JSON file or print to stdout")
161
- commands_table.add_row(" import <file>", "Import and merge database records from a JSON file")
162
- commands_table.add_row(" backup github [repo]", "Encrypt and upload a backup to a private GitHub repo")
163
- commands_table.add_row(" restore github [repo]", "Download and restore an encrypted GitHub backup")
164
- 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")
165
257
 
166
258
  console.print(commands_table)
167
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:
@@ -142,7 +142,7 @@ wheels = [
142
142
 
143
143
  [[package]]
144
144
  name = "td-task"
145
- version = "0.2.8"
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
File without changes