Skip to content

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.

Example usage

  1. Create a license.json file like below:
{
  "type": "Trial",
  "alg": "HS256",
  "claims": {
    "username": "Furkan",
    "address": "Istanbul, Turkey"
  },
  "active": true
}
  1. 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
  1. 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
  1. Delete the license key by running:
./f-cli delete 5e97921c853c5a8c7c4a6c66

It will return:

INFO[0000] License successfully deleted  
Clone this wiki locally