Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (44 sloc) 1.67 KB

Gmail GTD Bot

Set of functions managing emails in Gmail according to the GTD rules. Implementation uses Google Apps Script. Code is hosted, authenticated and executed by Google servers.


  • Add/remove labels for a search query.
    Eg. remove S/Next Action from all S/Finished
    Or, label all C/Home P/Cleaning by V/Need To Do
  • Parse labels from a thread subject inside Inbox.
    Like so: #project-name in @context will be done as !na in my *city'
    Will have following labels: `P/project-name, C/context, S/Next Action, L/City
  • Sync with Google Tasks (2-way)
    Maps thread subject from search query to a named task list.
    Completed task adds S/Finished label to the thread.
    Completed thread removes task from the list.


  1. Create new spreadsheet in Google Doc.
  2. Open menu Tools -> Script Editor.
  3. Paste JS version of the code.
  4. Cut first and last line (remove 'module pattern').
  5. Save & run main to authorize.
  6. Add new time based trigger for function main using Triggers menu.

Triggering each 5 mins works safe for me.


See (draft).




  • User docs.
  • Move TODOs to GitHub's issues.
  • Extract in-code TODOs.
  • Sync a task list with a spreadsheet query.
  • Support auto-expired actions after defined amount of time.
  • Support for label wildcards (get all user labels and generate regex/query pattern from this static list).
  • Calendar integration - sync events thou task lists.
  • Better task naming experience - update the name to changes labels.
  • GtdBot object as event emitter (with signals).

License: MIT

Something went wrong with that request. Please try again.