@martymarron/cliff
v0.1.0-delta
Published
cliff =====
Downloads
3
Readme
cliff
Description
This is a CLI(Command Line Interface) for the LIFF Server API. This provides a simple set of commands to perform CRUD for LIFF apps.
Table of Contents
Usage
$ npm install -g @martymarron/cliff
$ cliff COMMAND
running command...
$ cliff (-v|--version|version)
cliff/0.1.0-alpha linux-x64 node-v16.13.0
$ cliff --help [COMMAND]
USAGE
$ cliff COMMAND
...
Next, it requires to provide credentials as environment variables as follows.
$ cat << 'EOF' | tee .env
LINE_CLIENT_ID=1234567890
LINE_CLIENT_SECRET=abcdefgh1jklmnopqrstuvwxyz123456
BASE_URL=https://api.line.me
EOF
See the "FAQ - Where can I find my channel ID?" to know how to find credentials.
Please note that environment variables LINE_CLIENT_ID
and LINE_CLIENT_SECRET
correspond to the "Channel ID" and "Channel secret" on the developer console.BASE_URL
specifies the base URL of the LIFF Server API. Modify this value in accordance with your development environment. Leave it as is if you're not familar with this.
Commands
cliff list
Display LIFF apps which belong to your channel.
USAGE
$ cliff list
EXAMPLE
$ cliff list
[
{
"liffId": "1234567890-abcdefgh",
"view": {
"type": "full",
"url": "https://example.com",
"moduleMode": false
},
"description": "Example App",
"features": {},
"permanentLinkPattern": "concat"
}
]
See code: src/processors/list-command-processor.ts
cliff create
Create a LIFF app into your channel.
USAGE
$ cliff create --json [LIFF_APP]
OPTIONS
--json LIFF_APP json string to create the LIFF app
EXAMPLE
$ LIFF_APP=$(<<'EOF'
{
"view": {
"type": "full",
"url": "https://example.com"
},
"description": "This is an example LIFF app.",
"permanentLinkPattern": "concat"
}
EOF
)
$ cliff create --json $LIFF_APP
$ cliff list
[
{
"liffId": "1234567890-abcdefgh",
"view": {
"type": "full",
"url": "https://example.com",
"moduleMode": false
},
"description": "This is an example LIFF app.",
"features": {},
"permanentLinkPattern": "concat"
}
]
See code: src/processors/create-command-processor.ts
cliff update
Update the LIFF app.
USAGE
$ cliff update --json [LIFF_APP]
OPTIONS
--json LIFF_APP json string to update the LIFF app
EXAMPLE
$ LIFF_APP=$(<<'EOF'
{
"liffId": "1234567890-abcdefgh"
"view": {
"type": "full",
"url": "https://example.com"
},
"description": "Updated the description",
"permanentLinkPattern": "concat"
}
EOF
)
$ cliff update --json $LIFF_APP
$ cliff list
[
{
"liffId": "1234567890-abcdefgh",
"view": {
"type": "full",
"url": "https://example.com",
"moduleMode": false
},
"description": "Updated the description.",
"features": {},
"permanentLinkPattern": "concat"
}
]
See code: src/processors/update-command-processor.ts
cliff delete
Delete the LIFF app by specifying the LIFF ID.
USAGE
$ cliff delete --liff-id [LIFF_ID]
OPTIONS
--liff-id [LIFF_ID] liffId to delete
EXAMPLE
$ cliff delete --liff-id 1234567890-abcdefgh
$ cliff list
[]
See code: src/processors/delete-command-processor.ts
cliff help [COMMAND]
display help for cliff
USAGE
$ cliff help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help