-
Notifications
You must be signed in to change notification settings - Fork 76
CLI Tool
Furkan Senharputlu edited this page Apr 17, 2020
·
4 revisions
You can manage your license keys with the f-cli
command tool easily. See the details below:
f-cli is the terminal tool for f-license
Usage:
f-cli [command]
Available Commands:
activate Activate license
delete Delete license
generate Generate new license
get Get license
help Help about any command
inactivate Inactivate license
verify Verify license
Flags:
-h, --help help for f-cli
Use "f-cli [command] --help" for more information about a command.
- Create a
license.json
file like below:
{
"type": "Trial",
"alg": "HS256",
"claims": {
"username": "Furkan",
"address": "Istanbul, Turkey"
},
"active": true
}
- Generate a license key by running:
./f-cli generate sample_license.json
It will return license id
and token
:
INFO[0000] License successfully generated
ID: 5e97921c853c5a8c7c4a6c66
Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiSXN0YW5idWwsIFR1cmtleSIsInVzZXJuYW1lIjoiRnVya2FuIn0.jp_s-Ycso-Dtb65cjsz5Q0FID0hNd2VNE5EkccJZUIE
- Verify the generated license key whether it is valid by running:
./f-cli verify eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiSXN0YW5idWwsIFR1cmtleSIsInVzZXJuYW1lIjoiRnVya2FuIn0.jp_s-Ycso-Dtb65cjsz5Q0FID0hNd2VNE5EkccJZUIE
It will return a boolean whether license is valid:
true
- Delete the license key by running:
./f-cli delete 5e97921c853c5a8c7c4a6c66
It will return:
INFO[0000] License successfully deleted