Skip to content

devoc09/gtodo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gtodo

A command line tool for using Google Tasks basic actions.

Installation

if you have a Go env

  • Use Makefile or self build

Author's env go version go1.15.3 darwin/amd64

Set up

credentials.json, token.json and config.yaml are required

  1. make and download credentials.json from Google Tasks API Go quickstart(Details on how to do exactly that can be found there.)
  2. make dir ~/.config/gtodo and move credentials.json to ~/.config/gtodo/
  3. $ gtodo login or other command download token.json automatically to ~/.config/gtodo
  4. make config.yaml into ~/.config/gtodo/
# config.yaml
listid: foobarbuz # <- write your default TODO Task List ID.

you can check the TODO List ID with the $ gtodo lists show

Usage

Show TODO Lists

$ gtodo lists show
TODO Lists:
ListsName (your list id)

Create TODO List

$ gtodo lists create -t new_todo_list
Created TODO List!! new_todo_list

$ gtodo lists show
TODO Lists:
Main (your list id1)
new_todo_list (your list id2)

Show Tasks (you can only see one list of tasks)

$ gtodo tasks show
[1] task1
  Note:
  Status: needsAction
  Due: Date not set
[2] task2
  Note: sample description
  Status: needsAction
  Due: Date not set
[3] task3
  Note:
  Status: needsAction
  Due: 2021/4/20 00:00:00

Create Task

$ gtodo tasks add
InputTitle:: task4
InputNote(press enter skip)::
InputDueDate(ex. 2021-04-01)(press enter skip)::
task4 created
$ gtodo tasks show
[1] task4
  Note:
  Status: needsAction
  Due: Date not set
[2] task1
  Note:
  Status: needsAction
  Due: Date not set
[3] task2
  Note: sample description
  Status: needsAction
  Due: Date not set
[4] task3
  Note:
  Status: needsAction
  Due: 2021/4/20 00:00:00

Delete Task

$ gtodo tasks rm
[1] task4
  Note:
  Status: needsAction
  Due: Date not set
[2] task1
  Note:
  Status: needsAction
  Due: Date not set
[3] task2
  Note: sample description
  Status: needsAction
  Due: Date not set
[4] task3
  Note:
  Status: needsAction
  Due: 2021/4/20 00:00:00
✔ Input Task Num:: 1
Deleted: task4
$ gtodo tasks show
[1] task1
  Note:
  Status: needsAction
  Due: Date not set
[2] task2
  Note: sample description
  Status: needsAction
  Due: Date not set
[3] task3
  Note:
  Status: needsAction
  Due: 2021/4/20 00:00:00

Mark up as Done

$ gtodo tasks done
[1] task4
  Note:
  Status: needsAction
[2] task1
  Note:
  Status: needsAction
  Due: Date not set
[3] task2
  Note: sample description
  Status: needsAction
  Due: Date not set
[4] task3
  Note:
  Status: needsAction
  Due: 2021/4/20 00:00:00
Input Task Num:: 1
Mark up as complete: task4
$ gtodo tasks show
[1] task1
  Note:
  Status: needsAction
  Due: Date not set
[2] task2
  Note: sample description
  Status: needsAction
  Due: Date not set
[3] task3
  Note:
  Status: needsAction
  Due: 2021/4/20 00:00:00

Get token.json automatically

$ gtodo login

Thanks