I'd never imagined that I would be using a task manager from the Linux terminal.Using commands to create to-do lists instead of using a cool-looking GUI with color customization options.That's until I came across Taskwarrior.
It's a free, open-source task manager that's also simple to use.But that's the point.It can replace other bloated desktop apps.
Now, I found a way to extend its capability even further.With a developer named bergercookie's syncall project, you can sync Taskwarrior bidirectionally with Google Calendar, Keep, and other popular services.I have a habit of storing my tasks in several places I needed a central system to manage all my tasks Over the years, I've used many apps and services for managing tasks.
Google Keep, Sheets, Asana, ClickUp, and many other complicated task management apps.The thing is, each did something good enough to keep using it.For example, Google Keep is great at quick to-do creation.
ClickUp is great for managing large tasks with multiple subtasks and deadlines.The problem was that I had no way to organize all these tasks across separate apps.I could perhaps use another app to maintain all my to-dos scattered throughout my workflow.
But that just added yet another thing to look after.I needed a system that would sync my task lists across all the task managers I was using.Since Taskwarrior was something I was fond of, I only needed to connect it to the other services.
Luckily, I found out about Syncall.It's a gateway to connect your Taskwarrior tasks to Google apps and other task software.At first glance, the documentation felt like gibberish.
After working through it step by step, I finally synced my tasks with Google Keep and events on Calendar.Syncing Google Calendar and Keep with Taskwarrior Bridging the gap from the comfort of the terminal The first thing I tried was syncing Taskwarrior with my Google Calendar.I had to create a Google Cloud project, enable the Google Calendar API, set up an OAuth client, and more.
The problem is, if you read the syncall documentation alone, you'll get stuck on a lot of steps.Here are the full steps I went through: Install syncall with pipx, using the google and tw extras: pipx install "syncall[google,tw]".If syncall complains about missing packages, run pipx inject syncall "setuptools.
Newer setuptools removed a module it needs.Create a project in the Google Cloud console and enable the Calendar API.Set up the OAuth consent screen.
Under Google Auth platform -> Audience, add your own Google account as a test user.Create an OAuth client ID of type Desktop app, then download its JSON file.Run the sync command with --google-secret pointing to that file.
It prints a sign-in link.Open it, approve the access, and the first sync starts.Close I added a task with a remindme tag and a 3 PM due time.
Then I ran tw_gcal_sync -c "TW Reminders" -t remindme --google-secret ~/client_secret.json in the terminal.The client_secret.json file is the JSON file I downloaded from my Google Cloud project.Then I went to my calendar, and the event was indeed created.
My task also showed up there.Now, one catch is that it's not an automatic sync.Your Taskwarrior tasks won't appear on your calendar unless you run the sync command every time.
To make things a bit easier, you can use aliases in the Linux terminal.Google Keep is possible too, but only in one direction Syncall's Keep sync works on one checklist note with Show checkboxes turned on.It syncs each item's text, checked state, and deletion.
While going through the process, I found some roadblocks that a lot of you might not like.Not only is the process cumbersome, but it also relies on a third-party, unofficial library called gkeepapi.As a result, you have to enter your Google username and password for authentication.
I followed the gpsoauth docs.Here's the process: 1.Install syncall with the gkeep and tw extras.
The second line fixes the missing-module error from the setuptools change.pipx install "syncall[gkeep,tw]"pipx inject syncall "setuptools 2.Open the Google EmbeddedSetup page, sign in, and click I agree.
The page may load slowly, so just ignore it.https://accounts.google.com/EmbeddedSetup 3.Copy the value of the oauth_token cookie from your browser.
In Chrome, press F12 and open Application -> Cookies.In Firefox, open Storage > Cookies.Pick the accounts.google.com entry.
The value starts with oauth2_4/.4.Exchange that cookie for a master token with gpsoauth.
My first try returned BadAuthentication, but a fresh cookie worked.Then set GKEEP_USERNAME, GKEEP_TOKEN, and GKEEP_PASSWD as environment variables in the terminal you'll sync from.The password just needs some value.
5.Start Python from the syncall environment.~/.local/share/pipx/venvs/syncall/bin/python 6.
Then paste the lines below.The last argument can be any 16-character hex string.A successful result prints a token that starts with aas_et/.
import gpsoauthr = gpsoauth.exchange_token("[email protected]", "PASTE_OAUTH_TOKEN_HERE", "0123456789abcdef")print(r.get("Token"), r.get("Error")) Exit Python with exit().Then export the variables in the same terminal you'll sync from: export GKEEP_USERNAME="[email protected]"export GKEEP_TOKEN="PASTE_MASTER_TOKEN_HERE"export GKEEP_PASSWD="placeholder" 7.Run tw_gkeep_sync -t keeptest -k "TW Keep Test".
According to syncall's code, it reads your credentials from environment variables or the pass password manager.To try it, add a task with the tag, then sync: task add "Item from terminal" +keeptesttw_gkeep_sync -t keeptest -k "TW Keep Test" Close I know it's quite some setup.But it finally worked for me.
A task I added in the terminal showed up in my Keep note.Then I marked it done and synced again, and Keep showed it as completed.However, an item I created in Keep never reached Taskwarrior.
The sync hit a date error from Taskwarrior 3.5.0, and a missing pass folder caused a second error at the end.That one came after the sync had already finished.So, Keep worked in one direction for me.
gkeepapi says a master token has full access to your Google account, so protect it like a password.My scattered to-dos finally have a home in the terminal That took a lot of time, research, and back-and-forth between my browser and the terminal to finally get it working.But it finally paid off.
I can now manage my tasks and events from the minimalistic terminal, and one sync command handles everything else.Sure, two-way syncing didn't work for me.However, Taskwarrior has now joined my own list of CLI tools I install on every Linux system.
Read More