LINE WORKS CLI
CLI for LINE WORKS API
Description
Command line tool for LINE WORKS API.
https://developers.worksmobile.com/jp/reference/introduction?lang=ja
Article
Japanese article : https://qiita.com/mmclsntr/items/ecd2e88462a6a30be573
Feature
- Get Access Token the way you choose.
Usage
See help.
lineworks -h
lineworks [subcommand] -h
Installation
Download binary files from Releases
Choose a download link according to your environment.
- macOS (Intel) : lineworks-cli_x.x.x_Darwin_x86_64.tar.gz
- macOS (M1/M2) : lineworks-cli_x.x.x_Darwin_arm64.tar.gz
- Windows (64bit) : lineworks-cli_x.x.x_Windows_x86_64.tar.gz
- Windows (Arm) : lineworks-cli_x.x.x_Windows_arm64.tar.gz
- Linux (Arm) : lineworks-cli_x.x.x_Linux_arm64.tar.gz
- Linux (Intel 64bit) : lineworks-cli_x.x.x_Linux_x86_64.tar.gz
- Linux (Intel 32bit) : lineworks-cli_x.x.x_Linux_i386.tar.gz
Binary file name
- Linux/macOS :
lineworks
- Windows :
lineworks.exe
Configuration
Config file
Configuation of this CLI is stored in home directory.
On Linux, macOS,
$HOME/.config/lineworks/
On Windows,
%USERPROFILE%\.config\linworks\
If you want to change config dir path, set $LINEWORKS_CONFIG_DIR environment variable.
Profile
The setting can be set for each profile, and the setting can be switched by the profile parameter specified when executing the command.
Refer to the list of configured profiles with the following command.
On Linux, macOS,
./lineworks list-profiles
On Windows,
.\lineworks.exe list-profiles
Set OAuth client credentials
On Linux, macOS,
./lineworks configure set-client \
--client-id "client_id" \
--client-secret "client_secret" \
--profile "profile"
On Windows,
.\lineworks.exe configure set-client `
--client-id "client_id" `
--client-secret "client_secret" `
--profile "profile"
You can Check configured settings.
On Linux, macOS,
./lineworks configure get-client --profile "profile"
On Windows,
.\lineworks.exe configure get-client --profile "profile"
Set Redirect URL on Developer Console
※ Only User Account authorization
Get redirect URL
On Linux, macOS,
./lineworks configure get-redirect-url --profile "profile"
On Windows,
.\lineworks.exe configure get-redirect-url --profile "profile"
Add it to Redirect URL setting of App on Developer Console.
Set Service Account setting
※ Only Service Account authorization
On Linux, macOS,
./lineworks configure set-service-account \
--service-account-id "serivce_account_id" \
--private-key-file "private_key_file_path" \
--profile "profile"
On Windows,
.\lineworks.exe configure set-service-account `
--service-account-id "serivce_account_id" `
--private-key-file "private_key_file_path" `
--profile "profile"
You can Check configured settings.
On Linux, macOS,
./lineworks configure get-service-account --profile "profile"
On Windows,
.\lineworks.exe configure get-service-account --profile "profile"
Get Access Token
Request Access Token (User Account authorization)
Request
On Linux, macOS,
./lineworks auth user-account --scopes "scopes" --profile "profile"
On Windows,
.\lineworks.exe auth user-account --scopes "scopes" --profile "profile"
Automatically open browser and show sign-on page.
Sign on by user account.
Request Access Token (Service Account authorization)
※ Required to set Service Account configuration before.
Request
On Linux, macOS,
./lineworks auth service-account --scopes "scopes" --profile "profile"
On Windows,
.\lineworks.exe auth service-account --scopes "scopes" --profile "profile"
Refer Access Token
On Linux, macOS,
./lineworks auth get-access-token --profile "profile"
On Windows,
.\lineworks auth get-access-token --profile "profile"
Contribution
- Fork (https://github.com/mmclsntr/lineworks-cli)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Create a new Pull Request
Authors
mmclsntr
License
MIT