Todoist Alfred



An Alfred workflow for managing tasks in Todoist

Stars: 188

In this video, I talk about my favourite Mac productivity apps that I use to keep productive. I give a quick overview of Todoist, Notion and Alfred while als. Todoist made my life drastically better, it helped me declutter my brain to focus on the important things. Because of Todoist, I was able to read 15 books in 2 months, learn iOS development and spend more time with my family Todoist. Free; Premium €35,99 / year. Since I'm using Todoist as my main todo app. Todoist Tip: Timeblock your tasks by using Todoist and your Google Calendar in tandem. Set a custom event duration for a Todoist task by adding 30m to the task name. When saved, the task will appear as a new Google Calendar event with a duration of 30. Todoist-alfred A workflow to make API requests using keywords to create tasks in a Todoist project, using alfred This workflow allows users to make API calls to Todoist, using Alfred, with the primary function being to create new tasks with pre-assigned rules. For example, for a work project, I might create a workflow that allows me to.


Add and search Todoist tasks straight from Alfred. It uses Todoist stable v1REST API.

Getting startedInstallationConfigurationUsageContributing

Getting started

For this workflow to work you need:

  • Alfred version 3.x or 4.x and a powerpack licence.
  • Node.js version 10.x or up

Note that the workflow expects node to be installed in the default location(s), i.e. /usr/local/bin or /usr/bin. See installation notes below on how to make the workflow work with non-standard node installations.

Installation

Download and import workflow.

Non-standard node installation

If you have installed node.js in a non-standard way (e.g. through nvm or homebrew), you may need to do either of the following to make the workflow work:

Create symlink to current node version:

  1. In the terminal, navigate to /usr/local/bin
    cd /usr/local/bin
  2. Create symlink to current node version
    ln -s $(which node) node
    (note, if you’re using a different shell – fish, zsh, etc. – you may need to make slight changes to make the command work).

This method should work with different versions of nvm (including changing to other versions), as long as you don’t remove the symlinked node version (or the symlink itself of course).

The downside is having problems switching between versions because most processes will default to the symlinked version.

Manually add node path to the workflow:

  1. In the terminal, reveal the path to your node installation
    which node
  2. Copy the output, but omit the executable
    (e.g.
    /Users/{user}/.nvm/versions/node/v11.6.0/bin, not
    /Users/{user}/.nvm/versions/node/v11.6.0/bin/node)
  3. Navigate to the workflow in Alfred Preferences
    Alfred Preferences -> Workflows-tab
  4. Click “Configure workflow and variables” in the top right corner and edit the node_path variable with the node path followed by a colon i.e.
    /Users/{user}/.nvm/versions/node/v11.6.0/bin:

Todoist Alfred Workflow

Observe, variable will have to be updated whenever node version changes.

Node flags

If you need to enable any node.js command-line flags, you can with

  1. Navigate to the workflow in Alfred Preferences
    Alfred Preferences -> Workflows-tab
  2. Click “Configure workflow and variables” in the top right corner and edit the node_flag variable with the command-line flag i.e. --experimental-worker --experimental-modules

Debug

If the workflow doesn’t work as expected, perform the following to get a clue about the issue:

  1. Navigate to the workflow in Alfred Preferences -> Workflows-tab
  2. Enable Debug mode (button in the top-right corner of the screen)
  3. Watch for messages in the bottom log-pane when using the workflow.

If the error messages outputs node errors, either make sure you have the appropriate node version or follow the steps above to enable the workflow with a non-standard node installation.

Configuration

NameNotationExplanation
token^[0-9a-fA-F]{40}$ (default empty)The todoist API token.
languageen, da, pl, zh, ko, de, pt, ja, it, fr, sv, ru, es, nl (default en)The language for natural language date processing (by todoist) and to calculate time to complete a task.
_cachetimeoutA positive number (default 3600, an hour)The time (in seconds) until the cache is refreshed (until that time todoist information is stored locally to make things a little faster)
_anonymousstatisticstrue or false (default true)Doesn’t do much at the moment but I intent to use it to track installs

todo:setting token {api token}

Example: todo:setting token 2d2e2a334c5f36e7a7c43b46e

todo:setting language {language}

Example: todo:setting language nl

todo:setting cache_timeout {time in seconds}

Example: _todo:setting cachetimeout 13

todo:setting anonymous_statistics {true or false}

Alfred 3 Todoist

Example: _todo:setting anonymousstatistics false

Usage

NameNotationExplanation
taskAny text except ,The task title.
dateA date stringSee the Todoist documentation for supported date formats.
projectEither #personal or #[next actions]Use either the hashtag notation or bracket notation if the project name has spaces in it. The project name is case sensitive.
label@labelLabel names can’t contain any whitespace characters. Labels are case insensitive.
priorityEither p2 or !!2A value between 1 (urgent) and 4 (normal)

Search for tasks

todos {query}

Query

Any search query one character or longer. Uses fuzzy search to find the tasks.

Example: todos car => returns (because of fuzzy search):

  • Rentcar
  • Newcatrecipe’s
  • Cut Grass tomorrow

Create task

todo {task}, {date}

Todoist Alfred

Example: todo Get things done, tomorrow @ 9
Example: todo Build tree house #home !!2 @15min, tomorrow @ 9

Important

For date parsing the work the date needs to be the only thing after the comma.

The reason for this is that multilanguage date string parsing is hard, and Todoist has already solved this problem. But in order to have Todoist read the date the workflow needs to present it a string that holds just the date. The workflow does this by having the date string between a comma and the end of the string.

Documentation

Read the docs.

Changelog

View CHANGELOG.md

Contributing

Instructions

  • Fork and clone the repo

    git clone https://github.com/YOUR-USERNAME/alfred-worflow-todoist

  • Install dependencies

    npm install

  • Symlink to project workflow folder

    npm run setup:dev

Build

Create a new build with

npm run build

Create a distributable package (.alfredworkflow) after the build step with

npm run build:workflow

Run tests

Alfred Workflow Todoist

Run Jest test suite with:

Todoist Alfred

npm run test
npm run test:prod

Or run a watcher with

npm run test:watch

Commits

For commits I follow the angular commit guidelines and use semantic release to automate builds, semver version updates and changelog creation. The way to make sure this all works is to run:

npm run commit

Which guides you through the motions

Code of conduct

License

License MIT © Martien Oranje