alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
96 stars 9 forks source link

List all tasks #104

Closed guilhermeprokisch closed 2 years ago

guilhermeprokisch commented 2 years ago

Hi, I din't find any option to list tasks. It's possible?

Thanks for this tool! It's help a lot in one of my bash scripts.

alanvardy commented 2 years ago

Hi @guilhermeprokisch !

Glad you are enjoying it. I don't currently have a command to list all the tasks for a project, but I definitely think it would be useful. What do you think of:

# short version
tod -A

# long version
tod --all-tasks

Unfortunately, -a and -l are already taken in the API and I would like to avoid making breaking changes if at all possible.

guilhermeprokisch commented 2 years ago

That's would be nice!

Also it will be nice to be able to pass some filter params (pre-defined or custom). https://todoist.com/help/articles/introduction-to-filters

alanvardy commented 2 years ago

It's pretty easy to get all the tasks for a project through their get project data endpoint

https://developer.todoist.com/sync/v8/#get-project-data

I'll probably get that done this week, but I am going to have to do further investigation into filters. It's does not seem obvious how I would do that on first glance. Keep your eyes peeled for a new release!

alanvardy commented 2 years ago

tod v0.2.12 is now available on Crates.io and AUR, includes the ability to get all tasks for a project

I just made it the default behaviour when only the -p or --project flag is passed in (before it would error)

tod -p my_project
# or
tod --project my_project

Thank you for the issue @guilhermeprokisch !

guilhermeprokisch commented 2 years ago

@alanvardy just to let you know.. pass filters is very easy also, it's just to pass a param in the api query

e.g:

https://api.todoist.com/rest/v1/tasks?filter=today

alanvardy commented 2 years ago

Thank you for letting me know! I think this is a newish API as I don't think it was there when I created this CLI (and so I used the Sync API)

This is the official documentation for Todoist REST API. Our original API, named Sync API, provides an easy way to deal with full and partial syncs, but it's not so simple for individual calls. Our REST API aims to provide developers a simple way to consume the most basic features of Todoist API.

I'm going to put switching over to the REST Api on the roadmap and will add the filters :+1: