Using Todoist as a cloud inbox for GTD in Emacs orgmode
I've been using Emacs' orgmode as my GTD system for the last several months. I migrated from Todoist, and one of the things I missed was integration with other services that make things easy to capture tasks into the inbox.
There are ways to capture org data via email, and this can be a good enough alternative, because most (though not all) services allow some kind of email forward to capture tasks. But, this depends on a complex email setup and would probably work on a single machine.
The main integrations/features I wanted to use were:
- Slack: Todoist has a native app for Slack using which any Slack message can be captured into Todoist as a task.
- Google Assistant: Todoist has integration with Google Assistant which can be used to capture tasks by talking to the google assistant.
- Todoist quick entry on mobile with date recognition: The Todoist apps have a more polished mobile capture system that can be triggered from a widget and can recognize dates using natural language entry.
The workflow would look something like this:
I found an existing Todoist integration for emacs, but it's more suitable for using Todoist as the source of truth for tasks, and keeping a local buffer for operations on it in Emacs.
But, I was able to use it's functions to achieve what I wanted. Here's my elisp:
(use-package todoist)
(defun fetch-todoist-inbox ()
(interactive)
(let ((tasks (todoist--query "GET" "/tasks?project_id=<project_id>")))
(mapcar (lambda (task)
(todoist--insert-task task 1 t)
(todoist--query
"DELETE"
(format "/tasks/%s" (todoist--task-id task))))
tasks)))
Here, the project_id
is the Todoist project id of the project from which tasks have to be imported. This can be found by opening the project in the todoist web app - the project id is the last part of the URL.
The elisp function fetch-todoist-inbox
can be called when in any org buffer (or any buffer actually). It will fetch all tasks in the specified project, insert then into the current buffer, and delete them from Todoist. It can be bound to any keybinding for easy access. Note that it requires setting the todoist token using elisp or an environment variable.
Improvements Ideas
- Show number of un-fetched items in status bar
- Fetch comments and attachments
- Fetch task labels and show as orgmode tags
Interactions
👍 4 likes
↩️ 2 mentions
it really is hard to escape the feeling that almost all advice other than “have one place to enter stuff and then clear things out” is just elaborate procrastination
Oh wow, this is cool. But I feel kind happy that I did not know about emacs-todoist and migrated to org-mode completely :)