xg license activate
xg license activate
Section titled “xg license activate”Activates an XrmGhost license on the current machine using a bootstrap activation key provided by your administrator.
Synopsis
Section titled “Synopsis”xg license activate <ACTIVATION_KEY>Description
Section titled “Description”xg license activate exchanges a one-time bootstrap activation key for a rotating API key issued by the XrmGhost Key Management Service (AKMS). The API key is encrypted and stored locally on the machine, where it is used for all subsequent authenticated operations.
What happens during activation
Section titled “What happens during activation”- The CLI reads the local Platform ID (machine GUID) to identify this machine to AKMS.
- The bootstrap key is securely stored locally as
bootstrap.lic(encrypted viaSecureFileService). - The CLI contacts AKMS and exchanges the bootstrap key for an API key.
- If AKMS returns a valid API key, the key is encrypted and persisted locally; the expiry date is displayed.
- The bootstrap key is retained as a local fallback for automatic API-key refresh when the issued key expires.
Online vs offline behaviour
Section titled “Online vs offline behaviour”| Scenario | Behaviour |
|---|---|
| Online (AKMS reachable) | Bootstrap key is exchanged for an API key immediately. The API key ID, Client ID, and expiry timestamps (UTC and local) are printed to the terminal. |
| AKMS unreachable | Activation fails at the key-exchange step. The bootstrap key has already been stored locally. Re-run license activate once connectivity is restored — the stored bootstrap key will be used automatically by future refresh attempts. |
| Platform ID missing | Activation fails before contacting AKMS. Run the CLI at least once to generate a Platform ID, or use xg license get-platform-id to confirm it exists. |
Arguments
Section titled “Arguments”| Argument | Required | Description |
|---|---|---|
<ACTIVATION_KEY> | Yes | The bootstrap activation key provided by the administrator. The key is displayed partially masked in the terminal output. |
Options
Section titled “Options”The license activate command currently accepts no flags beyond the positional <ACTIVATION_KEY> argument.
| Flag | Type | Default | Description |
|---|---|---|---|
| (none) | — | — | No optional flags are defined for this command. |
Note: A custom AKMS endpoint override flag is planned for a future release. The AKMS base URL is currently read from the compiled
AkmsBaseUrlconfiguration value.
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Activation succeeded. API key obtained from AKMS and stored locally. |
1 | Activation failed. Possible reasons: empty or invalid activation key, Platform ID not found, AKMS unreachable, or AKMS returned no valid API key. |
Examples
Section titled “Examples”Activate with a bootstrap key
Section titled “Activate with a bootstrap key”xg license activate BOOTSTRAP-KEY-1234-ABCD-5678The CLI will display the Platform ID (partially), the first 4 characters of the activation key, and — on success — the issued API Key ID, Client ID, and expiry timestamps.
Verify activation succeeded
Section titled “Verify activation succeeded”After activating, confirm the license is active with:
xg license statusA successful activation results in License Active output with the tier name and expiry date.
Activate and immediately check status (script usage)
Section titled “Activate and immediately check status (script usage)”xg license activate "$BOOTSTRAP_KEY" && xg license statusUse && to run license status only if activation exits with code 0.
See Also
Section titled “See Also”- xg license status — display current license tier, expiry, and subscription claims
- xg license get-platform-id — display the unique machine identifier required for licensing
- CLI Overview — introduction to the
xgCLI and command groups