https://github.com/kobtea/go-todoist
Unofficial CLI and library for todoist
https://github.com/kobtea/go-todoist
golang todoist todoist-cli
Last synced: 2 months ago
JSON representation
Unofficial CLI and library for todoist
- Host: GitHub
- URL: https://github.com/kobtea/go-todoist
- Owner: kobtea
- License: mit
- Created: 2017-01-04T10:29:46.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-29T15:01:06.000Z (almost 5 years ago)
- Last Synced: 2024-11-13T15:49:31.070Z (3 months ago)
- Topics: golang, todoist, todoist-cli
- Language: Go
- Homepage:
- Size: 136 KB
- Stars: 17
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - kobtea/go-todoist - Unofficial CLI and library for todoist (Go)
README
# go-todoist
[](https://goreportcard.com/report/github.com/kobtea/go-todoist)
[](https://circleci.com/gh/kobtea/go-todoist)Unofficial CLI and library for [todoist](https://todoist.com).
## Install
### Binary
Go to https://github.com/kobtea/go-todoist/releases
### Building from source
```bash
$ go get -d github.com/kobtea/go-todoist
$ cd $GOPATH/src/github.com/kobtea/go-todoist
$ make build
```## Usage
```bash
$ todoist help
Command line tool for todoist.Usage:
todoist [command]Available Commands:
completion generate completion script
config configure about this CLI
filter subcommand for filter
help Help about any command
inbox show inbox tasks
item subcommand for item
label subcommand for label
next show next 7 days tasks
project subcommand for project
review show completed items
sync Syncronize origin server
today show today's tasks
version show version of go-todoistFlags:
--config string config file (default is $HOME/.todoist.yaml)
-h, --help help for todoistUse "todoist [command] --help" for more information about a command.
```Configure your API token of todoist.
The location of API token is `Todoist` > `Settings` > `Integrations` > `API token`.```bash
$ todoist config
todoist token (default: ): YOUR_TOKEN_HERE
write config to /home/kobtea/.go-todoist/config.json
```Sync contents.
```bash
$ todoist sync
```Enjoy.
```bash
$ todoist item add hello go-todoist
$ todoist inbox
```Bash and zsh completion are supported ;)
Completion requires [fzf](https://github.com/junegunn/fzf).```bash
# bash
$ . <(todoist completion bash)
# zsh
$ . <(todoist completion zsh)
```## As a Library
This library supports [sync api v8](https://developer.todoist.com/sync/v8).
Implementation refers to [python official library](https://github.com/doist/todoist-python).sample
```go
package mainimport (
"context"
"github.com/kobtea/go-todoist/todoist"
"os"
)func main() {
token := os.Getenv("TODOIST_TOKEN")
cli, _ := todoist.NewClient("", token, "*", "", nil)
ctx := context.Background()// sync contents
cli.FullSync(ctx, []todoist.Command{})// add item
item, _ := todoist.NewItem("hello go-todoist", &todoist.NewItemOpts{})
cli.Item.Add(*item)
cli.Commit(ctx)
}
```## License
MIT