Command line interface for LINE APIs. This module will help you to easily work with LINE APIs via CLI.
LINE API CLI helps you to work with LINE-API-related projects faster as you do not need to switch between a web browser and IDE ( after your first-time setup :P ). If you already are a hardcore "Terminal/Console" fanboy that using cURL to work with LINE APIs, using this package will reduce your time typing same long API cURL commands.
line
init
token
--issue
--revoke
richmenu
add
remove
list
default
link
unlink
liff
add
remove
update
list
things
add:trial
remove:trial
list:trial
get:device
get:devices
get:product
things
register:scenario-set
remove:scenario-set
get:scenario-set
linetv
list:modules
get:spotlight
list:category
get:category
list:station
get:station
ranking
search
live
npm i -g line-api-cli
Let's start, to initialize project configuration file. Please go to your LINE Developer Console and get Channel ID and Channel secret. If you do not want to issue a short-lived access token later on, you will also need a long-lived access token.
Once you have the information, run line
command with init
operation.
line init
This command will create .line-api-cli.yml
configuration file containing necessary information for the CLI to handle API request/response for you.
Long-lived access token is nice and easy to use for developers but it is not as secured as a short-lived access token.
To issue a short-lived access token, run the following command.
line token --issue
It will issue a short-lived access token. You can choose whether to replace the token into .line-api-cli.yml
Do not forget to replace a short-lived. It is recommended to write a script to replace the token monthly.
Ok, sometime you may feel insecure after exposing access token somewhere. No problem, you can revoke it with --revoke
option.
line token --revoke
It's time to display nice UI menu to your users, or maybe some menu to some specific user(s). You can do those tasks with richmenu
command.
First you need to prepare a data file and an image file for rich menu. After you have those in your project directory, you can run richmenu
command with add
operation to add a rich menu.
richmenu add
Rich menus can be listed with list
operation.
richmenu list
Get bored of old rich menu? You can remove a rich menu with remove
operation.
richmenu remove
Then choose a rich menu to be removed.
If you'd like to set a rich menu as default for all users, run the following command.
richmenu default
Rich menu can be linked to a specific user. For example, if you want a rich menu assigned only to LINE user with Administrator role. You can get a user ID and link a rich menu for the user with this command.
richmenu link
Rich menu can be unlinked from a specific user using unlink
operation.
richmenu unlink
To develop more advanced LINE Bot, LIFF app may required. You can use liff
command to manage LIFF apps.
liff add
liff list
liff remove
liff update
things list:trial
things add:trial
things remove:trial
things get:device
things get:devices
things get:product
things register:scenario-set
things get:scenario-set
things remove:scenario-set
linetv list:modules
To get sportlight curation module types in JSON use --format
option.
linetv list:modules --format json
linetv get:spotlight
To get sportlight data in JSON use --format
option.
linetv get:sportlight --format json
linetv list:category
To get category list in JSON use --format
option.
linetv get:sportlight --format json
linetv get:category
To get category home data in JSON use --format
option.
linetv get:category --format json
To get category home data start from selected page use --page
option.
linetv get:station --page <number>
linetv ranking
To get clip ranking data in JSON use --format
option.
linetv ranking --format json
To get clip ranking data start from selected page use --page
option.
linetv ranking --page <number>
linetv search
To get clip search result in JSON use --format
option.
linetv search --format json
To get clip search result from selected page use --page
option.
linetv search --page <number>
linetv list:station
To get station home (TV station) list in JSON use --format
option.
linetv list:station --format json
linetv get:station
To get TV Station data in JSON use --format
option.
linetv get:station --format json
To get TV Station data start from selected page use --page
option.
linetv get:station --page <number>
linetv live
To get live schedule data in JSON use --format
option.
linetv live --format json
We provide comprehensive usage of each command / operation / option with CLI. Simply run a command with/without operation and follow by --help
option. For example,
line token --help
Or
line --help
Copyright (c) 2019-2020 intocode Co., Ltd.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Images used in this repository are not own by any maintainers. Do NOT distribute the images. They are used only for friendly-looking CLI. If a copyright owner would like to remove any image, please open an issue here and we will remove as soon as possible.