Because if you want to be productive, you should not track tasks in two places. Habitica is great for tracking habits, Todoist for tracking TODOs. Now you can get the best of both.
Tasks are not added immediately. Only when you finish a task in Todoist, new task will be created in Habitica, finished and immediately deleted. So you won't see any Todoist tasks in Habitica but still get the rewards.
- Scores points in Habitica when Todoist task is finished.
- Works for repeated tasks in Todoist, as long as the date string contains
every
. - To form a positive habit of prioritizing long term tasks, difficulty in Habitica is assigned by priority in Todoist. The priority is them assumed to match Eisenhower Matrix quadrants.
Todoist Priority | Habitica Difficulty | Eisenhower Quadrant |
---|---|---|
p1 | Medium | Important, urgent |
p2 | Hard | Important, not urgent |
p3 | Easy | Not important, urgent |
p4 | Trivial | Not important, not urgent |
- Open terminal
- Make sure
git
is installed:The output should look something like:git --version
git version 2.25.1
- Make sure Python 3.10+ is installed:
The output should look something like:
python --version
Python 3.10.1
- If it shows
2.7.x
instead, trypython3
instead and use it in the rest of the guide. - If it shows
3.9.x
or lower, usepyenv
to install a higher version of Python on your system.
- If it shows
- Make sure
poetry
is installed:The output should look something like:poetry --version
Poetry version 1.1.5
- Clone this repository:
git clone https://github.com/radeklat/todoist-habitica-sync.git cd todoist-habitica-sync
- Copy the
.env.template
file into.env
file:cp .env.template .env
- Edit the
.env
file, fill all missing values and/or change existing ones to suit your needs. - Install all application dependencies:
poetry install --no-dev
- Run the app:
poetry run python src/main.py
- Open terminal
- Make sure
docker
is installed:The output should look something like:docker --version
Docker version 20.10.5, build 55c4c88
- Create a base folder structure for the service:
mkdir -p todoist-habitica-sync/.sync_cache cd todoist-habitica-sync chmod 0777 .sync_cache # Download .env file template curl https://raw.githubusercontent.com/radeklat/todoist-habitica-sync/master/.env.template --output .env
- Edit the
.env
file and fill the missing details. - Run the container:
This configuration will run the service in the foreground (you need to keep the terminal open) and always use the latest version.
docker run \ --pull always --rm --name todoist-habitica-sync \ --env-file=.env \ -v $(pwd)/.sync_cache:/usr/src/app/.sync_cache \ radeklat/todoist-habitica-sync:latest
- Change
latest
to a specific version if you don't always want the latest version or remove the--pull always
flag to not update.
- Change
Add --detach
flag to run in the background. You can close the terminal, but it will not start on system start up.
- To see the log of the service running in the background, run
docker logs todoist-habitica-sync
- To stop the service, run
docker container stop todoist-habitica-sync
You can use the above mentioned docker image to run the sync as a service on server or even your local machine. The simples way is to use docker compose:
- Make sure you have
docker
anddocker-compose
installed:The output should look something like:docker --version docker-compose --version
Docker version 20.10.5, build 55c4c88 docker-compose version 1.28.5, build unknown docker-py version: 4.4.4 CPython version: 3.8.5 OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
- Download the example compose file:
mkdir -p todoist-habitica-sync/.sync_cache cd todoist-habitica-sync chmod 0777 .sync_cache
- Download a compose file and an example .env file:
BASE_URL=https://raw.githubusercontent.com/radeklat/todoist-habitica-sync/master curl $BASE_URL/.env.template --output .env curl $BASE_URL/docker-compose.yml -O
- Edit the
.env
file and fill the missing details. - Run the service:
This command will run the service in the foreground (you need to keep the terminal open) and always use the latest version.
docker-compose up
- Change
latest
to a specific version if you don't always want the latest version.
- Change
Add --detach
flag to run in the background. You can close the terminal. The service should start on system start up.
- To see the log of the service running in the background, run
docker-compose logs todoist-habitica-sync
- To stop the service, run
docker-compose stop todoist-habitica-sync
-
Open terminal
-
Navigate to the project repository:
cd todoist-habitica-sync
-
Update the source code:
git pull
-
Update application dependencies:
poetry install --no-dev
-
Run the application again.
If you used the latest
tag, run docker-compose pull todoist-habitica-sync
.
Optional
See "user_id" mentioned in a link under "Calendar Subscription URL" at https://todoist.com/prefs/integrations. Needed only for shared projects to score points for tasks owned by you.
Required
See https://todoist.com/prefs/integrations under "API token".
Required
See https://habitica.com/user/settings/api under "User ID".
Required
See https://habitica.com/user/settings/api under "API Token", the "Show API Token" button.
Optional, default value: 1
Repeat sync automatically after N minutes.
Optional, default value: .sync_cache/sync_cache.json
Where to store synchronisation details. No need to change.
Sometimes certain changes require to reset the sync cache. The cache holds state information only to allow recovery after an unexpected termination of the program. So it is not needed in between restarts and can be safely remove.
To reset the cache:
- Stop the application.
- Remove the
.sync_cache/sync_cache.json
file or any other location given in theDATABASE_FILE
config option. - Start to application again.
- You should see all existing Todoist tasks loaded again either as
HIDDEN
(finished tasks) orTODOIST_ACTIVE
(not completed yet).
- Synchronise overdue task to cause damage in habitica
- Parse difficulty from string (similar to p0-p4 in Todoist)
- Use @ Todoist labels for difficulty