Overview

CLI License Decoder

Source

https://bitbucket.org/rewbs/license-decoder-cli


Usage

java -jar license-decoder-cli-<version>.jar -license <file> [options]

Options

-activeApps                   List only active apps. Equivalent to '-showKeysOnly -values true -keys
                              crucible.active,fisheye.active,conf.active,jira.active,crowd.active,bamboo.active'

-keys <key1,key2,...>         Show only properties with names in this comma delimited list. Comparison is case
                              insensitive. Default shows all.

-values <value1,value2,...>   Show only properties with values in this comma delimited list. Comparison is case
                              insensitive. Default shows all.`

-showKeysOnly                 Show property keys only - don't show values. Default shows both.

-json                         Output in json. Default is plain text, with one key[=value] entry per line.

Return codes

0 License decoded and at least 1 property found.
1 Could not load license file.
2 No license properties matched the filter.

Examples

Show all properties

> java -jar license-decoder-cli-current.jar -license /data/jirastudio/home/studio.license

bamboo.LicenseEdition=ENTERPRISE
ondemand=true
NumberOfUsers=-1
ContactName=Clark Kent
bamboo.NumberOfBambooLocalAgents=-1
conf.active=true
PurchaseDate=2012-07-09
LicenseTypeName=COMMERCIAL
LicenseExpiryDate=unlimited
ContactEMail=clark.kent@dailyplanet.com
bamboo.active=true
bamboo.NumberOfBambooRemoteAgents=10
bamboo.NumberOfBambooPlans=-1
jira.LicenseEdition=ENTERPRISE
jira.numHostedUsers=10
MaintenanceExpiryDate=2082-07-09
conf.numHostedUsers=10
SEN=SEN-500
Organisation=dailyplanet
CreationDate=2012-07-09
crowd.active=true
licenseVersion=2
jira.active=true
Evaluation=false

Filter by key

> java -jar license-decoder-cli-current.jar -license /data/jirastudio/home/studio.license -keys sen,contactname

ContactName=Clark Kent
SEN=SEN-500

Filter by value

> java -jar license-decoder-cli-current.jar -license /data/jirastudio/home/studio.license -values ENTERPRISE

bamboo.LicenseEdition=ENTERPRISE
jira.LicenseEdition=ENTERPRISE

Show keys only

> java -jar license-decoder-cli-current.jar -license /data/jirastudio/home/studio.license -values ENTERPRISE -showKeysOnly

bamboo.LicenseEdition
jira.LicenseEdition

JSON output

> java -jar license-decoder-cli-current.jar -license /data/jirastudio/home/studio.license -values ENTERPRISE -json

{
  "bamboo.LicenseEdition": "ENTERPRISE",
  "jira.LicenseEdition": "ENTERPRISE"
}

Show only active applications

> java -jar license-decoder-cli-current.jar -license /data/jirastudio/home/studio.license -activeApps

conf.active
bamboo.active
crowd.active
jira.active

(equivalent to: -showKeysOnly -values true -keys crucible.active,fisheye.active,conf.active,jira.active,crowd.active,bamboo.active)

Read multiple licenses at once

> java -jar license-decoder-cli-current.jar -activeApps /etc/atlassian/config/a.jira-dev.com/studio.license /etc/atlassian/config/b.jira-dev.com/studio-license
filename=/etc/atlassian/config/a.jira-dev.com/studio.license
conf.active
bamboo.active
crowd.active
jira.active
filename=/etc/atlassian/config/b.jira-dev.com/studio-license
crowd.active
jira.active

> java -jar license-decoder-cli-current.jar -activeApps -json /etc/atlassian/config/a.jira-dev.com/studio.license /etc/atlassian/config/b.jira-dev.com/studio.license
{
  "/etc/atlassian/config/a.jira-dev.com/studio.license": [
    "conf.active",
    "jira.active",
    "crowd.active",
    "bamboo.active"
  ],
  "/etc/atlassian/config/b.jira-dev.com/studio.license": [
    "jira.active",
    "crowd.active"
  ]
}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.