Skip to content

xg env add

Terminal window
xg env add

xg env add opens an interactive wizard that collects all the information needed to register a new Dataverse environment with XrmGhost.

The wizard prompts you for the following details in sequence:

  1. Friendly name — a short, unique label used to reference this environment in other xg env commands (e.g. activate, delete, refresh). Must not be empty; uniqueness is enforced by the service layer.
  2. Environment URL — the full HTTPS URL of your Dynamics 365 / Dataverse organisation (e.g. https://myorg.crm.dynamics.com). Must be a valid absolute HTTP/HTTPS URL.
  3. Authentication method — currently fixed to Client Secret (the only supported method). Displayed for informational purposes.
  4. Client ID — the Application (Client) ID of the Azure AD app registration used for authentication.
  5. Client Secret — the client secret for the Azure AD app registration. Input is masked. Must not be empty.
  6. Metadata cache lifecycle — how long XrmGhost keeps Dataverse metadata cached for this environment. Choose from a preset list or enter a custom duration.

After the wizard completes, the environment configuration is saved and the client secret is stored securely in the platform credential store (Windows Credential Manager on Windows, or an equivalent secure store on other platforms).

License requirement: xg env add requires a Pro license tier. Running it without a valid Pro subscription will produce an error before the wizard starts.

xg env add is fully interactive — there are no non-interactive flags to pre-fill values. All inputs must be entered at the terminal prompt. Scripted or CI usage is not supported for this command.

The wizard offers the following preset durations. Select Custom to enter a value manually.

PresetDuration
1 hour1 hour
4 hours4 hours
1 day24 hours
1 week (default)7 days
2 weeks14 days
1 month~30 days
CustomUser-specified (see format below)

Custom duration format: a positive integer followed by a unit suffix — m (minutes), h (hours), or d (days). Examples: 30m, 12h, 3d.

xg env add accepts no command-line flags or arguments. The entire configuration is gathered through the interactive wizard.

FlagTypeDescription
(none)This command has no flags. All input is interactive.
CodeMeaning
0Environment added successfully.
1Wizard cancelled, required information was missing, or a duplicate friendly name was supplied.
-1License tier check failed (Pro license required).
Terminal window
xg env add

Launch the wizard and follow the prompts to register a new Dataverse environment. After completing all steps, the environment is available immediately for use with other xg env commands.

Add an environment and verify it was registered

Section titled “Add an environment and verify it was registered”
Terminal window
xg env add
xg env list

Run xg env add to register the environment, then run xg env list to confirm it appears in the list of configured environments.