Skip to content

CLI Command Groups

This page maps each xrmghost CLI command group to its purpose, known sub-commands, and the intended shape of future generated reference pages. It is a manual IA artifact: it defines structure and intent, not executable command documentation.


Reader-facing purpose: Prepare the machine to run plugins, or repair the installation — the first command after extracting xrmghost-cli-<version>-full.zip. Checks Windows and .NET Framework 4.7.2, resolves the Framework Host (bundle bin\ > managed install root > legacy), installs or repairs it in the managed root only, and names the next step. Exits 0 when the host is healthy or repaired, 1 when the state cannot be repaired.

Group type: Top-level command (no sub-commands).

Known flags (from source — not authoritative): --no-interactive.

Reference page: docs/cli/reference/init.mdx


Reader-facing purpose: Execute a Dataverse plugin out-of-process via FrameworkHost using a scenario file.

Group type: Top-level command (no sub-commands).

Known flags (from source — not authoritative): -a/--assembly-path, -t/--plugin-type, -s/--scenario, -f/--framework-host-path, --data-source, -n/--normal, -v/--verbose, -d/--debug, --debug-mode, -w/--debug-plugin-wait, -c/--continue-on-unlicensed, --unsecure-config, --secure-config, --no-interactive.

Data-source routing and caller identity: --data-source (auto by default) routes Retrieve, RetrieveMultiple and RetrieveMultipleRequest, not only RetrieveMultiple; auto is live-first, not mock-first. The contract — including what CreateOrganizationService(null) and an explicit user ID read as — is stated once, in the xg run reference.

Intended reference-page shape:

  • Path: docs/cli/reference/run.mdx
  • Sections: Synopsis, Description, Options, Exit codes, Examples
  • Generated from: xrmghost run --help or structured command manifest in xrmghost-cli

Reader-facing purpose: Generate a template JSON scenario file for a specified Dataverse plugin assembly and type, ready to use with run.

Group type: Top-level command (no sub-commands).

Known flags (from source — not authoritative): -p/--plugin-assembly-path, -t/--plugin-type, -o/--output, -f/--framework-host-path, -d/--debug-mode, --no-default-user-settings, --no-default-owner, --online, --no-interactive.

Intended reference-page shape:

  • Path: docs/cli/reference/generate-scenario.mdx
  • Sections: Synopsis, Description, Options, Output format, Examples
  • Generated from: xrmghost generate-scenario --help or structured command manifest in xrmghost-cli

Reader-facing purpose: Diagnose CLI configuration, FrameworkHost connectivity, AKMS reachability, and license validity. Verbose mode includes JWT subscription claims diagnostics. Read-only unless --fix, which installs a missing host and repairs or updates the managed install, never a bundled or explicit host.

Group type: Top-level command (no sub-commands).

Known flags (from source — not authoritative): -v/--verbose, -f/--framework-host-path, --fix, --no-interactive.

Intended reference-page shape:

  • Path: docs/cli/reference/doctor.mdx
  • Sections: Synopsis, Description, Options, Checks performed, Examples
  • Generated from: xrmghost doctor --help or structured command manifest in xrmghost-cli

Reader-facing purpose: Display information about the data collected by the tool, including telemetry scope and retention policy.

Group type: Top-level command (no sub-commands).

Known flags (from source — not authoritative): None documented.

Intended reference-page shape:

  • Path: docs/cli/reference/privacy.mdx
  • Sections: Synopsis, Description, What data is collected, Retention, Examples
  • Generated from: xrmghost privacy --help or structured command manifest in xrmghost-cli

Reader-facing purpose: Manage XrmGhost license status, activation, and machine identity. All licensing operations are grouped under this command.

Group type: Command group with sub-commands.

Sub-commandPurpose
license statusShow current license tier, expiration date, and subscription claims
license activateActivate a license using a bootstrap key
license get-platform-idDisplay the unique machine identifier required for licensing

Intended reference-page shape (per sub-command):

  • Paths: docs/cli/reference/license-status.mdx, docs/cli/reference/license-activate.mdx, docs/cli/reference/license-get-platform-id.mdx
  • Sections per page: Synopsis, Description, Options, Examples
  • Generated from: xrmghost license <sub-command> --help or structured command manifest in xrmghost-cli

TODO (ADO-1158 dependency): The exact flag names for license activate (bootstrap key flag) and license status (output format flags) are not fully resolved in the current contract. Document the dependency rather than inventing signatures. Resolve against the xrmghost-cli source before generating reference pages.


Reader-facing purpose: Manage Dataverse environment configurations — add, edit, delete, list, switch, and refresh environment metadata.

Group type: Command group with sub-commands.

Sub-commandPurpose
env listList all configured Dataverse environments
env addInteractive wizard to add a new Dataverse environment
env editEdit an existing environment configuration
env deleteRemove an environment configuration
env activateSet a specific environment as the active one
env deactivateDeactivate the currently active environment
env statusShow the status of configured environments
env importImport environment configurations from a JSON file
env exportExport environment configurations to a JSON file
env templateOutput a blank environment configuration template
env refreshRefresh the Dataverse metadata cache for an environment

Intended reference-page shape (per sub-command):

  • Paths: docs/cli/reference/env-list.mdx, docs/cli/reference/env-add.mdx, docs/cli/reference/env-edit.mdx, docs/cli/reference/env-delete.mdx, docs/cli/reference/env-activate.mdx, docs/cli/reference/env-deactivate.mdx, docs/cli/reference/env-status.mdx, docs/cli/reference/env-import.mdx, docs/cli/reference/env-export.mdx, docs/cli/reference/env-template.mdx, docs/cli/reference/env-refresh.mdx
  • Sections per page: Synopsis, Description, Options, Examples
  • Generated from: xrmghost env <sub-command> --help or structured command manifest in xrmghost-cli

Reader-facing purpose: Advanced: install or update the FrameworkHost in the managed install root. Not the first setup — that is init. On a winget or ZIP install the bundled host in bin\ takes precedence, so setup host does not change the host used by run.

Group type: Command group with sub-commands.

Sub-commandPurpose
setup hostAdvanced: install or update the FrameworkHost in the managed install root, from GitHub Releases

Known flags for setup host (from source — not authoritative): --check, --update.

Intended reference-page shape:

  • Path: docs/cli/reference/setup-host.mdx
  • Sections: Synopsis, Description, Options, Examples
  • Generated from: xrmghost setup host --help or structured command manifest in xrmghost-cli