Command-line client (ot)
ot is a small, statically linked client for the OpenTodo REST API. It is built for two audiences: people who live in a terminal (ot add "Call the plumber" --due tomorrow, ot today) and scripts, cron jobs and editor integrations that want stable JSON output and exit codes instead of hand-written curl.
On this page
It is an online client: it keeps no local copy of your tasks and makes no change when the server cannot be reached. The one exception is ot vault, which keeps a folder of Markdown files and its own sync state. Every write goes through the REST API, which records it in the operation log, so changes made with ot reach your phone and browser on their next sync and converge under the same per-field last-writer-wins rule as any other edit.
ot rules list lists your automation rules; ot rules enable <id> and ot rules disable <id> turn one on or off (an id prefix or the exact name works; --dry-run prints the request); ot rules runs <id> prints its run log. A read token lists but cannot switch (exit 5). Routines have their own command, ot routine (below).
Command names, flags, exit codes and the --json output are part of the v1 surface: within 1.x they only grow (stability and compatibility).
Install#
Release assets are published for linux, macOS and Windows on amd64 and arm64 (ot-<os>-<arch>, with SHA256SUMS); download one, make it executable and put it on your PATH. Or build from source (Go 1.27+, no other dependency):
go install github.com/OpenTodoApp/opentodo/cmd/ot@latest # into $(go env GOPATH)/bin; or @vX.Y.Z for a release
# or, from a checkout:
make cli # -> bin/ot
go install works from a clean GOPATH with the module path as declared (github.com/OpenTodoApp/opentodo, the repository name in lower case); an older local Go downloads the required toolchain itself. There is no Homebrew tap or Scoop bucket yet: release assets and go install are the supported ways (package manager manifests may follow later).
The server container image does not include ot; it belongs on the machine you type on.
Shell completion#
ot completion bash, ot completion zsh and ot completion fish print a completion script. Install it once:
# bash (needs the bash-completion package, which most distributions and Homebrew ship)
mkdir -p ~/.local/share/bash-completion/completions
ot completion bash > ~/.local/share/bash-completion/completions/ot
# or, without bash-completion, in ~/.bashrc:
source <(ot completion bash)
# zsh: a directory on $fpath, before compinit runs in ~/.zshrc
mkdir -p ~/.zfunc
ot completion zsh > ~/.zfunc/_ot
# in ~/.zshrc: fpath=(~/.zfunc $fpath); autoload -U compinit; compinit
# fish
ot completion fish > ~/.config/fish/completions/ot.fish
Open a new shell afterwards. Tab then completes commands, subcommands, flags and fixed values (--priority, --scope), and reads names from the server of your profile: projects after --project and as #Name in an ot add title, labels after --label and as @name, workspaces after --workspace, and open task ids (with their titles in zsh and fish) after ot done, edit, rm, time start and time log; ot reopen offers completed ones. Profile names come from your config file, and --out or a vault folder complete as paths. A --profile or --server earlier on the line is respected.
The script is a thin wrapper: on each Tab it asks the ot on your PATH (ot __complete, a hidden command), which answers from the same command table as ot help and ot schema, so an upgraded ot completes its new flags without a new script. Names are read with one request that may take at most 2 seconds; when the server cannot be reached, you are signed out or the account is end-to-end encrypted, you get commands and flags but no names, and nothing is printed into your prompt. Nothing is cached on disk. Names with spaces or quotes are inserted quoted. In bash, values complete after --flag value, not --flag=value.
Sign in#
ot login https://todo.example.com
Email: [email protected]
Password:
Signed in to https://todo.example.com as [email protected] (profile "default").
Token "cli@laptop" stored in /home/you/.config/opentodo/config.json.
ot login signs in with your email and password, creates an API token named cli@<hostname>, signs the session out again and stores only the token. The password is never echoed and never stored. With two-factor authentication on, it then asks for the code from your authenticator app, or one of your recovery codes, without echoing it. You will see the token in Settings → Integrations → API tokens in the web app, where it can also be revoked.
Other ways to get credentials in:
| Command | Purpose |
|---|---|
ot auth set-token <token> --server <url> |
Store a token you created in Settings or with ot token create |
ot auth status |
Show the server, the account, the token name and its scope (for an agent token also whether assistant writes are allowed right now) |
ot auth logout --yes |
Revoke the stored token on the server and remove it locally (asks on a terminal without --yes). A read or agent token cannot revoke itself: it is removed locally and you revoke it in Settings |
Configuration file and profiles#
The config file lives in the platform's user configuration directory ($XDG_CONFIG_HOME/opentodo/config.json or ~/.config/opentodo/config.json on Linux, ~/Library/Application Support/opentodo/config.json on macOS, %AppData%\opentodo\config.json on Windows). It is written with owner-only permissions (0600, directory 0700).
{
"default": "home",
"profiles": {
"home": { "url": "https://todo.example.com", "token": "ot_…" },
"work": { "url": "https://tasks.corp.example", "token": "ot_…" }
}
}
Pick a profile with --profile work or OPENTODO_PROFILE=work; ot login --profile work <url> creates one. Precedence, highest first:
- Flags:
--server <url> - Environment:
OPENTODO_URL,OPENTODO_TOKEN(handy for cron and CI; no config file needed) - The selected profile
OPENTODO_CONFIG=/path/to/config.json points at another config file. No command ever prints a stored token.
Workspaces#
Every command acts on one workspace: the account's default workspace, unless --workspace <name or id>, OPENTODO_WORKSPACE or the profile's "workspace" (written by ot login --workspace Work) names another. ot list, ot inbox and the other views show that workspace's tasks, and ot add without --project puts the task in its Inbox. ot workspaces lists them (--json for the full shape). An unknown name exits with code 2 and lists the workspaces you have.
Tasks#
ot today # due today or earlier, overdue first
ot today --all # with a Today limit: every task, no "Waiting for a slot" section
ot inbox # the Inbox: no project and no date
ot upcoming # due after today
ot list # every open task, soonest first
ot list --project Home # one project (name or id), subtasks under their parent
ot list --parent 3f1d # the direct subtasks of a task
ot list --completed # most recently completed first
ot list --all --limit 20 # open and completed
ot list --completed-after 2026-10-05 --completed-before 2026-10-12 # completed that week
ot list --someday # parked in Someday
ot list --anytime # no due date, deadline or start
ot list --blocked --project Home # waiting for an open task
ot list --available # what can be done now: not blocked, not waiting for an earlier step
ot list --sector this-week # planned for this week without a date; carried: periods that ended
ot today --sort urgency # most urgent first, with the urgency score
Human output is a compact table: an id prefix, priority, due date and time (overdue dates are marked and shown in red on a terminal), project and title, plus an ORIGIN column (the issue id or the page's host) when a listed task has an origin and a BY column with the deadline when one has a deadline (a passed deadline is marked overdue), and an ENERGY column when a listed task has an energy; --json always carries energy (null for none). The due cell adds (someday), starts <date> (for a multi-day task its days instead: 3–5 Nov, 30 Oct – 2 Nov, or with the years when they differ), the time sector of a task without a due date (this week, next month, the period such as 2026-W47, or from 2026-W43 when its period has ended; --json always carries sector, null for none), evening (or morning, afternoon) and waiting when they apply. Dates are evaluated in your local time zone. A task fixed to a time zone (see sync.md) is shown converted to your zone with the original as a hint, e.g. 2026-10-11 00:00 (09:00 Berlin); ot edit --due/--time on it takes the date and time as shown and keeps the zone, and --time "" releases it to a floating date. Tasks of archived projects stay out of the cross-project views, as in the web app.
--sort urgency (on ot list, ot today, ot inbox and ot upcoming) orders the listed tasks by the urgency score, the same rule as the web app and the assistant tools, highest first, equal scores by due date, priority and position. It adds a URG column and urgency to each task in --json, and replaces the Today limit's waiting heading with the one order. --sort default is the usual order; any other value exits with code 2. Custom-field sorting is available in the web app and saved views; ot list has no sort flag for it (see Group and order).
ID P DUE PROJECT TITLE
8c2a91f0 P2 2026-10-08 overdue Home Pay rent
3f1d7a22 P1 2026-10-10 09:00 Call the plumber
With a Today limit on, ot today prints the tasks in the slots, then a Waiting for a slot heading and the waiting tasks in fill order (the first comes in next), with the app's rule: today's focus, the tasks you let in, Earlier oldest first, then the rest by when they were created. --all prints every task in one table, and --json adds waiting_for_slot to each task while the limit is on. When waiting tasks are due today with a time or have a deadline today, the heading names the next one (Waiting for a slot · 4 — next: Send the form, 16:00) and lists them first, soonest first, with their time (deadline for a deadline without one), before the waiting tasks in fill order. A time that has passed is marked (time passed) and never named next; when every time has passed the heading says so (— time passed: Call the school, 09:00, or — 2 past their time). --json marks them with time_sensitive: true (false on the other waiting tasks) and time_passed.
Add and edit#
ot add "Call the plumber" --project Home --due tomorrow --time 09:00 --priority 2
ot add "Read the sync design" --label reading --label work --note "docs/sync.md"
ot edit 8c2a --priority 1 --due friday
ot edit 8c2a --due none --project none --note "" # clear values
ot add "Backup check" --due monday --time 09:00 --repeat "every week" --remind "30 min before"
ot edit 8c2a --repeat none # stop repeating, keep the date
ot add --natural "Water plants every Monday remind me at 8 #home"
ot add "Fix the login timeout" --origin-url https://github.com/o/r/issues/7
ot edit 8c2a --origin-url none # forget where it came from
ot add "Quarterly report" --start monday --deadline 2026-11-06
ot edit 8c2a --start someday # park it, keep the due date
ot add "Install shelves" --blocked-by 91f0 --location Home
ot edit 8c2a --evening=false --blocked-by none --location none
ot edit 8c2a --start 2026-11-03 --due 2026-11-05 --span # a trip from 3 to 5 November
ot add --done "Fixed the printer" # log a win: created already completed
ot edit bins --rotate "alice,Bob,[email protected]" # take turns, in this order
ot edit bins --no-rotate # stop taking turns
| Flag | Meaning |
|---|---|
--project <name-or-id> |
Project; none (edit) takes the task out of its project (into the Inbox while it has no date) |
--parent <ref> |
Make the task a subtask of an open task, by id or unique id prefix; none (edit) moves it back to the top level |
--due <when> |
YYYY-MM-DD, today, tomorrow or an English weekday name (next occurrence; monday on a Monday means next week); none (edit) clears the date |
--time HH:MM |
Due time, 24-hour; with ot add and no --due the date is today |
--priority 1..4 |
1 is highest, 4 is the default |
--label <l> |
Repeatable; a label name (case-insensitive) or id. Unknown names create the label. With ot edit the given labels replace the list |
--note <text> |
Description; --note "" clears it |
--title <text> |
New title (ot edit only) |
--rotate <people> |
ot edit only: the people who take turns on a recurring task of a shared project, comma-separated, in order. Each is a member's email, name or account id (any case), or a unique prefix of a name or email; an unknown or ambiguous person exits 2 listing the members, before any write. Completing the task then assigns the next of them. The command prints Takes turns: Alice* → Bob → Carol, the current assignee marked with * |
--no-rotate |
ot edit only: stop taking turns (the assignee stays) |
--repeat <rule> |
Recurrence rule in any spelling of the rule grammar ("Every Week", "every mon, wed"), checked locally and sent in canonical form; none (edit) clears the rule and keeps the date |
--origin-url <url> |
Where the task comes from: an http or https URL, sent as the task's origin. A GitHub, GitLab, Jira or Linear issue link becomes {kind: "issue", provider, id} (o/r#7, ENG-123), derived on your machine with the same table as the web app; any other link is a url origin. ot never requests the URL. Another scheme (ftp:, file:) exits 2 before any request; none (edit) clears the origin |
--deadline <when> |
The day the task must be finished by, separate from the due date; same words as --due; none (edit) clears it |
--start <when> |
someday parks the task; a date (same words as --due) defers it until that day; none (edit) clears it. The due date is kept |
--evening |
Put the task in This Evening; --evening=false takes it out |
--span, --no-span |
Draw the task across the days from its start date to its due date, both included (a trip, a conference); a span needs --start and --due with the start before the due date, otherwise it shows on its due date as before. --no-span takes it back to one day and keeps the start date. Both together exit 2 before any request |
--part <part> |
The part of the day: morning, afternoon, evening (This Evening) or none; written with the evening flag, so --part afternoon takes an evening task out of This Evening. Another word exits 2 before any request. It wins over --evening |
--energy <level> |
The task's energy: deep, medium or low (any case); none clears it. Another word exits 2 before any request |
--sector <when> |
The time sector: this-week, next-week, this-month, next-month, this-quarter or next-quarter (weeks start on Monday), or a period such as 2026-W45, 2026-11 or 2026-Q4; none (edit) clears it. Written as sent: the due date is kept. Another word exits 2 naming it, before any request. ot list --sector takes the same words or carried |
--blocked-by <ref> |
Repeatable: a task this one waits for, by id or unique id prefix (an ambiguous prefix exits 1 listing the candidates, before any write). With ot edit the list is replaced; none clears it |
--location <where> |
A saved location's name (case-insensitive) or id, sent with its current name, address and coordinates; or lat,lon; none (edit) clears it. An unknown name exits 1 before any write |
--remind <phrase> |
ot add only, repeatable: a reminder without the reminder word, either an offset ("30 min before", "1 day before", "2 hours after") or a moment ("at 9", "tomorrow at 9", "20 Oct at 9"). It is resolved like a quick-add reminder: relative to the task's due time (09:00 for a date-only due), or absolute in your local time zone when the task has no due date. An offset on an undated task waits for a due date, and the command says so |
--natural |
ot add only: read the title like the app's quick add: dates and times, #project, @label, p1–p4, +30m, 30m/2h (time spent and an estimate), every … rules and remind me … reminders, in nine languages, and ~deep, ~medium, ~low while your account has Energy levels on; an http or https address is attached to the task as a link and leaves the title. Explicit flags win over what the line says; an unknown #name stays in the title |
--done |
ot add only: log a win, a task created already completed now by you in the one request, so it counts in Completed and your statistics like any completion. --repeat and --remind are usage errors with it (a win does not repeat or remind), and with --natural a rule or reminder phrase in the title is left out |
--lang <codes> |
Languages for --natural and --remind, e.g. de,en. Default: the language of LC_ALL, LC_MESSAGES or LANG; English is always active |
--no-default-reminder |
ot add and ot edit: add no default reminder. Without it, a command that sets a due date asks the server for your default reminder (?default_reminder=true); --remind (or a remind me … phrase with --natural) also leaves it out, since you chose your own. With an agent token the server always applies your defaults |
--idempotency-key <key> |
ot add only: a retry with the same key returns the same task, see Retry-safe creates. Reminders send <key>.r1, <key>.r2, …, so a retry also converges to one set of reminders |
ot add prints the new task's id (the whole task with --json, origin included). Priority, time, date, rule, origin URL and reminder phrases are validated locally before any request is sent. Reminders are created after the task with one POST /api/v1/reminders each (a dry run lists them, referring to the planned task as (planned-1)); if one fails, the command exits 1 and names the created task so you can add the reminder by hand. A 30m/2h token in a --natural line also logs the time already spent: one POST /api/v1/time-entries after the task, ending now (<key>.t with an idempotency key).
--natural uses the same grammar as the web app, pinned by shared test cases, with two differences because ot cannot read your preferences: weeks start on Monday (next week), and numeric dates such as 3/11 follow the first language (day first in German, month first in English) rather than your date-format setting.
Complete, reopen, delete#
ot done 8c2a 3f1d # one or more references
ot reopen 8c2a
ot rm 8c2a # asks on a terminal
ot rm 8c2a --yes # required off a terminal and with --json
A <ref> is a full task id or an id prefix that matches exactly one non-deleted task. An ambiguous prefix changes nothing, exits with code 2 and lists the candidates; with several references all are resolved before anything is changed. Scripts should use full ids from --json. ot rm is a soft delete: the task becomes a tombstone that still appears in the export.
A task that is already in the requested state (ot done on a completed task, ot reopen on an open one) is reported as unchanged, keeps its completion time and nothing is sent; the command still exits 0. ot edit with values equal to the current ones sends nothing either.
Subtasks#
ot add "Book hotel" --parent 3f1d # a subtask, in its parent's project
ot edit 8c2a --parent 3f1d # put an existing task under another one
ot edit 8c2a --parent none # back to the top level
ot list --parent 3f1d --json # the direct subtasks of 3f1d
ot done 3f1d # complete it and its open subtasks (unless you keep them)
ot done 3f1d --subtasks=false # complete only the task
ot rm 3f1d --subtasks # delete it and its subtasks
ot edit 3f1d --project Work --subtasks # move it and its subtasks
--parent takes an open task by id or unique id prefix. Without --project, ot add puts the subtask in its parent's project (or its Inbox). A completed parent, or a --project that is not the parent's, exits 2 before any request. With ot edit, a parent in another project moves the task to that project in the same request. The server refuses a deleted parent and a parent that is the task itself or one of its subtasks (exit 1, invalid_input), and nothing changes.
ot done completes the open subtasks at every depth too, as the app does, unless you keep open subtasks; --subtasks always completes them and --subtasks=false never does. ot rm and ot edit change only the tasks you name, as the REST API does. Add --subtasks for what the app does:
ot rm --subtasksdeletes all of them;ot edit --subtasks, when the edit changes the project, moves them too.
Each task is its own request: the subtasks before the task for done and rm, after it for edit. --dry-run lists them all, and ot rm asks once for the whole list. ot reopen reopens only the tasks named, like the app.
ot list --project and ot list --inbox print each subtask under its parent, indented, and add the parent's progress (Plan trip 1/3: one of its three direct subtasks done). A subtask whose parent isn't listed, because it is completed for example, is printed at the top level. Other lists stay flat, and --json keeps the position order with parent_id on every task. ot list --parent <ref> lists the direct subtasks of a task and combines with the other list flags (--all adds the completed ones).
One task's details#
ot task show 8c2a # title, due date, deadline, location, parent, subtasks and reminders
ot task show 8c2a --json # {"task": {…}, "reminders": [{…}], "subtasks": [{…}]}
ot task show <ref> prints a task with its due date, deadline, location, its parent path (Parent: Plan trip › Book hotel), its subtasks with their progress, and your reminders, one per line: "30 minutes before the due time", "At 2026-10-13 09:00", and location reminders as "When I arrive at Post office (150 m)" or "When I leave Home (300 m)". It only reads, so a read token will do. Location reminders are created in the app or through POST /api/v1/reminders, not with ot.
Repeating tasks ahead#
ot task occurrences 8c2a # today and the 30 days after
ot task occurrences 8c2a --from 2026-10-12 --to 2026-10-18 --json
ot task occurrence 8c2a 2026-10-19 skip # skip one occurrence
ot task occurrence 8c2a 2026-10-14 edit --time 19:00 # move one occurrence alone
ot task occurrence 8c2a 2026-10-15 complete # complete one early
ot task split 8c2a --from 2026-10-14 --time 19:00 # 19:00 from Wednesday on
ot task occurrences <ref> lists a repeating task's current occurrence and the projected ones after it in a range, as a table of DATE, TIME and STATE (current, projected, or open, done and skipped for an occurrence that has a record). --from and --to take YYYY-MM-DD, today, yesterday or a weekday; the range is at most 366 days and lists at most 31 projected dates. The dates are the ones the app draws on the calendar (GET /api/v1/tasks/{id}/occurrences); it only reads, so a read token will do. A task without a rule exits 1 with not_recurring.
ot task occurrence <ref> <date> complete|skip|edit acts on one occurrence alone (one occurrence alone): complete and skip that date, edit moves it (--due <day>, --time HH:MM or none) or renames it (--title); a new day without --time keeps the series' time. <date> takes YYYY-MM-DD, today, tomorrow or a weekday. It prints the occurrence's record (--json: the task). A date that is not an occurrence exits 1 with not_an_occurrence. It writes through POST /api/v1/tasks/{id}/occurrences/{date}/complete and its siblings, so it needs a full token.
ot task split <ref> --from <date> changes a repeating task from one of its later occurrences on (This and following): --time HH:MM (or none), --rule <rule> and --title <text> give the change, at least one of them. The task ends the day before --from, and the new task that continues it is printed (--json: the task). The current occurrence, or a date that is not an occurrence, exits 1 with not_an_occurrence. It writes through POST /api/v1/tasks/{id}/split, so it needs a full token.
Projects#
ot project list [--all] # --all includes archived projects
ot project add "Garden" [--color "#22c55e"] [--idempotency-key <key>]
ot project rename Garden "Back garden"
ot project edit Groceries --reusable --aisles # a reusable list; --no-reusable, --no-aisles turn it off
ot project move Garden --workspace Family # only the project's owner
ot project archive Garden [--undo]
ot project rm Garden [--yes]
In a reusable list, ot add Milk --project Groceries reopens a ticked-off Milk instead of adding a second one, or finds it already open; it prints the item's id and says "reopened" or "already on the list" on stderr. --new always adds a new task.
Projects are referenced by name (case-insensitive), full id or unique id prefix. ot project list shows every workspace's projects with a WORKSPACE column and each project's FLOW (parallel, sequential or area, see Sequential projects and areas), and STATUS archived or maintenance (Review intervals and maintenance); --workspace narrows it to one.
Notes#
Notes from the shell: standalone notes, the notes of tasks and the notes of projects, read and written as Markdown.
ot notes # every note, newest change first (same as ot notes list)
ot notes list --source task --project Home # note, task, project or all; --standalone is --source note
ot notes list --label work --limit 20
ot notes search plumber # every word in the title or text, title matches first
ot notes show 3fa1 # the text, then text appended that no device merged yet
ot notes links Trip # what the note links to and what links to it
ot notes add "Wi-Fi" --project Home --label home --body "- network: home" [--idempotency-key wifi-1]
ot notes add "Meeting" --body-file agenda.md # or --body-file - for standard input
ot notes edit 3fa1 --title "Wi-Fi at home" --project none --label none
ot notes edit 3fa1 --body-file notes.md # replaces the text, see below
ot notes append Meeting "- decided: ship Friday" # adds at the end, replaces nothing
ot notes rm 3fa1 [--yes] # to the Trash
ot notes to-task "Call the plumber" # a task with the note's title, text, project and labels; prints its id
ot task note 8c2a # a task's note as Markdown
ot task note 8c2a --set "New plan" | --file plan.md | --file - | --append "- called, no answer" | --clear
A note <ref> is a full id, a unique id prefix, a title (ignoring case) or a unique title prefix; an ambiguous one changes nothing and exits 2 with the candidates. ot notes show accepts the id of a task or project note from the list too; edit, append, rm and to-task act on standalone notes, and ot task note on a task's note (a task id, unique id prefix or title). The list prints KIND (note, task, project; task (done) and project (archived) are marked), id prefix, title (Untitled note when a note has none), project and when its text last changed; ot notes search adds a MATCH column with the text around the first match. Search runs on your machine over the notes the server returned, with the matching of the app: every word must occur in the title or the text, case and accents ignored, a quoted phrase as one, OR in capitals between alternatives and title: or text: to look in one field (ot notes search 'ferry OR train'); title matches first. ot notes links <ref> (a note, or a task or project, with or without a note) prints two lists: what its text links to ([Title](?note=<id>), ?task=, ?project=; (not found) for something missing, in the Trash or not yours) and the notes that link to it, newest change first. It is worked out on your machine from the notes the server returned, so it works with an unlocked encrypted account; a locked one stops with encryption_enabled (exit 5).
Text is Markdown. What a note shows is its text followed by anything appended that no device has merged into it yet; the next device that opens the note turns the Markdown into formatted content. A replacement (edit --body, edit --body-file, task note --set, --file and --clear) carries the version ot read: when someone changed the note in the app after that (or another write came first), the server refuses it with body_changed, exit 1, and nothing changes. Read it again and retry. An append (ot notes append, ot task note --append) never replaces anything, so it is safe while someone edits the same note on a phone: every device adds the text at the end once. A note holds at most 100 appends no device has merged yet (too_many_appends). ot task note takes one of --set, --file, --append and --clear per call; two exit 2 before anything is sent.
Every write supports --dry-run and is refused by --read-only; rm needs --yes off a terminal and with --json, like ot rm. Note writes go through the REST routes and need a full token: a read token reads only, and an agent token writes notes through MCP instead (ot task note --set on a task it may edit is allowed). The CLI is online: a write reaches the server, then every device on its next sync.
On an end-to-end encrypted account ot notes and ot task note decrypt on your machine after ot encryption unlock, and seal every title, text and append for its note or task before sending, as ot vault does (a new note is created first and its sealed title and text written right after, since a sealed value names its note's id; to-task seals the title, text and document for the task id it chose). Without the key the list shows (encrypted), show says the note is encrypted, and text writes stop with encryption_enabled, exit 5, before anything is sent; rm and project or label changes still work. Labels named with --label must exist on an encrypted account (ot would otherwise send the new name readable). to-task refuses a note with appends no device has merged yet: open it in the app once, then run it again.
Time#
Time tracking from the shell: start and stop a running entry, log past work, list and export entries.
ot time start 8c2a [--note "review"] # stops the running entry first
ot time stop # exit 1 when nothing runs
ot time status # your running entry; a Focus session adds its timer, session and planned end
ot time log 8c2a 1h30 --on yesterday --note "review"
ot time log 8c2a --from 09:00 --to 09:25 [--on 2026-10-12]
ot time list --from 2026-10-12 --to 2026-10-18 [--task 8c2a] [--running] [--limit 50]
ot time export --from 2026-10-12 --to 2026-10-18 -o week.csv
A duration is 45m, 1h30, 1.5h or 90 (minutes); anything else exits 2 before a request. Without --on a duration ends now; on another day (--on yesterday, a weekday meaning the last one, or YYYY-MM-DD) it ends at 17:00 local time. --from and --to are times on that day. start, stop and log write, so --dry-run, --read-only and token scope apply: a read token exits 5 (insufficient_scope) before anything is sent, while list and export work with it. ot time list prints the id prefix, day, 09:00–09:25, duration, task and project, newest first; --json prints the time_entry objects (endedAt: null while running). ot time status prints your own running entry, or "Nothing running." (on a Focus break or pause too), and for a Focus work session a line such as Pomodoro, session 3, ends 10:25; it reads, so a read token works, and --json prints time_running, the answer of GET /api/v1/time-entries/running. ot time export downloads the server's CSV for those local days in your time zone; with -o and --json it reports the file and the row count. A weekly export for cron:
0 18 * * 5 ot time export --from monday --to today -o "$HOME/time/week-$(date +\%F).csv"
Routines#
ot routine (or ot routines) works with routines; a routine is named by its id, an id prefix or its exact name.
ot routine list
ot routine show Groceries # trigger, condition and steps as numbered sentences
ot routine run Groceries --test # plan every step, write nothing
ot routine run "Waiting follow-up" --task 3f2a…
ot routine run "Checkboxes to tasks" --note "Planning meeting" # a routine on a note, by id or title
ot routine runs Groceries --failed --limit 10
ot routine create --file groceries.yaml
ot routine create --project Household --file chores.yaml # a routine of a (shared) project
ot routine edit Groceries --file changes.json # replaces the parts the file gives
ot routine enable Groceries # or disable
ot routine undo Groceries <run-id>
ot routine rm Groceries --yes
A routine file is JSON or YAML with name, trigger, an optional condition, steps (or actions), enabled and an optional project (the project it belongs to, by name or id; --project does the same), in the shapes of the API. Projects, sections, labels, saved views, webhooks and standalone notes (note: Journal, a note's title) may be written by name (project: Errands), and a note trigger's label_id by the label's name; the CLI resolves them before sending and fails naming one that matches nothing (project Erands not found), sending nothing.
name: Groceries
trigger: {kind: schedule, at: "17:00", weekdays: [5]}
steps:
- {id: a, kind: note_text, in: {of: {literal: {project: Groceries}}}}
- {id: b, kind: split_lines, in: {text: {ref: a}}}
- {id: c, kind: create_tasks, in: {text: {ref: b}, project: {literal: {project: Errands}}}}
ot routine list shows each routine's PROJECT and, for a routine of a shared project, RUNS AS (the person who last turned it on, - before anyone did); ot routine show prints both. ot routine run prints each step's status, items and time, and exits 6 when the run failed (with --json, the run record is printed and says at which step). A read token can list, show and read runs but is refused on every other subcommand (exit 5). Saving a routine with a step that is not available prints a warning naming the step and the reason.
Calendar events#
The events your calendar views show, and changing those of a connected calendar with Edit events in OpenTodo on:
ot calendar [--from today] [--to <day>] # id, date, time, title, calendar, whether it can be changed
ot calendar event edit 3f2a --start 2026-11-12T14:00 # a new start alone keeps the length; a date alone keeps the time
ot calendar event edit 3f2a --title "Planning" [--end DATETHH:MM] [--all-day] [--on <day>]
ot calendar event delete 3f2a [--yes]
edit and delete find the event by id or id prefix within 45 days of today, or of --on. Times you type are wall-clock times in the event's own time zone, the one ot calendar prints beside them, not your computer's; a floating event stays floating. Changing and deleting need a full token: a read or agent token is refused before anything is sent (exit 5), as are event_edits_off and calendar_read_only; event_changed (the event changed in your calendar since), event_not_editable, event_gone and calendar_unreachable exit 1. --json prints the calendar_event objects; titles are written by people.
Calendar frames#
Your frames, the recurring background windows of the Day and Week calendar:
ot frames # id, title, days, time, planning source
ot frames add "Deep work" --days mon-fri --from 09:00 --to 11:00 [--color "#3b82f6"] [--source label:<id>]
ot frames rm 7f3a [--yes] # an id, id prefix or the exact title
--days takes mon-fri, mon,wed,fri, weekdays, weekend, daily or ISO digits (1 Monday to 7 Sunday); without it a frame repeats on weekdays, from 09:00 to 10:00. The end must be after the start on the same day; the server refuses anything else with invalid_input (exit 1). --source is the list the app opens with Plan from this frame: project:<id>, label:<id> or view:<id>. add and rm write, so --dry-run, --read-only and token scope apply (a read or agent token exits 5). --json prints the frame objects; an encrypted account's titles are ciphertext and the table shows (encrypted).
Calendar slots#
Your slots, blocks of the Day and Week calendar that hold a checklist of small tasks:
ot slots [--from monday --to friday] # id, title, date, time, number of tasks
ot slots add "Admin" --date 2026-11-04 --at 16:00 --for 45m [--color "#14b8a6"]
ot slots put 7f3a 9c1e 4b20 # a slot (id, id prefix or title), then tasks
ot slots rm 7f3a [--yes] # its tasks stay on that day without a time
--date takes YYYY-MM-DD, today, tomorrow or a weekday name (default today); --for a length from 15 minutes to 8 hours in 15-minute steps (default 30m). put adds the tasks at the end of the slot and, in the same batch, sets each one's date to the slot's day without a time and takes it out of your other slots of that day; a slot holds at most 20 tasks, and a task you may not edit (a viewer of its project) is refused with forbidden and nothing changes. add, put and rm write, so --dry-run, --read-only and token scope apply (a read or agent token exits 5). --json prints the slot objects; an encrypted account's titles are ciphertext and the table shows (encrypted).
Objectives#
Your quarterly and weekly objectives, a few short lines per period:
ot objectives [--quarter|--week] [--period 2026-W45] # this quarter's and this week's by default
ot objectives add "Draft the talk" --week [--next] # --quarter or --week; --next for next quarter or week
ot objectives done 3fa1 # an id or id prefix
ot objectives undone 3fa1
ot objectives edit 3fa1 --title "Give the talk"
ot objectives delete 3fa1 [--yes]
Weeks are ISO weeks starting on Monday, taken from this machine's date. A period holds at most 5 open objectives: a sixth exits 1 with too_many_objectives. add, done, undone, edit and delete write, so --dry-run, --read-only and token scope apply (a read or agent token exits 5). --json prints the objective objects. On an encrypted account titles are decrypted after ot encryption unlock and print as [encrypted] otherwise; adding or editing a title needs the key (exit 5 encryption_enabled without it).
Habits#
ot habits # open habits with kept, strength and streak
ot habits show Run # one habit's last 31 days, states and notes
ot habits log Run --note "5k" # today done; --tiny, --skip or --clear, --date yesterday
The numbers are the server's, the same as every device's after sync. Each command takes --json.
Issue connections#
Your issue import connections, once the server owner has turned the feature on:
ot issues list # id, name, provider, host, state, last poll, tasks; never a token
ot issues list --json # the connections as the API returns them, with token_set
ot issues sync 7f3a # poll one connection now: created 3, completed 1, reopened 0, renamed 2
ot issues sync # every enabled connection
ot issues sync 7f3a --dry-run # print the request, run nothing
ot issues sync writes, so --read-only and a read or agent token refuse it before any poll (exit 5). It exits 5 with issues_disabled while the owner has not enabled issue connections, and 1 when a connection is stopped (connection_stopped), the provider's rate limit applies (provider_rate_limited), the hourly limit of 12 checks and syncs is reached (rate_limited) or the poll fails (poll_failed). Connections are added and changed in Settings → Integrations → Issues.
Audit log#
For the server owner: check that the audit log was not changed outside OpenTodo.
ot audit verify # Audit chain intact: 1203 events checked, newest 8512. Head: 8512 9f2c…
ot audit verify --json # {ok, checked, uncovered, checkpoint, head, break}
It exits 1 with audit_chain_broken and names the first broken event when an event was changed, removed or moved, and 5 (forbidden) for anyone but the owner. Keep the head somewhere else to notice later rewrites; see Keep an anchor outside the server.
Tokens and export#
--limit-to <workspace> (a name or id, repeatable) limits the token to those workspaces (token-workspaces): it reads and changes only them, and routes over the whole account refuse it. --scope is full (the default), read or agent; anything else exits with code 2 before a request is sent. Creating a token is a credential route: ot token create needs an admin token in the profile (the token ot login stores is full, so run ot login again to mint a new one, or create it in Settings → Integrations → API tokens). An admin token can only be created in the web app, from a recently confirmed session; with it, scripts can also manage second factors, other tokens, app passwords, accounts and server secrets. A full token gets exit 5 (insufficient_scope) on those routes. An agent token is for an AI assistant: it reads everything and can create and edit tasks, projects, sections, labels, comments, reminders and time entries (through the MCP write tools or ot, see Using ot from an agent), and only while both assistant switches are on (the owner's and yours, in Settings → Integrations → AI assistants).
ot token list # with each token's scope
ot token create backup-script # prints the secret once, with a notice on stderr
ot token create work-assistant --scope agent --limit-to Work # reaches only the workspace Work
ot token create reporting --scope read # read-only: refused on every change
ot token create desk-assistant --scope agent # for an AI assistant that may make changes
ot token revoke backup-script --yes # by name, id or id prefix
ot export # full JSON export (including tombstones) to stdout
ot export --out opentodo-$(date +%F).json
Import#
ot import <file> sends a file to the server's importer, the same one as Settings → Data → Import data: an OpenTodo export, a CSV file or another app's export (the formats). It starts the job, waits until it has finished and prints what was created, skipped and failed; --json prints the job (schema import_job). With --dry-run it only asks for the preview, which writes nothing, and prints its totals and notes (in --json, under preview in the dry-run document).
--workspace (or OPENTODO_WORKSPACE, or the profile's workspace) chooses the workspace the import goes into. Without one, the server's default applies: the default workspace, or an OpenTodo export's own workspaces.
ot import todoist-backup.zip --workspace Work --dry-run # what would happen
ot import todoist-backup.zip --workspace Work # import, wait, print the counts
ot import tasks.csv --duplicates import --time-zone Europe/Rome
ot import opentodo-export.json --existing overwrite # restore, keeping the export's workspaces
--format forces a format id instead of detection (ot import --help lists them; for example notion-csv for a single Notion CSV, which is never detected), --existing skip|overwrite applies to an OpenTodo export, --duplicates skip|import to possible duplicates, and --time-zone (default: this machine's zone) to date-times written with a zone. Imports need a full or admin token: read and agent tokens and read-only mode exit 5 before the file is sent. A failed job exits 1 with import_failed; undo an import in the app under Past imports.
MCP bridge and encryption#
ot mcp bridges an MCP client that only speaks stdio (Claude Desktop, Claude Code) to the server's MCP endpoint; see MCP for the client configuration. It starts with a read token, or an agent token for an assistant that may make changes through the server's write switches; a full token needs --allow-full-token, and --read-only accepts only a read token.
For an account with end-to-end encryption, ot mcp --decrypt lets that assistant read and write your text: it decrypts results and encrypts what the assistant writes on your computer, with the account key stored by ot encryption unlock. The server still receives only ciphertext; your AI provider receives the plaintext, and the bridge says so on stderr when it starts.
ot encryption unlock # asks for the encryption passphrase, no echo
ot encryption unlock --recovery # or the recovery key
ot encryption unlock --passphrase-file ~/.otpass
ot encryption status # locked, unlocked, stale or not_encrypted
ot encryption lock # delete the stored key
ot mcp --decrypt # the bridge, decrypting on this machine
ot encryption unlock fetches the wrapped key record with the profile's token, checks its key-derivation settings as devices do, unwraps the key locally and stores it with its key version in an owner-only file (keys/<profile>.json next to the configuration file, the same protection as the token). The passphrase, the recovery key and the key itself are never sent or printed. After 5 failed attempts within a minute it waits before trying again. A passphrase with accented or other non-ASCII characters may need --recovery, since ot does not normalise Unicode the way the browser does. Lock the key on a shared machine.
The note tools work through the bridge too: create_note, update_note and append_to_note have their text sealed here (an append for the field of the append id the bridge chooses), list_notes, get_note and the opentodo://notes resources come back decrypted, and the bridge answers search_notes itself: it reads the notes with list_notes, decrypts them and matches the query on your machine, so the server never receives it. note_to_task is refused with a pointer to ot notes to-task, which seals the note again for the new task.
ot mcp --decrypt refuses to start, without prompting, when no key is stored or the stored one is out of date (stale: the passphrase or key changed on another device); run ot encryption unlock again. Custom field text and task origins are not encrypted by the bridge: the server refuses them for an encrypted account.
Markdown vault#
ot vault keeps a folder of Markdown files, one per project and one per note in Notes/, in two-way sync with the account; it is the one command group that keeps local state (the files and <dir>/.opentodo/). It is a sync device of its own and needs a full token; with --read-only it pulls and writes the files but sends nothing. A folder another device syncs (another machine, or the Obsidian plugin on a phone) is refused before any request with vault_owned, exit 2; --take-over makes this machine its syncing device. See Markdown vault.
ot vault init ~/Notes/Tasks [--adopt]
ot vault sync [<dir>] [--dry-run] [--read-only] [--take-over] [--json]
ot vault status [<dir>] [--json]
ot vault watch [<dir>] [--take-over]
ot vault notes on|off [--vault <dir>]
ot vault notes works offline and only changes the folder's state: on (the default for a new vault) writes every note on the next sync, off stops syncing Notes/ and leaves its files. See Markdown vault.
Scripting: JSON output and exit codes#
Every command accepts --json. Stdout then holds only JSON, with the same field names as the REST API: an array for lists, the entity for single results, and the error envelope on failure. The shapes are documented as JSON Schemas with an output_version (currently 1, reported by ot version --json and ot schema). Within a version fields are only added; a breaking change would need a new version you opt into.
| Command | --json output (schema) |
|---|---|
list, today, inbox, upcoming |
array of task |
add, edit |
task |
done, reopen, rm |
task_result (one reference) or an array of them: the task plus ref (what you typed) and status (completed, reopened, deleted or unchanged) |
project list / add, rename, archive, rm |
array of project / project |
token list / create / revoke |
array of token / token_created ({token, secret}) / token |
notes list, notes search |
array of note: {kind, id, title, project_id, project, label_ids, updated_at, body_version, encrypted}, search adds snippet ([{text, mark}]) |
notes show, add, edit, task note |
note_text: {kind, id, title, text, appends, body_version, project_id, label_ids, encrypted} |
notes links |
note_links: {kind, id, title, links: [{kind, id, title, available}], linked_from: [{kind, id, title}]} |
notes append, task note --append |
note_append: {entity, entity_id, append_id, body_version} |
task occurrences |
occurrences: {series_id, rule, capped, occurrences: [{date, time?, tz?, state, record_id?, due?}]} |
task occurrence |
task: the occurrence's record |
notes rm / notes to-task |
note_result (the note plus ref and status) or an array of them / task |
any write command with --dry-run |
dry_run |
| any failure | error: {"error":{"code":"…","message":"…","exit":N}} |
On failure the envelope goes to stdout as before (server envelopes keep their code and message; exit is added) and stderr gets one line starting with ot:, so harnesses that only show stderr see what went wrong. Without --json errors go to stderr only.
ot list --json --today | jq -r '.[] | "\(.priority) \(.title)"'
ot add "Nightly backup check" --json | jq -r .id
Exit codes:
| Code | Meaning | What a script should do |
|---|---|---|
| 0 | Success, including "already in that state" | continue |
| 1 | The server rejected the request or failed (its message is printed verbatim) | read error.code; retry only internal or rate_limited |
| 2 | Usage or local validation error (bad flag, invalid priority or date, ambiguous reference, missing configuration, a destructive command without --yes) |
fix the command |
| 3 | Authentication or configuration error (wrong password, revoked token, unreadable config file) | sign in again |
| 4 | The server could not be reached within the timeout (15 s) | retry later |
| 5 | Not permitted: insufficient_scope, forbidden, not_permitted, writes_disabled_by_owner, writes_disabled_by_user, encryption_enabled or read_only |
do not retry; change the token, the switch or the role |
| 6 | ot routine run ran the routine and the run failed |
read the failed step's error in the run record; fix the routine or what it needs |
Machine-readable help: ot schema#
ot schema (or ot help --json) prints every command with its arguments, flags and their types, whether it writes or is destructive, whether it supports --dry-run and --idempotency-key, its output schema, the exit codes, the error codes and every JSON Schema. It is generated from the same table as ot help, needs no configuration and no server, and exits 0 offline.
ot schema | jq '.commands[] | select(.writes) | .name'
ot schema | jq '.schemas.task'
Non-interactive by default#
Without a terminal on stdin and stdout, ot never prompts and colour is off (also with NO_COLOR). The destructive commands ot rm, ot project rm, ot token revoke and ot auth logout then need --yes, and so do they with --json even on a terminal; without it they exit 2 with code confirmation_required before sending any request. On a terminal without --json they ask. ot login reads the password from stdin when stdin is not a terminal.
Dry run#
Every command that writes accepts --dry-run. It resolves references and current values with reads (so an ambiguous prefix still exits 2), validates, and prints the requests it would send and the resolved targets, then exits as a real run would. Nothing that writes is sent, nothing changes on the server or on any device, and the config file is not touched. An unreachable server exits 4.
ot done 8c2a 91f0 --dry-run --json
# {"command":"done","dry_run":true,"requests":[{"method":"PATCH","path":"/api/v1/tasks/8c2a…","body":{"completed_at":1760…}},…],
# "targets":[{"ref":"8c2a","id":"8c2a…","title_preview":"Pay rent","status":"completed"},…]}
A label that ot add --label would create appears as a planned POST /api/v1/labels, and the planned task refers to it as (planned-1). ot login --dry-run shows the requests of a sign-in (the two-factor step only applies to an account with two-factor authentication) without prompting for the password.
Retry-safe creates#
ot add and ot project add take --idempotency-key <key> (1 to 128 characters of letters, digits and . _ : -), sent as the Idempotency-Key header. Running the same command again with the same key prints the same entity and creates nothing; the same key with different content exits 1 with idempotency_conflict. Because the ids derive from the key, a retry after a timeout converges to one task on every device.
ot add "Buy milk" --idempotency-key run42-milk --json # creates
ot add "Buy milk" --idempotency-key run42-milk --json # same task, nothing new
Read-only mode#
--read-only, or the optional OPENTODO_READ_ONLY=1, makes every write command fail before any request with code read_only and exit 5; reads work as usual. With a read token, ot refuses writes itself (exit 5, insufficient_scope): it learns the token's scope from GET /api/v1/me once per run, before its first write. With an agent token it refuses locally what the server would refuse (for example ot project archive or ot token create); the server checks again regardless.
Cron example#
A nightly export kept for 30 days, using environment variables instead of a config file:
# m h dom mon dow command
0 3 * * * OPENTODO_URL=https://todo.example.com OPENTODO_TOKEN=ot_… /usr/local/bin/ot export --out /backups/opentodo-$(date +\%F).json && find /backups -name 'opentodo-*.json' -mtime +30 -delete
Or add a reminder task every Monday morning:
0 8 * * 1 OPENTODO_URL=… OPENTODO_TOKEN=… /usr/local/bin/ot add "Weekly review" --due today --time 17:00 --priority 2 >/dev/null
Limits#
- Online only, apart from
ot vault: no offline queue, no local cache. Offline capture is what the web app and PWA are for. --dueunderstands a fixed set of words; the natural-language quick-add grammar lives in the web client.- Rate limits on
auth/loginapply (10 per minute per address);ot auth set-tokenavoids them entirely. - Shell completion covers bash, zsh and fish; there is no PowerShell script.
Using ot from an agent#
ot is a dependable tool for coding agents and automation harnesses. The short version, which the skill file below spells out for the agent itself:
- Give the agent an
agenttoken, not a full one: create it in Settings → Integrations → API tokens (orot token create "my assistant" --scope agentwith an admin token in your profile), then on the agent's machineot auth set-token <token> --server <url>. Turn on Assistants may make changes (owner) and Changes to my tasks (you) in Settings → Integrations → AI assistants. With that tokenotcan list everything and create and edit tasks, projects, labels and comments, archive projects (ot project archive), track time (ot time start,stop,log;ot time startexits 1 withtimer_runningwhile another of your timers runs, so it never takes over a Focus session), complete and reopen tasks, and move to the Trash only tasks the same token created. Writes carry the deviceagent:<token-id>, show in history as "AI assistant (token name)", are audited asagent.writeand share the token's limits with MCP. Tokens, settings, sharing, members, encryption, imports and backups stay out of reach (exit 5).ot auth statusshows the scope and whether writes are allowed right now. Afulltoken works too, with everything that implies; areadtoken for an agent that only looks. - Use
--jsoneverywhere, andot schemato discover commands and output shapes. - Use
--dry-runbefore a write that touches more than one task, and--idempotency-keyon creates. - Handle exit codes: stop and ask on 3, do not retry 5, retry 4 later.
- Off a terminal, destructive commands need
--yes. --read-only(orOPENTODO_READ_ONLY=1) for an agent that must never change anything, whatever its token allows.
The agent skill file#
ot skill prints SKILL.md, a skill file that teaches an agent to use ot carefully: read first, always --json, preview with --dry-run, retry-safe creates, stop on exit 5, never run token, auth or export commands unless asked, and treat task titles, descriptions and comments as untrusted data rather than instructions. It is embedded in the binary, so it always matches the version you run, and every release also ships it as opentodo-agent-skill.zip (a folder opentodo-cli/ with SKILL.md) next to the ot-<os>-<arch> binaries. Unpack it where your agent harness looks for skills, or save the output of ot skill.
Migrating scripts#
Two changes in this version can affect existing scripts:
--yesoff a terminal.ot rm,ot project rm,ot token revokeandot auth logoutused to proceed silently when stdout was not a terminal or--jsonwas given. They now exit 2 without--yes. Add--yesto scripts that delete on purpose.- Exit code 5. A refusal for scope, role, switch or encryption (for example 403
insufficient_scope) used to exit 1 and now exits 5. Scripts that test for "non-zero" are unaffected; scripts that test for exactly 1 should also accept 5.
--json errors also gained the exit field and a stderr line, and ot done/ot reopen/ot rm add ref and status to each printed task; both are additive.