Skip to content

Instantly share code, notes, and snippets.

@StefanBRas
Created October 8, 2020 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StefanBRas/eeccc360e732096a86aa7581abb5f9a2 to your computer and use it in GitHub Desktop.
Save StefanBRas/eeccc360e732096a86aa7581abb5f9a2 to your computer and use it in GitHub Desktop.
Using todoist cli without having to type long id numbers - 1.0
alias todoistl='unbuffer todoist --color list | cut -c 21- | nl'
todoist_number () {
todoist list | sed -n "$1p" | grep -Po '^\d{10}+' | cat
}
todoistc () {
todoist close $(todoist_number $1)
}
todoists () {
todoist show $(todoist_number $1)
}
todoistd () {
todoist delete $(todoist_number $1)
}
@StefanBRas
Copy link
Author

Running todoistl will then create a list like this:

image

These shorter ids can then be used with todoistc, todoists, todoistd to close, show and delete tasks.

For example:
image

And now that task is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment