chatwork-cli
is a simple command line client for chatwork API.
$ go get github.com/arai-ta/chatwork-cli/cw
$ cw
# ==> Show usage and exit
$ cw GET /me
# ==> HTTP GET http://api.chatwork.com/v2/me
$ cw GET /my/tasks
# ==> HTTP GET http://api.chatwork.com/v2/my/tasks
$ cw get my tasks # alternative
# ==> HTTP GET http://api.chatwork.com/v2/my/tasks
$ cw POST rooms "name=New room for topic X"
# ==> HTTP POST http://api.chatwork.com/v2/rooms
Edit ~/.chatwork.toml
file as following:
[values]
mychat = "17708368"
then you can do like this:
$ cw post rooms {mychat} messages "body=I'm hungry:("
# ==> HTTP POST https://api.chatwork.com/v2/rooms/17708368/messages
chatwork API is providing a RAML definition.
-endpoint
option will read definition and show list of available endpoints.
You can use API with multiple accounts by using configuration file. See below.
It works with chatwork API token. (OAuth2 will be implemented in the near future)
$ export CW_API_TOKEN=hereisyourapitoken
$ cp example.toml ~/.chatwork.toml
$ vi ~/.chatwork.toml
# edit it, like this: `token = hereisyourapitoken`
This software is released under the MIT License.