line-api-cli
v1.3.8
Published
LINE API CLIs for Node.js
Downloads
47
Maintainers
Readme
line-api-cli
Command line interface for LINE APIs. This module will help you to easily work with LINE APIs via CLI.
Short summary
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.
Available commands, operations, and options
LINE API configuration and token management
line
init
token
--issue
--revoke
Richmenu API
richmenu
add
remove
list
default
link
unlink
LIFF API v1
liff
add
remove
update
list
LINE Things API
things
add:trial
remove:trial
list:trial
get:device
get:devices
get:product
Scenario management API for automatic communication
things
register:scenario-set
remove:scenario-set
get:scenario-set
LINE TV API
linetv
list:modules
get:spotlight
list:category
get:category
list:station
get:station
ranking
search
live
Installation
npm i -g line-api-cli
Project setup with line
command
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.
Issue a short-lived access token
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.
Revoke access token
Ok, sometime you may feel insecure after exposing access token somewhere. No problem, you can revoke it with --revoke
option.
line token --revoke
Working with richmenu
command
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.
Add a rich menu
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
List rich menus
Rich menus can be listed with list
operation.
richmenu list
Remove a rich menu
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.
Set a rich menu as default
If you'd like to set a rich menu as default for all users, run the following command.
richmenu default
Link a rich menu to a user
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
Unlink a rich menu from a user
Rich menu can be unlinked from a specific user using unlink
operation.
richmenu unlink
Working with LIFF app using liff
command
To develop more advanced LINE Bot, LIFF app may required. You can use liff
command to manage LIFF apps.
Add a LIFF app
liff add
List LIFF apps
liff list
Remove a LIFF app
liff remove
Update a LIFF app
liff update
Working with LINE Things using things
command
List all LINE Things trial products
things list:trial
Add a trial product
things add:trial
Remove a trial product
things remove:trial
Get device information by device ID and user ID
things get:device
Specify the product ID and user ID, and acquire the device information
things get:devices
Specify the device ID, and acquire the product ID and PSDI
things get:product
Scenario management API for automatic communication
Register (create or update) a scenario set for automatic communication under a product
things register:scenario-set
Get the scenario set registered under a product
things get:scenario-set
Delete a scenario set registered under a product
things remove:scenario-set
Working with LINE TV using linetv
command
List sportlight curation module types
linetv list:modules
To get sportlight curation module types in JSON use --format
option.
linetv list:modules --format json
Get sportlight data
linetv get:spotlight
To get sportlight data in JSON use --format
option.
linetv get:sportlight --format json
Category List
linetv list:category
To get category list in JSON use --format
option.
linetv get:sportlight --format json
Gets category home data
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>
Gets clip ranking data
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>
Gets a clip search result
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>
Gets the station home (TV station) list.
linetv list:station
To get station home (TV station) list in JSON use --format
option.
linetv list:station --format json
Gets the Station Home (TV Station) data.
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>
Gets live schedule information.
linetv live
To get live schedule data in JSON use --format
option.
linetv live --format json
Comprehensive usage
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
MIT License
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 copyright notice
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.