Pixela is kind of a tracking your activities. This post is noted how I manage token, graphs and webhooks such as a reference.

Pixela | Record and Track your habits or effort. All by API.

🌱 Preparation before you run it

Store your token to ~/.config/pixela/config.json

Where you want to put it on.

$ cat ~/.config/pixela/config.json
{
  "username": "[YOUR-USERNAME]",
  "token": "[YOUR-PIXELA-TOKEN]"
}

I also save the username and token into iCloud Keychain.

Install jq

You need to install jq for parsing ~/.config/pixela/config.json.

Download jq

Install gof

gof is kind of an interactive filtering tool. If you don't want to install it, gof exec shall be replaced with things what you want to run.

mattn/gof

Sorry for the inconvenience regarding the preparation. This document is for me, however.

🏃‍♂️ One-liner what you want to run

Create a new graph

You need to build send data to request.

$ curl -X POST <https://pixe.la/v1/users/$>(cat ~/.config/pixela/config.json | jq -r ".username")/graphs \\
    -H "X-USER-TOKEN: $(cat ~/.config/pixela/config.json | jq -r ".token")" \\
    -d '{"id":"test-graph","name":"graph-name","unit":"commit","type":"int","color":"shibafu","timezone":"Asia/Tokyo"}'