- Batteries included: no need to install any 3rd party dependency since the plugin is compiled as a static Go binary, with all dependencies inside it already.
- Caching of Google OAuth token: once authenticated you can run things in a head-less way in scripts, via
cron
, etc. - Supported operations:
- Delete all tasks in all lists.
-
Go to Google APIs' console.
-
Click on "Create project" and give it whichever name you like, e.g.:
todotxt-googletasks
-
Click on "Dashboard", and then "Enable APIs and services":
- filter APIs by typing "task" in the search box,
- click on "Tasks API",
- click "Enable".
-
After a few seconds, you should see the message "To use this API, you may need credentials. Click 'Create credentials' to get started.". Click on "Create credentials":
- under "Which API are you using?", select "Tasks API",
- under "Where will you be calling the API from?", select "Other UI (e.g. Windows, CLI tool)",
- under "What data will you be accessing?", select "User data",
- click "What credentials do I need?". You should arrive on a page saying "Create an OAuth 2.0 client ID".
-
Enter
todotxt-googletasks
under "Name", click "Create OAuth client ID". -
Select your email address, enter
todotxt-googletasks
under "Product name" , click "Continue". -
Click "Download". This should download a JSON file with your client ID and client secret in it.
-
Place this file under your home directory (
~
), and rename it to.todo.txt-googletasks_credentials.json
. This is where the addon will look for your credentials.
- Install
docker
- Install
make
That's all folks!
All other tools are packaged in build Docker images (see Dockerfile
) to ensure any machine can build easily, hence avoiding the "it works on my machine" syndrome.
make
make test
Note that the above will not run integration tests. To do so, since one cannot authenticate within the container (no browser), you will need to pass the following environment variables in:
CLIENT_ID
: your Google client ID. This can be found in the JSON file downloaded from Google.CLIENT_SECRET
: your Google client secret. This can be found in the JSON file downloaded from Google.BASE64_ENCODED_OAUTH_TOKEN
: the content of your cached OAuth token,base64
-encoded. The location of this file is printed when runninggtasks
.
export CLIENT_ID=yourid.apps.googleusercontent.com
export CLIENT_SECRET=yoursecret
export BASE64_ENCODED_OAUTH_TOKEN="$(cat /path/to/your/oauth/token | base64 -w 0)"
make \
CLIENT_ID=$(CLIENT_ID) \
CLIENT_SECRET=$(CLIENT_ID) \
BASE64_ENCODED_OAUTH_TOKEN=$(BASE64_ENCODED_OAUTH_TOKEN) \
test
N.B.: using direnv
and an .envrc
file to automatically set and export the above environment variables may be convenient.