pa ([pʌ]) is a CLI tool for Pixela.
pa ([pʌ]) is a CLI tool for Pixela.
pa provides a unified command to manage Pixela's services.
pa takes advantage of the shell's completion capabilities to enter commands quickly, easily and reliably.
$ pa user create \
--username=yourname \
--token=thisissecret \
--agree-terms-of-service \
--not-minor
or
$ export PA_USERNAME=yourname
$ export PA_TOKEN=thisissecret
$ pa user create --agree-terms-of-service --not-minor
User API sub commands.
- create
- delete
- update
$ pa profile update \
--display-name=display-name \
--gravatar-icon-email=gravatar-icon-email \
--title=title \
--timezone=Asia/Tokyo \
--about-url=about-URL \
--contribute-urls=url \
--pinned-graph-id=pinned-graph-id
User Profile API sub commands.
- update
- get
$ pa graph create \
--id=your-graph-id \
--name=your-graph-name \
--type=int \
--unit=count \
--color=ichou
$ pa graph get-all | jq
{
"graphs": [
{
"id": "your-graph-id",
"name": "your-graph-name",
"unit": "count",
"type": "int",
"color": "ichou",
"timezone": "",
"purgeCacheURLs": null,
"selfSufficient": "none",
"isSecret": false,
"publishOptionalData": false
}
]
}
Graph API sub commands.
- add
- create
- delete
- detail
- get-all
- get
- list
- pixels
- stats
- stopwatch
- subtract
- svg
- update
$ pa pixel create --graph-id=your-graph-id --date 20200101 --quantity=1
Pixel API sub commands.
- create
- decrement
- delete
- get
- increment
- update
$ pa webhook create --graph-id=your-graph-id --type=increment
Webhook API sub commands.
- create
- delete
- get
- invoke
Specify the Pixela username with the --username
flag and Specify the Pixela token with the --token
flag.
$ pa user create \
--username=yourname \
--token=thisissecret \
--agree-terms-of-service \
--not-minor
You can also specify the Pixela username and Pixela token with the environment variables.
Specify the Pixela username with the PA_USERNAME
environment variable and Specify the Pixela token with the PA_TOKEN
environment variable.
$ export PA_USERNAME=yourname
$ export PA_TOKEN=thisissecret
$ pa user create --agree-terms-of-service --not-minor
You can also specify the Pixela username and Pixela token with the config files.
$ cat ~/.pa
username = "yourname"
token = "thisissecret"
$ pa user create --agree-terms-of-service --not-minor
pa
uses the following precedence order.
Each item takes precedence over the item below it:
- flag
- environment variable
- config file in current directory
- config file in home directory
You can generate zsh, bash, fish and PowerShell completions and use it.
$ pa completion <SHELL> > /path/to/completion
Global help.
$ pa --help
The Pixela Command Line Interface is a unified tool to manage your Pixela services
Usage:
pa [command]
Available Commands:
completion Generate shell completion
graph Graph
help Help about any command
pixel Pixel
profile Profile
user User
webhook Webhook
Flags:
--config string config file (default is $HOME/.pa)
-h, --help help for pa
-r, --retry int Specify the number of retries when the API call is rejected
-t, --token string Pixela user token
-u, --username string Pixela user name
-v, --version version for pa
Use "pa [command] --help" for more information about a command.
Commands help available.
$ pa user --help
User
Usage:
pa user [flags]
pa user [command]
Available Commands:
create Create a new Pixela user
delete Delete a Pixela user
update Updates user token
Flags:
-h, --help help for user
Global Flags:
--config string config file (default is $HOME/.pa)
-r, --retry int Specify the number of retries when the API call is rejected
-t, --token string Pixela user token
-u, --username string Pixela user name
Use "pa user [command] --help" for more information about a command.
Sub commands help available.
$ pa user create --help
Create a new Pixela user
Usage:
pa user create [flags]
Flags:
-a, --agree-terms-of-service Agree to the terms of service
-h, --help help for create
-m, --not-minor You are not a minor or if you are a minor and you have the parental consent of using this service
-c, --thanks-code string Like a registration code obtained when you register for Patreon support
Global Flags:
--config string config file (default is $HOME/.pa)
-r, --retry int Specify the number of retries when the API call is rejected
-t, --token string Pixela user token
-u, --username string Pixela user name
$ go install github.com/ebc-2in2crc/pa/cmd/pa@latest
Download from the following url.
Or, you can use Homebrew (Only macOS).
$ brew tap ebc-2in2crc/tap
$ brew install pa
- Fork this repository
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Rebase your local changes against the master branch
- Run test suite with the go test ./... command and confirm that it passes
- Run gofmt -s
- Create new Pull Request