Repository navigation
Task commands read and write tasks the way Logseq does #92
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
After this, every command that deals with tasks agrees with Logseq on what a task is and what state it is in, and a caller gets the same answer from each of them. Today each command decides this on its own, and several disagree with Logseq and with one another.
What happens today
analyze-graphcounts more open tasks thanget-todoslists. It searches the page text, so a block starting with[ ]and a line likeTODO:count as tasks, although Logseq reads neither as one.set-todo-statuson a heading task (## TODO x) writesDONE ## TODO x. On a block without a marker it adds one, so plain text becomes a task.get-todoswithout--statusleaves out tasks marked WAIT, WAITING, IN-PROGRESS or STARTED, andset-todo-statuscannot set WAIT or WAITING.- A task with a date cannot be written through
--content: theSCHEDULED:line becomes a block of its own. - On a repeating task,
--status DONEalways ends the repetition. Logseq offers two ways: ticking the checkbox moves the date on and logs the completion,/DONEends it. The CLI offers only the second and does not say so. - The habit section of
analyze-journal-patternsreads lines that Logseq shows as plain text, not as checkboxes.
Why it happens
Logseq has one idea of a task: a block with a marker, drawn as an open box, a ticked box, or struck through when cancelled. The CLI keeps five different marker lists and reads tasks from two sources, the database in get-todos and text patterns in the analysis commands. Every finding above follows from that. A caller who compares two commands, or checks one against Logseq, gets contradicting answers and cannot tell which is right.
What changes for a caller
- A task is what Logseq reads as a task, and its state is open, done or cancelled, as Logseq draws it. All task commands take both from one place.
get-tasks(todayget-todos) lists all open tasks by default and filters by state.set-task-status(todayset-todo-status) changes only tasks, writes heading tasks correctly, and on a repeating task asks which of Logseq's two ways is meant. The old Command Names stop working in the release that carries the rename, with no second name left behind, so a script that callsget-todosorset-todo-statushas to change.analyze-graphandanalyze-journal-patternscount tasks from the same source asget-tasksand count checkboxes separately. Repeating tasks and their completions replace the habit section. Some JSON keys of both commands change, and the changelog names them.- A task written with a
SCHEDULED:orDEADLINE:line keeps it.
How to tell it is done
analyze-graphreports the same number of open tasks asget-tasks, and
both match Logseq's own(task …)query on the same graph.- A caller can list and filter WAIT, WAITING, IN-PROGRESS and STARTED tasks
like any other, and set every marker Logseq's editor offers (all but
STARTED, which Logseq reads but its editor does not know). - A repeating task can be ticked off so that its date moves on, with the same
text Logseq writes when its checkbox is ticked.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Activity
Add the tasks module: one place for what counts as a task
Read task text with the shared rule for lines that stay with the block
Give test mocks an explicit task marker
Refuse set-todo-status on a block Logseq does not read as a task
Keep SCHEDULED, DEADLINE and LOGBOOK lines with the block above
Select tasks by state in get-todos; default to every open marker
Offer every marker Logseq's frontend knows in set-todo-status
Report next_due from the repeater of the timestamp it reports
Count analyze-graph tasks from the database, like get-todos
Report the size of the largest cluster in analyze-graph
Count journal pattern tasks from the database, one count per day
muellerei commentedon Oct 6, 2026
Status: part 1 is merged (#117), part 2 is still open.
This issue is delivered in two PRs. #117 did the part every command shares: one definition of a task.
Done in #117:
get-todosandset-todo-statusread a task the way Logseq does.SCHEDULED,DEADLINEandLOGBOOKlines stay with their block, a block Logseq does not read as a task is refused instead of turned into one, and a heading task keeps its heading.get-todoslists every open marker by default, WAIT, WAITING, IN-PROGRESS and STARTED included, and takes--state open|done|cancelled.set-todo-statussets every marker Logseq's editor offers.analyze-graphandanalyze-journal-patternscount tasks from the database, likeget-todos. Some of their JSON keys changed; the CHANGELOG names them.Already on
mainbefore #117: a task with aSCHEDULED:line is written in one call.Of "How to tell it is done", the first two points hold.
analyze-graphandget-todosreport the same number of open, done and cancelled tasks, and both match Logseq's own(task …)query (compared on a live Logseq, read only). Every marker can be listed and set.Still to do (part 2):
get-tasksandset-task-statusreplaceget-todosandset-todo-status, with no second name left for the old ones. That is why the sentence about the old names working is changed above.analyze-journal-patternsreplaced by repeating tasks and their completions.#117 also fixed two defects that were already on
main:next_dueof a repeating task dated today or later, and a change made to a block while a command was changing it, which is now refused withblock_changed.This stays open until part 2 is merged.