Giter VIP home page Giter VIP logo

todoist's Introduction

Todoist CLI client

Todoist CLI Client, written in Golang.

Description

Todoist is a cool TODO list web application. This program will let you use the Todoist in CLI.

color image

Demo (with peco)

Add Task

Add task

Close Task

Close task

Usage

$ todoist --help
NAME:
   todoist - Todoist CLI Client

USAGE:
   todoist [global options] command [command options] [arguments...]

VERSION:
   0.18.0

COMMANDS:
     list, l                  Show all tasks
     show                     Show task detail
     completed-list, c-l, cl  Show all completed tasks (only premium users)
     add, a                   Add task
     modify, m                Modify task
     close, c                 Close task
     delete, d                Delete task
     labels                   Show all labels
     projects                 Show all projects
     karma                    Show karma
     sync, s                  Sync cache
     quick, q                 Quick add a task
     help, h                  Show a list of commands or help for one command

GLOBAL OPTIONS:
   --color              colorize output
   --csv                output in CSV format
   --debug              output logs
   --namespace          display parent task like namespace
   --indent             display children task with indent
   --project-namespace  display parent project like namespace
   --help, -h           show help
   --version, -v        print the version

list --filter

You can filter tasks by --filter option on list subcommand. The filter syntax is base on todoist official filter syntax.

Supported filter is here.

e.g. List tasks which over due date and have high priority

todoist list --filter '(overdue | today) & p1'

Config

Config by default stored in $HOME/.config/todoist/config.json

It has following parameters:

{
  "token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", # todoist api token, required
  "color": "true",                                     # colorize all output, not required, default false
  "shortdatetimeformat": "06/01/02(Mon) 15:04",        # golang datetime format, not required
  "shortdateformat": "06/01/02(Mon)"                   # golang date format, not required
}

Install

Homebrew (Mac OS)

$ brew tap sachaos/todoist
$ brew install todoist

AUR

Nix/NixOS

nix-env -iA nixos.todoist

It's important to notice that if you're using NixOS, the cache and config file will be present at your home directory: ~/.todoist.cache.json and ~/.todoist.config.json.

Docker

$ git clone https://github.com/sachaos/todoist.git
$ cd todoist
$ make docker-build token=xxxxxxxxxxxxxxxxxxxx
$ make docker-run

You will be running the next commands from inside the container.

PS: We add a step that is run sync before any command, so you will be always up to date!

Build it yourself

You need go 1.12.

$ mkdir -p $GOPATH/src/github.com/sachaos
$ cd $GOPATH/src/github.com/sachaos
$ git clone https://github.com/sachaos/todoist.git
$ cd todoist
$ make install

Register API token

When you run todoist first time, you will be asked your Todoist API token. Please input Todoist API token and register it. In order to get your API token go to https://todoist.com/prefs/integrations

Sync

After register API token, you should sync with todoist.com by sync sub command, like below.

$ todoist sync

Use with peco/fzf

RECOMMENDED

Install peco and load todoist_functions.sh on your .zshrc, like below.

fish version is here. ka2n/fish-peco_todoist Thanks @ka2n!

If you would prefer to use fzf instead load todoist_functions_fzf.sh like below.

fish version is here. mordax7/fish-fzf-todoist

$ source "$GOPATH/src/github.com/sachaos/todoist/todoist_functions.sh"

If installed via homebrew

If installed via homebrew and using zsh (usually this is added to your .zshrc without the $, usually before loading your ZSH plugin manager):

For peco:

$ source $(brew --prefix)/share/zsh/site-functions/_todoist_peco

For fzf:

$ source $(brew --prefix)/share/zsh/site-functions/_todoist_fzf

TODO: fish + homebrew

keybind

<C-x> t t: select task with peco
<C-x> t p: select project with peco
<C-x> t l: select labels with peco
<C-x> t c: select task and close with peco
<C-x> t d: select date
<C-x> t o: select task, and open it with browser when has url

Enable shell completion

You can also enable shell completion by adding the following lines to your .bashrc/.zshrc files.

# Bash
PROG=todoist source "$GOPATH/src/github.com/urfave/cli/autocomplete/bash_autocomplete"
# Zsh
PROG=todoist source "$GOPATH/src/github.com/urfave/cli/autocomplete/zsh_autocomplete"

Author

sachaos

todoist's People

Contributors

aapit avatar andreoliwa avatar blaradox avatar brualan avatar dotcs avatar dsalahutdinov avatar duckunix avatar dwrdx avatar erikboesen avatar felixlinker avatar gitbluub avatar hacdan avatar hokorobi avatar jacobtomlinson avatar kenliu avatar lindenk avatar mthowe avatar mursts avatar nv1t avatar parroty avatar pniedzwiedzinski avatar remolueoend avatar sachaos avatar squiter avatar strangeman avatar tclinken avatar themaxdavitt avatar ubuntudroid avatar wizeman avatar wjchen-vlsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

todoist's Issues

Not working add task by hotkey

I have a problem when try app tasks by hotkey, todoist add returns the code 127. What does this mean? When I run the bash script from the console/shell - everything works fine.

#!/bin/bash

# Requires:
#   todoist:  https://devhub.io/repos/sachaos-todoist (@see http://onedev.net/post/865)

# Hotkey: Alt+S

TASK_TEXT="$(xsel -o)"

if [[ -z "$TASK_TEXT" ]]; then
    notify-send -t 100 -i /usr/share/icons/gnome/32x32/status/error.png "Ошибка!" "Не задан текст todoist задачи!"
    exit 1
else
    LOG=$(todoist add "$TASK_TEXT")
    
    echo "$?: $LOG" > ~/tmp/log.txt
    exit 
    
    # $? = 127
    # $LOG is empty
    
    if [[ $? != 0 ]]; then
        notify-send -t 100 -i /usr/share/icons/gnome/32x32/status/error.png "Ошибка!" "Не удалось создать todoist задачу!"
        exit 1
    else
        notify-send -t 100 -i /usr/share/icons/gnome/32x32/emblems/emblem-default.png "Сохранено в todoist" "$TASK_TEXT"
    fi
fi

Thanks.

Add ability to move tasks to new project with `mv` command

Becouse of limints 300 tasks per project its very common case to move pack of tasks from one project to anouther.

For example:

  • By default all tasks created in Inbox project, so over time, the free space on this project ends quickly.
  • when the tag is growing and going a separate issue, I want all tasks with that tag to be moved to a new project
  • or many other examples

Now to do all this you need to use the UI.

It would be very convenient to use the command
todoist mv {{ task-id }} {{ project_name|project_id }}
and optional
todoist mv -v -n {{ task-id }} {{ project_name|project_id }}
where
-v Move task in verbose mode
-i Prompt for confirmation before moving task

Find failed

After installing, and adding my Todoist API key, todoist list has empty output. todoist add and todoist sync both return something like this:

panic: Find Failed

goroutine 1 [running]:
github.com/sachaos/todoist/lib.(*Sync).ConstructItemOrder(0xc420118380)
	/Users/primary/go/src/github.com/sachaos/todoist/lib/sync.go:97 +0x79d
github.com/sachaos/todoist/lib.SyncAll(0xc42001bf80, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/primary/go/src/github.com/sachaos/todoist/lib/sync.go:113 +0x337
main.Sync(0xc4200d08c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/primary/go/src/github.com/sachaos/todoist/sync.go:11 +0xa4
main.main.func12(0xc4200d08c0, 0x0, 0xc4200d08c0)
	/Users/primary/go/src/github.com/sachaos/todoist/main.go:224 +0x43
github.com/urfave/cli.HandleAction(0x13e66a0, 0x1484298, 0xc4200d08c0, 0xc42006c600, 0x0)
	/Users/primary/go/src/github.com/urfave/cli/app.go:485 +0xd4
github.com/urfave/cli.Command.Run(0x1469e41, 0x4, 0x0, 0x0, 0xc4201144f0, 0x1, 0x1, 0x146e623, 0xa, 0x0, ...)
	/Users/primary/go/src/github.com/urfave/cli/command.go:207 +0xb6e
github.com/urfave/cli.(*App).Run(0xc4200ecea0, 0xc42000c3c0, 0x2, 0x2, 0x0, 0x0)
	/Users/primary/go/src/github.com/urfave/cli/app.go:250 +0x7d0
main.main()
	/Users/primary/go/src/github.com/sachaos/todoist/main.go:232 +0x14f2

./main.go:20:23: undefined: os.UserHomeDir

I'm on Ubuntu 16.04. I've been really excited to get this up and running, and have tried an awful lot today. I got it working in Docker, but I need it working natively to incorporate it into my workflow.

I finally got a whole bunch of it installed, but then it terminated with this error.

Any idea what could be causing this?

go version outputs:

go version go1.11.11 linux/amd64

I tried go 1.2.2 and that just spat out a whole slew of errors and got nothing done. I feel like I'm closer, for what that's worth! ;)

Make install fails on Fedora 25

[11:29:59] rolle todoist $ make install
go install
main.go:16:2: cannot find package "github.com/spf13/viper" in any of:
	/usr/lib/golang/src/github.com/spf13/viper (from $GOROOT)
	/home/rolle/go/src/github.com/spf13/viper (from $GOPATH)
add.go:9:2: cannot find package "github.com/urfave/cli" in any of:
	/usr/lib/golang/src/github.com/urfave/cli (from $GOROOT)
	/home/rolle/go/src/github.com/urfave/cli (from $GOPATH)
Makefile:3: recipe for target 'install' failed
make: *** [install] Error 1

go version go1.7.6 linux/amd64

Interest in a GTK GUI?

I'm thinking about building a real GUI on top of this. Would you be interested in integrating it here? Or would you prefer that it lives in a separate project?

Unable to export with `--csv`

Hi! Thank you for this incredibly helpful utility. I use it on a regular basis 😄

I want to export todoist list as a CSV and I receive an error:

$ todoist list --csv
Incorrect Usage: flag provided but not defined: -csv

NAME:
   todoist list - Show all tasks

USAGE:
   todoist list [command options] [arguments...]

OPTIONS:
   --filter value, -f value  filter expression

Error: flag provided but not defined: -csv

Is this expected? About environment:

  • MacOS
  • Bash or zsh (I tried both)
  • todoist version 0.13.0

And again, thank you for your work!

Sync Issue due to int size

json: cannot unmarshal number 9842555962 into Go value of type int

Looks like some data structs need to be upped to int64

Got error while installing with homebrew

I got this error message while executing brew install todoist, and how can I fix it?

grouped write of manifest, lock and vendor: error while writing out vendor tree: failed to write dep tree: failed to export golang.org/x/sys: unable to deduce repository and source type for "golang.org/x/sys": unable to read metadata: unable to fetch raw metadata: failed HTTP request to URL "http://golang.org/x/sys?go-get=1": Get http://golang.org/x/sys?go-get=1: dial tcp 216.239.37.1:80: i/o timeout

`make test` fails

go test -v
=== RUN   TestEval
--- PASS: TestEval (0.00s)
=== RUN   TestPriorityEval
--- PASS: TestPriorityEval (0.00s)
=== RUN   TestBoolInfixOpExp
--- PASS: TestBoolInfixOpExp (0.00s)
=== RUN   TestNotOpEval
--- PASS: TestNotOpEval (0.00s)
=== RUN   TestDueOnEval
--- FAIL: TestDueOnEval (0.00s)
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:46
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:49
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:51
	Error:		Not equal: false (expected)
			        != true (actual)
	Messages:	they should be equal
		
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:53
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
=== RUN   TestNoDateEval
--- PASS: TestNoDateEval (0.00s)
=== RUN   TestDueBeforeEval
--- FAIL: TestDueBeforeEval (0.00s)
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:69
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:71
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
=== RUN   TestOverDueEval
--- FAIL: TestOverDueEval (0.00s)
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:79
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:81
	Error:		Not equal: true (expected)
			        != false (actual)
	Messages:	they should be equal
		
=== RUN   TestDueAfterEval
--- FAIL: TestDueAfterEval (0.00s)
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:88
	Error:		Not equal: false (expected)
			        != true (actual)
	Messages:	they should be equal
		
        Error Trace:    filter_eval_test.go:13
			filter_eval_test.go:90
	Error:		Not equal: false (expected)
			        != true (actual)
	Messages:	they should be equal
		
=== RUN   TestFilter
--- PASS: TestFilter (0.00s)
=== RUN   TestPriorityFilter
--- PASS: TestPriorityFilter (0.00s)
=== RUN   TestBoolInfixFilter
--- PASS: TestBoolInfixFilter (0.00s)
=== RUN   TestDateTimeFilter
--- PASS: TestDateTimeFilter (0.00s)
=== RUN   TestSpecialDateTimeFilter
--- PASS: TestSpecialDateTimeFilter (0.00s)
=== RUN   TestDateTimeElapsedFilter
--- PASS: TestDateTimeElapsedFilter (0.00s)
FAIL
exit status 1

I cloned the repo, launched make test and it fails. Why?

Specify --color in global config?

Hi, I might be missing something obvious but I don't see how to default to --color for all my commands? I tried setting "color": true the config JSON, but that's not working. Could you please point me to the docs for that? Thanks!

Listing items in the "Today" view?

Sorry if this has been described somewhere.
I can run the list command to list all the open items, but a lot of times I just want to look at what I have to do today. I was hoping to see Today as a project, but it's not there. Is there a convenient way to do this? Thanks!

Error message on install: ./quick.go:16:8: client.QuickCommand undefined (type *todoist.Client has no field or method QuickCommand)

Hi, this looks super cool and I'd like to try it, but I got the above error on installing. I believe the install was correct -- my workspace is ~/.go vs the usual ~/go, but my path is properly modified and other Go stuff works. Unfortunately, I'm just starting with Go and am not able to diagnose the error. Any help or advice you might offer would be much appreciated and diligently acted upon.

If this helps I'm running Ubuntu Gnome 16.04.3, and here is the series of terminal commands and their output. If more data would help, let me know and I'll gladly provide it.

`# ken @ devbox in ~/.go/src [2:10:33]
$ git clone https://github.com/sachaos/todoist.git
Cloning into 'todoist'...
remote: Counting objects: 782, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 782 (delta 8), reused 20 (delta 6), pack-reused 757
Receiving objects: 100% (782/782), 134.02 KiB | 0 bytes/s, done.
Resolving deltas: 100% (515/515), done.
Checking connectivity... done.

ken @ devbox in ~/.go/src [2:10:40]

$ ls
github.com hello todoist

ken @ devbox in ~/.go/src [2:10:42]

$ cd todoist

ken @ devbox in ~/.go/src/todoist on git:master o [2:10:45]

$ make install
dep ensure
go get golang.org/x/tools/cmd/goyacc
goyacc -o filter_parser.go filter_parser.y

conflicts: 4 shift/reduce
go install

todoist

./quick.go:16:8: client.QuickCommand undefined (type *todoist.Client has no field or method QuickCommand)
Makefile:3: recipe for target 'install' failed
make: *** [install] Error 2

ken @ devbox in ~/.go/src/todoist on git:master x [2:11:37] C:2

$ go install

todoist

./quick.go:16:8: client.QuickCommand undefined (type *todoist.Client has no field or method QuickCommand)
`

How to add todoist_functions?

First of all, this is great software! However, it would make it a lot better with peco-functionality, and I can't seem to make it work. I have installed Peco. When I try to add todoist_functions.sh to .zshrc I just get this error:

-bash: zle: command not found
-bash: bindkey: command not found
-bash: zle: command not found
-bash: bindkey: command not found
-bash: zle: command not found
-bash: bindkey: command not found
-bash: zle: command not found
-bash: bindkey: command not found
-bash: zle: command not found
-bash: bindkey: command not found
-bash: zle: command not found
-bash: bindkey: command not found
-bash: zle: command not found
-bash: bindkey: command not found

Help is much appreciated!

Ps. I'm on a mac.

Closing more than anticipated?

I've dabbled with Todoist in the past, but finding this command line utility really makes it viable to my workflow. Thanks for your work on this!

I may be missing something, but in my tests, I think "todoist close" may be doing more than it should. For example:

➜  todoist git:(master) todoist l        
45023248   p1               #Inbox     Order cat6
45023291   p1               #Inbox     Pick up ladder
45026152   p1               #Inbox     Add TLC to all timco distro
98687626   p1               #Inbox     Watch how you treat Phoebe versus Sophie
108675417  p1 17/03/09(Thu) #Inbox     Turn on sensors
2680739716 p1               #Inbox     Help me
2680741223 p1               #Inbox     You and me...and nothing in between...
64695786   p1               #Shopping  Deserts?    
➜  todoist git:(master) todoist close 45023248
➜  todoist git:(master) todoist l             
45023291  p1               #Inbox     Pick up ladder
108675417 p1 17/03/09(Thu) #Inbox     Turn on sensors
64695786  p1               #Shopping  Deserts?
➜  todoist git:(master) todoist sync
➜  todoist git:(master) todoist l 
45023291  p1               #Inbox     Pick up ladder
108675417 p1 17/03/09(Thu) #Inbox     Turn on sensors
64695786  p1               #Shopping  Deserts?
➜  todoist git:(master) todoist l 

45023291 p1 #Inbox Pick up ladder
108675417 p1 17/03/09(Thu) #Inbox Turn on sensors
64695786 p1 #Shopping Deserts?

So by closing 1 of 8 tasks, something I ended up with only 3 open.

Any ideas?

How to use date keybinding?

I do not quite understand how to use the keybinding for date.

When I use the binding, it simply shows a peco query search field but with no items in the results to filter from.

When I hit return (with nothing selected), I get:

peco-todoist-date:10: no matches found: -I#

Due dates are broken sometimes

Splitting this off from #60 where @chrisshroba pointed out that due dates are broken for any task that used to have a due date.

Steps to reproduce:

  1. In the todoist UI, create a task "Test task".
  2. todoist sync
  3. Observe correct entry in ~/.todoist.cache.json (no due date):
{
      "id": 3049871525,
      "project_id": 2205429526,
      "content": "Test task",
      "user_id": 127561,
      "parent_id": null,
      "indent": 1,
      "all_day": false,
      "assigned_by_uid": 127561,
      "checked": 0,
      "collapsed": 0,
      "date_added": "Tue 12 Feb 2019 19:56:58 +0000",
      "date_lang": "",
      "date_string": "",
      "day_order": -1,
      "due_date_utc": "",
      "has_more_notes": false,
      "in_history": 0,
      "is_archived": 0,
      "is_deleted": 0,
      "item_order": 11,
      "labels": [],
      "priority": 1,
      "auto_reminder": false,
      "responsible_uid": null,
      "sync_id": null
    }
  1. Add a due date to the task in the todoist UI
  2. todoist sync
  3. Observe that the due date is correctly reflected in the new JSON entry:
{
      "id": 3049871525,
      "project_id": 2205429526,
      "content": "Test task",
      "user_id": 127561,
      "parent_id": null,
      "indent": 1,
      "all_day": true,
      "assigned_by_uid": 127561,
      "checked": 0,
      "collapsed": 0,
      "date_added": "Tue 12 Feb 2019 19:56:58 +0000",
      "date_lang": "en",
      "date_string": "Feb 13",
      "day_order": -1,
      "due_date_utc": "Thu 14 Feb 2019 06:59:59 +0000",
      "has_more_notes": false,
      "in_history": 0,
      "is_archived": 0,
      "is_deleted": 0,
      "item_order": 11,
      "labels": [],
      "priority": 1,
      "auto_reminder": false,
      "responsible_uid": null,
      "sync_id": null
    }
  1. Remove the due date from the task in the todoist ui
  2. todoist sync
  3. Observe due_date_utc is not set back to an empty string in the cache json:
{
      "id": 3049871525,
      "project_id": 2205429526,
      "content": "Test task",
      "user_id": 127561,
      "parent_id": null,
      "indent": 1,
      "all_day": false,
      "assigned_by_uid": 127561,
      "checked": 0,
      "collapsed": 0,
      "date_added": "Tue 12 Feb 2019 19:56:58 +0000",
      "date_lang": "en",
      "date_string": "Feb 13",
      "day_order": -1,
      "due_date_utc": "Thu 14 Feb 2019 06:59:59 +0000",
      "has_more_notes": false,
      "in_history": 0,
      "is_archived": 0,
      "is_deleted": 0,
      "item_order": 11,
      "labels": [],
      "priority": 1,
      "auto_reminder": false,
      "responsible_uid": null,
      "sync_id": null
    }

Harsh error handling on nonexistent task id

The error handling could stand to be a bit more graceful than a full panic when you give an invalid task id.

Demonstrated below:

~ ❯❯❯ todoist show 2                                                                                                                                             ⏎
panic: interface conversion: todoist.IDCarrier is nil, not todoist.Item

goroutine 1 [running]:
main.Show(0xc420087340, 0x0, 0x0)
	/home/ocelotsloth/.cache/pacaur/todoist/src/todoist-0.9.1/show.go:20 +0xefd
github.com/urfave/cli.HandleAction(0x7ea120, 0x887be0, 0xc420087340, 0xc42006c600, 0x0)
	/home/ocelotsloth/.cache/pacaur/todoist/src/go/src/github.com/urfave/cli/app.go:490 +0xd4
github.com/urfave/cli.Command.Run(0x86cfbc, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x874af4, 0x10, 0x0, ...)
	/home/ocelotsloth/.cache/pacaur/todoist/src/go/src/github.com/urfave/cli/command.go:210 +0xb6e
github.com/urfave/cli.(*App).Run(0xc4200de680, 0xc4200101b0, 0x3, 0x3, 0x0, 0x0)
	/home/ocelotsloth/.cache/pacaur/todoist/src/go/src/github.com/urfave/cli/app.go:255 +0x76f
main.main()
	/home/ocelotsloth/.cache/pacaur/todoist/src/todoist-0.9.1/main.go:226 +0x11cf
~ ❯❯❯ todoist show 2274599906                                                                                                                                    ⏎
ID       2274599906
Content  Make breakfast
Project  #Inbox
Labels   
Priority p4
DueDate  17/07/29(Sat)
URL      
~ ❯❯❯

Filter error: syntax error

Hi, thanks for the cool CLI :)

I'm having an issue:

todoist list --filter '@follow-up' fails, but if I change the label in the GUI then do:

todoist list --filter '@followup'

it works fine.

Do you know if I need to escape the -, or otherwise how to make this work as intended?

Relatedly, todoist list --filter '7 days' is also failing, though it was working before.

Thanks!

Configuration .zsrhc for use with peco keybindings

I have trouble to properly setup peco and the keybindings. I don't really have much experience with command line tools, so I'm not sure what to put inside the .zshrc file.

I assume I have to put

$ source "$GOPATH/src/github.com/sachaos/todoist/todoist_functions.sh" ?

Would be happy to get some support here.

Thanks in advance!

unrecognized import path "context"

With a completely clean GOPATH I get the following error:

$ go get -v github.com/sachaos/todoist
package context: unrecognized import path "context" (import path does not begin with hostname)

Attached is the output if it helps as well as information about my go environment

$ go version
go version go1.6.4 linux/amd64

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/flindiakos/.go"
GORACE=""
GOROOT="/usr/lib/golang"
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

output.txt

Make Install | Recipe for target 'prepare' failed

Steps to reproduce:

  • Clone repository
  • Run 'Make install'

Observed result:

make install root@Albuntu dep ensure make: dep: Command not found Makefile:11: recipe for target 'prepare' failed make: *** [prepare] Error 127

Expected result:

It to install

System info

lsb_release -a root@Albuntu No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

go version root@Albuntu go version go1.6.2 linux/amd64

"todoist list" is empty

When I use todoist nothing gets returned

8:23:36 user@computer ~ todoist list
8:24:10 user@computer ~ todoist --debug list
8:25:26 user@computer ~ todoist --debug projects
8:25:31 user@computer ~ 

I already issued a new API-token
todoist version 0.13.1

Build fails: multiple-value uuid.NewV4() in single-value context

I tried to build the todoist package available for Arch Linux. It fails with the following error:

go/src/github.com/sachaos/todoist/lib/command.go:21:21: multiple-value uuid.NewV4() in single-value context
go/src/github.com/sachaos/todoist/lib/command.go:22:21: multiple-value uuid.NewV4() in single-value context

I am using Go 1.9.2.

Buffering / async command execution

Hey, this is a feature suggestion; I hope this is ok ;-)

I have tested the tool for a while, it works great. There is one problem, though:
Compared to the web-UI provided by todoist, it is very slow. I haven't debugged the code yet, but I am 99.99% sure this problem arises from the API calls (the web-UI does this in the background).
This only really comes into play while creating issues, time and time again I have to wait for a full second to create one issue.

Feature suggestion:
Store the commands somehow, buffer them, and execute them asynchronically.
This would not change the workflow of users in a major way, but take away all of the waiting time.
The error handling would be a bit more complex, but to keep people in mind that don't want to trap the process or whatever, you could just provide a setting that turns it on/off.

I know that one could detach the process, but I suggested this feature with usability in mind :). I would be glad to help with the implemention!

CSV file has no headers

when using the --csv flag, the resulting file has no headers. Expected behavior would be for the first row of the csv file to name each column of data.

sha-1 id?

Great tool. Thanks for making it.

Can we sha-1 the content and replace the value with the current id field? (like what git does.) The current ids look so damn similar. It is frustrating to enter something like 385373XXX every single time.

Can't build on Ubuntu 18.04

This is my attempt to build:

$ make install
dep ensure
go get golang.org/x/tools/cmd/goyacc
goyacc -o filter_parser.go filter_parser.y

conflicts: 4 shift/reduce
go install
# github.com/todoist
./add.go:24:41: client.Store.Projects.GetIDByName undefined (type todoist.Projects has no field or method GetIDByName)
./add.go:40:6: item.AutoReminder undefined (type todoist.Item has no field or method AutoReminder)
./delete.go:14:25: client.CompleteItemIDByPrefix undefined (type *todoist.Client has no field or method CompleteItemIDByPrefix)
./main.go:138:101: unknown field 'Color' in struct literal of type todoist.Config
./main.go:148:33: config.Color undefined (type *todoist.Config has no field or method Color)
./modify.go:21:24: client.CompleteItemIDByPrefix undefined (type *todoist.Client has no field or method CompleteItemIDByPrefix)
./modify.go:49:36: client.Store.Projects.GetIDByName undefined (type todoist.Projects has no field or method GetIDByName)
Makefile:3: recipe for target 'install' failed
make: *** [install] Error 2

peco-todoist-date: gnu date is incompatible with bsd date

Hi @sachaos

Awesome tool. I've been trying to use todoist_functions.sh but ran into trouble with ^xtd bindings with peco-todoist-date. It's using the bsd variant of date which supports -v. The gnu variant has --date and the format is similar but different. I added the following to my version, but I think there's probably a better way as they are only differ in one parameter.

function peco-todoist-date () {
    date -v 2>/dev/null >/dev/null
    if [ $? -eq 0 ] ; then
      local SELECTED_DATE="$(for ((i = 0; i <= 30; i++)); do date -v+${i}d '+%d/%m/%Y %a' ;done | peco | cut -d ' ' -f 1)"
    else
      local SELECTED_DATE="$(for ((i = 0; i <= 30; i++)); do date --date="${i} day" '+%d/%m/%Y %a' ;done | peco | cut -d ' ' -f 1)"
    fi
    insert-in-buffer "'${SELECTED_DATE}'" "-d"
}

Todoist-cli crashes with wrong filters

todoist l -f "today || yesterday"
panic: syntax error

goroutine 1 [running]:
main.(*Lexer).Error(0xc420089600, 0x880777, 0xc)
	filter_parser.y:329 +0x63
main.(*yyParserImpl).Parse(0xc42019f880, 0xaa20e0, 0xc420089600, 0x0)
	yaccpar:253 +0x3506
main.yyParse(0xaa20e0, 0xc420089600, 0xc420120480)
	yaccpar:153 +0x4f
main.Filter(0x7fff3c3dd992, 0x12, 0x6, 0x7fff3c3dd992)
	filter_parser.y:335 +0x16d
main.List(0xc4200df340, 0x0, 0x0)
	/mnt/src/sources/go/src/github.com/sachaos/todoist/list.go:18 +0x225
github.com/sachaos/todoist/vendor/github.com/urfave/cli.HandleAction(0x7f3100, 0x898940, 0xc4200df340, 0xc420120400, 0x0)
	/mnt/src/sources/go/src/github.com/sachaos/todoist/vendor/github.com/urfave/cli/app.go:490 +0xd2
github.com/sachaos/todoist/vendor/github.com/urfave/cli.Command.Run(0x87b029, 0x4, 0x0, 0x0, 0xc420087020, 0x1, 0x1, 0x881a37, 0xf, 0x0, ...)
	/mnt/src/sources/go/src/github.com/sachaos/todoist/vendor/github.com/urfave/cli/command.go:210 +0xa95
github.com/sachaos/todoist/vendor/github.com/urfave/cli.(*App).Run(0xc42008eea0, 0xc4200a6040, 0x4, 0x4, 0x0, 0x0)
	/mnt/src/sources/go/src/github.com/sachaos/todoist/vendor/github.com/urfave/cli/app.go:255 +0x6f8
main.main()
	/mnt/src/sources/go/src/github.com/sachaos/todoist/main.go:250 +0x15f1

Priority labels are backwards?

I believe within Todoist p1 = highest priority, down to p4 = lowest.

On the CL Todoist, 'todoist list --filter p1' shows me my p4 labeled tasks, and 'todoist list --filter p4' shows me my p1 labeled tasks.....

Display month with leading 0

Months are afaik usually displayed with a leading zero when using "date". Like this: 17/06/12
todoist shows it like 17/6/12 - therefore you cannot do something like this: todoist l | fgrep date +"%y/%m/%d" (that's the syntax on FBSD). It would be great if you could display months like this or at least offer an option. Then one can add simple aliases for displaying tasks due "today" or "tomorrow"

How does modify work?

How does modify work?
For example I have a task that is due today and I want to move it to tomorrow. Thus I expected I just had to do this:
todoist m 2238698186 -d '26/06/2017'

But this doesn't work and only fails silently (task is still due today).

Edit personal API token

I think that it is necessary to add the ability to change the API token if the current one is not valid.

Adding filters to `list`?

Hi, have you thought about adding filters to list so that you could query for just p4 tasks or filtering by name? Or do you just expect that people will filter using the command line?

[Feature Request] completed-list improvements

Thank you for the great tool!
Main reason because I use the Todoist CLI client is the confusing Completed tasks interface. Your client almost perfectly fits my needs. But I suggest some improvements:

  1. Shortcut for completed-list command (cl, for example).
  2. --filter option. I often want to look what I did today or yesterday.

Currently, I added this features with bash aliases for myself, but I can add it to the code if this features really useful for others.

Compatible with oh-my-zsh?

I just discovered this, and instaledl both it and peco with Homebrew this morning. A couple questions:

Is it possible to include the todoist_functions.sh file in the pieces installed via Homebrew? That would make it easier to source and track.

Regardless, I downloaded it and put it in /usr/local/share/todoist/. I added the source /usr/local/.../todoist_functions.sh line to .oh-my-zsh/custom/todoist.zsh so it would be loaded, but after restarting the shell, none of the keyboard magic seems to happen.

I found issue #22 and tried to follow along, but when I hit Ctrl-X tp nothing happens, nor does anything happen for any of the other mappings.

Also, how does the command line prefill/examples work in the demo images? Is that an available addon?

Thank you

Changing the output format of `todoist list`

The output format produced by todoist list is frustratingly wide, given any combination of long due dates, nested projects, and/or lots of labels. It would be useful to be able to change the output format, by reordering, omitting, or restricting the width of fields.

(For example, before I fiddled with my task list in an attempt to make it narrower, it was ~300 columns wide; I've now got it down to ~120, but even narrower would be very useful, plausibly by suppressing some columns from the output.)

multiple-value uuid.NewV4 Makefile error

When attempting to install on my Fedora 29 install, I'm receiving the following error:

➜  todoist (master) ✔ cd $GOPATH/src/github.com/sachaos/todoist
➜  todoist (master) ✔ make install
go get golang.org/x/tools/cmd/goyacc
go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src;
        ignoring go.mod;
        see 'go help modules'
goyacc -o filter_parser.go filter_parser.y

conflicts: 4 shift/reduce
go install
# github.com/sachaos/todoist/lib
lib/command.go:21:21: multiple-value uuid.NewV4() in single-value context
lib/command.go:22:21: multiple-value uuid.NewV4() in single-value context
make: *** [Makefile:3: install] Error 2

I've taken note from issue #36 and ensured that I'm building in the right folder although I'm sure this is likely a dumb mistake on my part since I'm running this tool perfectly on another Fedora 29 install and a Debian WSL instance.

Thanks for the great tool and thanks for any time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.