kingoftime-cli/README.md

113 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2023-04-26 16:40:01 +00:00
King of Time CLI (unofficial)
2023-04-14 13:13:50 +00:00
=================
<!-- toc -->
* [Usage](#usage)
2023-04-15 10:01:03 +00:00
* [Installation](#installation)
2023-04-14 13:13:50 +00:00
* [Commands](#commands)
<!-- tocstop -->
2023-04-15 10:01:03 +00:00
2023-04-26 15:47:05 +00:00
<p align="center">
<img src="white_rabbit.jpg" />
</p>
2023-04-14 13:13:50 +00:00
# Usage
2023-04-14 13:54:48 +00:00
2023-04-15 10:01:03 +00:00
```sh-session
$ kot checkin
2023-04-26 15:36:24 +00:00
{ result: 'OK', image_result: '0', comment_result: '0' }
2023-04-15 10:01:03 +00:00
$ kot checkout
2023-04-26 15:36:24 +00:00
{ result: 'OK', image_result: '0', comment_result: '0' }
2023-04-15 10:01:03 +00:00
```
# Installation
From the same directory as this README:
2023-04-14 13:54:48 +00:00
2023-04-14 13:13:50 +00:00
```sh-session
$ npm install
2023-04-16 15:12:51 +00:00
$ npm install -g
2023-04-14 13:13:50 +00:00
```
2023-04-15 10:01:03 +00:00
Now the `kot` command should be available on your system.
## Set Tokens
You need to provide two tokens, which can be retrieved by inspecting the HTTP request to `/bprgateway` the
King of Time Web UI makes when submitting a check-in or check-out request.
It is convenient to set these as the below environment variables, although they can also be passed as options
to the `checkin` and `checkout` commands.
* `KINGOFTIME_TOKEN`
* `KINGOFTIME_USER_TOKEN`
2023-04-14 13:13:50 +00:00
# Commands
<!-- commands -->
* [`kot checkin`](#kot-checkin)
* [`kot checkout`](#kot-checkout)
2023-04-14 13:13:50 +00:00
* [`kot help [COMMANDS]`](#kot-help-commands)
## `kot checkin`
2023-04-14 13:13:50 +00:00
Check in
2023-04-14 13:13:50 +00:00
```
USAGE
$ kot checkin --token <value> --user-token <value>
2023-04-14 13:13:50 +00:00
FLAGS
--token=<value> (required) Defaults to the KINGOFTIME_TOKEN environment variable.
--user-token=<value> (required) Defaults to the KINGOFTIME_USER_TOKEN environment variable.
2023-04-14 13:13:50 +00:00
DESCRIPTION
Check in
2023-04-14 13:13:50 +00:00
EXAMPLES
2023-04-14 13:54:48 +00:00
$ kot checkin
2023-04-14 13:13:50 +00:00
```
## `kot checkout`
2023-04-14 13:13:50 +00:00
Check out
2023-04-14 13:13:50 +00:00
```
USAGE
$ kot checkout --token <value> --user-token <value>
2023-04-14 13:54:48 +00:00
FLAGS
--token=<value> (required) Defaults to the KINGOFTIME_TOKEN environment variable.
--user-token=<value> (required) Defaults to the KINGOFTIME_USER_TOKEN environment variable.
2023-04-14 13:13:50 +00:00
DESCRIPTION
Check out
2023-04-14 13:13:50 +00:00
EXAMPLES
2023-04-14 13:54:48 +00:00
$ kot checkout
2023-04-14 13:13:50 +00:00
```
## `kot help [COMMANDS]`
Display help for kot.
```
USAGE
$ kot help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for kot.
```
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.2.9/src/commands/help.ts)_
<!-- commandsstop -->
2023-04-14 14:22:39 +00:00
## Credits
Inspired by https://github.com/inabajunmr/kotrcli