Command reference
Project checklist
Project checklist reads and edits a plain-text checklist that stays editable in
any other app. Enable projectChecklist and run these actions with
ed invoke.
ed invoke projectChecklist projectChecklist.read --json '{"path":"/tmp/plan.taskpaper"}'ed invoke projectChecklist projectChecklist.toggle --json '{"path":"/tmp/plan.taskpaper","line":2,"expected":"\t- Draft post"}'ed invoke projectChecklist projectChecklist.add --json '{"path":"/tmp/plan.taskpaper","line":1,"expected":"Launch:","text":"Book a room"}'ed invoke projectChecklist projectChecklist.outstanding --json '{"path":"/tmp/plan.taskpaper","project":1}'ed invoke projectChecklist projectChecklist.archive --json '{"path":"/tmp/plan.taskpaper","revision":"<revision from read>"}'Every action takes a JSON object with an absolute path. Symbolic links are
followed and the link itself is kept. Files must be regular UTF-8 text files up
to 2 MiB and 20,000 lines; a UTF-8 byte order mark is kept. Requests are limited
to 64 KiB. A body that is not a JSON object or has a field of the wrong type,
and a line or project below 1, fail before the file is read.
read and outstanding work on any readable file. toggle, add and
archive only write to files chosen on the Project checklist page: the
extension remembers the last 20 chosen files, compared after resolving symbolic
links, so /tmp/plan.taskpaper and /private/tmp/plan.taskpaper are the same
file. Writing to any other file fails with "Open this file on the Project
checklist page before changing it." and leaves it untouched.
Format
| Line | Meaning |
|---|---|
- text |
Task |
- [ ] text, * [ ] text, + [ ] text, 1. [ ] text |
Task with a checkbox; [x] or [X] is done |
Name: |
Project, optionally followed by tags |
# Name to ###### Name |
Project heading; deeper headings nest under shallower ones |
| Anything else | Note |
Indentation with tabs or spaces nests a line under the nearest earlier line with
less indentation. A tab advances to the next multiple of four columns. Tags are
@name or @name(value); write \) for a literal parenthesis in a value. A task
is done when it has a checked box or an @done tag. Tasks under a done task are
treated as done.
Actions
projectChecklist.read returns path, revision, lineEnding (lf, crlf,
cr, mixed or none), byteOrderMark, lineCount, tags, taskCount,
doneCount, outstandingCount and items. Blank lines are omitted from
items; line numbers still count them. Each item has line (1-based), text
(the exact line without its terminator), kind, depth, parent, project,
title, tags, checkbox, done, inheritsDone and outstanding.
projectChecklist.toggle needs line and expected, the exact line text from
the last read. A checkbox task that is done, by its box or an @done tag,
becomes [ ] without @done tags; an open one becomes [x]. Other tasks gain @done(YYYY-MM-DD) or lose every @done
tag. Notes and projects are rejected.
projectChecklist.add needs text, a single line of up to 1,000 characters.
Without line the task is appended to the end of the file. With line and
expected it is added after the last line nested under that line, using the
indentation of its existing children or one more indentation step. New tasks use
- [ ] when the file already uses checkboxes and - otherwise.
projectChecklist.outstanding returns path, revision, count and text:
the open tasks with the projects, headings and parent lines above them, in file
order, with shared leading indentation removed and the file's most common line
ending. Pass project to limit it to the lines nested under that line. It
writes nothing.
projectChecklist.archive needs the revision from the last read. It moves
every done task that is not already under a done task or an archive project,
together with the lines nested under it, to the end of the archive project.
The archive project is the first Archive: project or Archive heading at any
depth; when there is none, an Archive: project is appended to the end of the
file. Moved tasks use the indentation of the archive's existing children; under
an empty Archive heading they keep the heading's indentation so Markdown does
not render them as code. A moved task gains @project(Name) from its nearest
project.
Toggle, add and archive return the new read result.
External edits
Writes rewrite only the changed lines. Every other line keeps its exact text and terminator, so files with mixed line endings stay mixed and a missing final newline stays missing. New lines use the file's most common line ending.
Before writing, toggle and add read the file again. If the expected text is no
longer at line but appears exactly once elsewhere, that line is edited. If it
is gone or appears more than once, the action fails without writing. Archive
fails when the file's revision changed. Every write also fails if the file
changes between that read and the save. Writes from the page and from
ed invoke run one at a time, so two toggles never overwrite each other. Saves
rewrite the same file in place, which keeps its inode, hard links, permissions,
ownership and extended attributes such as Finder tags.
While the page is visible it watches the file and its folder and reloads after a change from another app, including a save that replaces the file. A hidden page stops watching and checks the file again when it is shown. When the file disappears the list stays on screen with an error, which clears once the file is back.