Skip to content

CLI reference

This page is generated from the crm command tree.

crm

Stateful CLI for Dynamics 365 CE on-prem 9.x (Web API).

Usage:

crm [OPTIONS] COMMAND [ARGS]...

Options:

  --json                          Emit machine-readable JSON output.
  --dry-run                       Preview HTTP request without issuing it.
  --profile TEXT                  Connection profile name (from
                                  ~/.crm/profiles).
  --password TEXT                 Override password (otherwise read from
                                  D365_PASSWORD).
  --log-level [debug|info|warning|error]
                                  Log level (env: CRM_LOG_LEVEL). Default:
                                  warning.
  --verbose                       Alias for --log-level debug.
  --log-format [text|json-line]   Log output format (env: CRM_LOG_FORMAT).
                                  Default: text.
  --auth-scheme [ntlm|kerberos|negotiate]
                                  HTTP auth scheme (env: CRM_AUTH_SCHEME).
                                  Default: ntlm.
  --stage-only                    Stage metadata changes without publishing
                                  (env: CRM_STAGE_ONLY). Forces every
                                  create/update command to --no-publish.
  --session TEXT                  Session name.
  --version                       Show the version and exit.
  -h, --help                      Show this message and exit.

action

Invoke OData functions and actions (unbound or bound).

Usage:

crm action [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

function

Call an unbound OData function. Params encoded inline per OData v4.

Usage:

crm action function [OPTIONS] NAME

Options:

  --params TEXT  JSON dict of function parameters.
  -h, --help     Show this message and exit.

invoke

POST an OData action — unbound by default, bound when --bind-set/--bind-id given.

Usage:

crm action invoke [OPTIONS] NAME

Options:

  --body TEXT       JSON body for the action.
  --body-file FILE
  --bind-set TEXT   Entity set name to bind the action to (e.g. 'workflows').
                    Requires --bind-id.
  --bind-id TEXT    Record id to bind the action to. Requires --bind-set.
  --cast TEXT       Namespace for the action when bound. Override only for
                    custom namespaces.  [default: Microsoft.Dynamics.CRM]
  -h, --help        Show this message and exit.

app

Create and manage model-driven apps (appmodule).

Usage:

crm app [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

add-components

Bind components to an app (AddAppComponents).

Usage:

crm app add-components [OPTIONS] APP_ID

Options:

  --component TEXT  Repeatable 'kind:guid' (kind:
                    view|chart|form|dashboard|sitemap|bpf).  [required]
  -h, --help        Show this message and exit.

create

Create a model-driven app.

Usage:

crm app create [OPTIONS]

Options:

  --name TEXT               App display name.  [required]
  --unique-name TEXT        Publisher-prefixed unique name, e.g.
                            'cwx_crmworx'.  [required]
  --description TEXT
  --if-exists [error|skip]
  --solution TEXT           Target solution uniquename
                            (MSCRM.SolutionUniqueName). Defaults to the
                            profile's default_solution.
  --require-solution        Fail if no solution resolves (also via
                            CRM_REQUIRE_SOLUTION).
  --publish / --no-publish
  -h, --help                Show this message and exit.

set-sitemap

Create a sitemap from a SiteMapXml file.

Usage:

crm app set-sitemap [OPTIONS] SITEMAP_NAME

Options:

  --xml-file FILE     Path to a file containing the SiteMapXml.  [required]
  --unique-name TEXT  App uniquename to link the sitemap to (sets
                      sitemapnameunique).
  --solution TEXT     Target solution uniquename (MSCRM.SolutionUniqueName).
                      Defaults to the profile's default_solution.
  --require-solution  Fail if no solution resolves (also via
                      CRM_REQUIRE_SOLUTION).
  -h, --help          Show this message and exit.

async

List, inspect, and cancel asynchronous operations.

Usage:

crm async [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

cancel

Cancel a pending or suspended asyncoperation.

Usage:

crm async cancel [OPTIONS] ASYNC_OPERATION_ID

Options:

  --yes       Skip interactive confirmation.
  -h, --help  Show this message and exit.

get

Get one asyncoperation row.

Usage:

crm async get [OPTIONS] ASYNC_OPERATION_ID

Options:

  -h, --help  Show this message and exit.

list

List asyncoperation rows.

Usage:

crm async list [OPTIONS]

Options:

  --state TEXT         ready | suspended | locked | completed | <int>
  --message TEXT       Filter by messagename (e.g. ImportSolution).
  --owner TEXT         Filter by systemuser GUID.
  --top INTEGER        Page size per call (default 50).
  --all                Follow @odata.nextLink until exhausted (caps at --max-
                       pages).
  --max-pages INTEGER  Safety cap on pagination depth when --all is set
                       (default 20).
  -h, --help           Show this message and exit.

batch

Execute a $batch from a JSON file.

Usage:

crm batch [OPTIONS] FILE_PATH

Options:

  --no-transaction     Send each op as a top-level operation; no changeset
                       wrapping.
  --continue-on-error  Send Prefer: odata.continue-on-error (requires --no-
                       transaction).
  --output FILE        Write BatchResult[] JSON to this path.
  --timeout INTEGER    Override request timeout (seconds) for the batch call.
  -h, --help           Show this message and exit.

connection

Manage server connection profiles and authentication.

Usage:

crm connection [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

connect

Save a connection profile and test the credentials with WhoAmI.

Usage:

crm connection connect [OPTIONS]

Options:

  --url TEXT               Server URL, e.g. https://crm.contoso.local/contoso
                           [required]
  --username TEXT          [required]
  --domain TEXT            AD domain (optional for on-prem with UPN).
  --password TEXT          Password (else read from D365_PASSWORD).
  --profile-name TEXT      Save under this profile name.
  --api-version TEXT
  --no-verify-ssl          Skip SSL certificate verification.
  --default-solution TEXT  Default solution uniquename for mutating metadata
                           commands.
  --publisher-prefix TEXT  Default schema-name prefix for create commands,
                           e.g. 'new'.
  -h, --help               Show this message and exit.

disconnect

Clear the active profile from the session.

Usage:

crm connection disconnect [OPTIONS]

Options:

  -h, --help  Show this message and exit.

profiles

List saved profiles.

Usage:

crm connection profiles [OPTIONS]

Options:

  -h, --help  Show this message and exit.

status

Show the active session + profile (no network call).

Usage:

crm connection status [OPTIONS]

Options:

  -h, --help  Show this message and exit.

test

Reachability check: WhoAmI + report API base.

Usage:

crm connection test [OPTIONS]

Options:

  -h, --help  Show this message and exit.

whoami

Issue WhoAmI() against the server.

Usage:

crm connection whoami [OPTIONS]

Options:

  -h, --help  Show this message and exit.

data

Bulk CSV/JSON dataset export.

Usage:

crm data [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

export

Usage:

crm data export [OPTIONS] ENTITY_SET

Options:

  -o, --output FILE      [required]
  --select TEXT
  --filter TEXT          OData $filter.
  --page-size INTEGER
  --max-records INTEGER
  --format [csv|json]
  -h, --help             Show this message and exit.

entity

Record CRUD against entity sets (accounts, contacts, ...).

Usage:

crm entity [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

associate

Associate two records via a collection-valued nav property (1:N from one-side or N:N).

Usage:

crm entity associate [OPTIONS] TARGET_SET TARGET_ID NAV RELATED_SET RELATED_ID

Options:

  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

clear-lookup

Clear a single-valued lookup via DELETE /$ref.

Usage:

crm entity clear-lookup [OPTIONS] ENTITY_SET RECORD_ID NAV

Options:

  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

create

POST a new record.

Usage:

crm entity create [OPTIONS] ENTITY_SET

Options:

  --data TEXT               JSON object as string.
  --data-file FILE          Path to a JSON file with the record body.
  --no-return               Don't request the record back; just GUID.
  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

delete

DELETE a record.

Usage:

crm entity delete [OPTIONS] ENTITY_SET RECORD_ID

Options:

  --if-match ETAG           Optimistic concurrency etag.
  --yes                     Skip interactive confirmation.
  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

disassociate

Disassociate two records. Omit --related-* for single-valued lookups.

Usage:

crm entity disassociate [OPTIONS] TARGET_SET TARGET_ID NAV

Options:

  --related-set TEXT        Required for collection-valued nav properties.
  --related-id TEXT         Required for collection-valued nav properties.
  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

get

GET .

Usage:

crm entity get [OPTIONS] ENTITY_SET RECORD_ID

Options:

  --select TEXT                   Repeatable; column names.
  --expand TEXT                   Repeatable; navigation properties.
  --annotations / --no-annotations
                                  Include formatted values.
  -h, --help                      Show this message and exit.

set-lookup

Set a single-valued lookup via @odata.bind PATCH.

Usage:

crm entity set-lookup [OPTIONS] ENTITY_SET RECORD_ID NAV RELATED_SET
                      RELATED_ID

Options:

  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

update

PATCH an existing record.

Usage:

crm entity update [OPTIONS] ENTITY_SET RECORD_ID

Options:

  --data TEXT               JSON object as string.
  --data-file FILE
  --allow-create            Permit upsert (skip If-Match header).
  --return-record           Ask server to return the updated row.
  --if-match ETAG           Optimistic concurrency etag. Example (POSIX):
                            --if-match 'W/"123"'. Use --if-match "*" to
                            require any current version.
  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

upsert

PATCH with create-if-missing semantics.

Usage:

crm entity upsert [OPTIONS] ENTITY_SET RECORD_ID

Options:

  --data TEXT               JSON object as string.
  --data-file FILE
  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

init

Bootstrap a crm workspace.

With --template: writes .env.example to the current directory. Without args: interactive wizard to create a connection profile.

Usage:

crm init [OPTIONS]

Options:

  --template  Write .env.example to the current directory and exit.
  -h, --help  Show this message and exit.

metadata

Browse entity / attribute / relationship metadata.

Usage:

crm metadata [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

add-attribute

Add an attribute (column) to an existing entity.

Usage:

crm metadata add-attribute [OPTIONS] ENTITY

Options:

  --kind [string|memo|integer|bigint|decimal|double|money|boolean|datetime|picklist|multiselect|lookup|image|file]
                                  Attribute kind.  [required]
  --schema-name TEXT              PascalCase with publisher prefix, e.g.
                                  'new_Amount'. Defaults to
                                  <publisher_prefix>_<Display> from the
                                  profile.
  --display TEXT                  UI label.  [required]
  --description TEXT
  --required [None|Recommended|ApplicationRequired]
  --max-length INTEGER            String/memo: max characters.
  --format TEXT                   String: Text|Email|Url|Phone|TextArea.
                                  Datetime: DateOnly|DateAndTime.
  --min FLOAT                     Numeric kinds: minimum value.
  --max FLOAT                     Numeric kinds: maximum value.
  --precision INTEGER             Decimal/double/money: precision (decimals).
  --true-label TEXT               Boolean: label for true.
  --false-label TEXT              Boolean: label for false.
  --default-value TEXT            Boolean: 'true'/'false'. Picklist: int
                                  option value.
  --optionset-name TEXT           Picklist/multiselect: reference an existing
                                  global option set.
  --option TEXT                   Picklist/multiselect: inline option as
                                  'value:label' or ':label' (auto value).
                                  Repeatable.
  --target-entity TEXT            Lookup: referenced entity logical name.
  --relationship-schema TEXT      Lookup: override auto-generated relationship
                                  name.
  --max-size-kb INTEGER           File: max attachment size in KB. Default
                                  32768.
  --solution TEXT                 Target solution uniquename
                                  (MSCRM.SolutionUniqueName). Defaults to the
                                  profile's default_solution.
  --require-solution              Fail if no solution resolves (also via
                                  CRM_REQUIRE_SOLUTION).
  --if-exists [error|skip]        If the attribute already exists: error
                                  (default) or skip (no-op success).
  --publish / --no-publish        Run PublishAllXml after creation. Default:
                                  publish.
  -h, --help                      Show this message and exit.

attribute

Show a single attribute definition.

Usage:

crm metadata attribute [OPTIONS] LOGICAL_NAME ATTRIBUTE_NAME

Options:

  -h, --help  Show this message and exit.

attributes

List attributes for an entity.

Usage:

crm metadata attributes [OPTIONS] LOGICAL_NAME

Options:

  -h, --help  Show this message and exit.

create-entity

Create a new custom entity (table).

Usage:

crm metadata create-entity [OPTIONS]

Options:

  --schema-name TEXT              PascalCase with publisher prefix, e.g.
                                  'new_Project'. Defaults to
                                  <publisher_prefix>_<Display> from the
                                  profile.
  --display TEXT                  Singular UI label, e.g. 'Project'.
                                  [required]
  --display-collection TEXT       Plural UI label. Defaults to <display>+'s'.
  --primary-attr TEXT             Schema name of the primary name attribute
                                  (default '<prefix>_Name').
  --primary-label TEXT            UI label for primary attribute. Default
                                  'Name'.
  --primary-max-length INTEGER    Max length for primary name string column.
                                  Default 200.
  --description TEXT
  --ownership [UserOwned|OrganizationOwned]
  --has-activities
  --has-notes
  --is-activity                   Create as an activity entity.
  --solution TEXT                 Target solution uniquename
                                  (MSCRM.SolutionUniqueName). Defaults to the
                                  profile's default_solution.
  --require-solution              Fail if no solution resolves (also via
                                  CRM_REQUIRE_SOLUTION).
  --if-exists [error|skip]        If the entity already exists: error
                                  (default) or skip (no-op success).
  --publish / --no-publish        Run PublishAllXml after creation. Default:
                                  publish.
  -h, --help                      Show this message and exit.

create-many-to-many

Create an N:N relationship via the dedicated action.

Usage:

crm metadata create-many-to-many [OPTIONS]

Options:

  --schema-name TEXT              [required]
  --entity1 TEXT                  [required]
  --entity2 TEXT                  [required]
  --intersect-entity TEXT         [required]
  --entity1-menu-label TEXT
  --entity1-menu-behavior [UseLabel|UseCollectionName|DoNotDisplay]
  --entity1-menu-order INTEGER
  --entity2-menu-label TEXT
  --entity2-menu-behavior [UseLabel|UseCollectionName|DoNotDisplay]
  --entity2-menu-order INTEGER
  --solution TEXT                 Target solution uniquename
                                  (MSCRM.SolutionUniqueName). Defaults to the
                                  profile's default_solution.
  --require-solution              Fail if no solution resolves (also via
                                  CRM_REQUIRE_SOLUTION).
  --if-exists [error|skip]        If the relationship already exists: error
                                  (default) or skip (no-op success).
  --publish / --no-publish
  -h, --help                      Show this message and exit.

create-one-to-many

Create a 1:N relationship and its lookup attribute atomically.

Usage:

crm metadata create-one-to-many [OPTIONS]

Options:

  --schema-name TEXT              Relationship schema name with publisher
                                  prefix.  [required]
  --referenced-entity TEXT        "1" side logical name (e.g. account).
                                  [required]
  --referencing-entity TEXT       "N" side logical name (e.g. new_project).
                                  [required]
  --lookup-schema TEXT            Lookup attribute schema name on referencing
                                  entity.  [required]
  --lookup-display TEXT           UI label for the lookup attribute.
                                  [required]
  --lookup-required [None|Recommended|ApplicationRequired]
  --lookup-description TEXT
  --cascade-assign [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-delete [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-reparent [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-share [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-unshare [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-merge [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --menu-label TEXT
  --menu-behavior [UseLabel|UseCollectionName|DoNotDisplay]
  --menu-order INTEGER
  --solution TEXT                 Target solution uniquename
                                  (MSCRM.SolutionUniqueName). Defaults to the
                                  profile's default_solution.
  --require-solution              Fail if no solution resolves (also via
                                  CRM_REQUIRE_SOLUTION).
  --if-exists [error|skip]        If the relationship already exists: error
                                  (default) or skip (no-op success).
  --publish / --no-publish
  -h, --help                      Show this message and exit.

create-optionset

Create a global option set.

Usage:

crm metadata create-optionset [OPTIONS]

Options:

  --name TEXT               Fully prefixed option set name, e.g.
                            'new_priority'. Defaults to
                            <publisher_prefix>_<display> from the profile.
  --display TEXT            [required]
  --description TEXT
  --option TEXT             Option as 'value:label' or ':label' (auto value).
                            Repeatable.
  --solution TEXT           Target solution uniquename
                            (MSCRM.SolutionUniqueName). Defaults to the
                            profile's default_solution.
  --require-solution        Fail if no solution resolves (also via
                            CRM_REQUIRE_SOLUTION).
  --if-exists [error|skip]  If the option set already exists: error (default)
                            or skip (no-op success).
  --publish / --no-publish
  -h, --help                Show this message and exit.

delete-entity

Permanently delete a custom entity (table) and ALL its rows.

Usage:

crm metadata delete-entity [OPTIONS] LOGICAL_NAME

Options:

  --yes               Skip interactive confirmation.
  --solution TEXT     Target solution uniquename (MSCRM.SolutionUniqueName).
                      Defaults to the profile's default_solution.
  --require-solution  Fail if no solution resolves (also via
                      CRM_REQUIRE_SOLUTION).
  -h, --help          Show this message and exit.

delete-optionset

Delete a custom global option set.

Usage:

crm metadata delete-optionset [OPTIONS] NAME

Options:

  --yes               Skip interactive confirmation.
  --solution TEXT     Target solution uniquename (MSCRM.SolutionUniqueName).
                      Defaults to the profile's default_solution.
  --require-solution  Fail if no solution resolves (also via
                      CRM_REQUIRE_SOLUTION).
  -h, --help          Show this message and exit.

entities

List entity definitions.

Usage:

crm metadata entities [OPTIONS]

Options:

  --custom-only
  --top INTEGER
  -h, --help     Show this message and exit.

entity

Show full entity definition.

Usage:

crm metadata entity [OPTIONS] LOGICAL_NAME

Options:

  -h, --help  Show this message and exit.

get-optionset

Retrieve a global option set with options expanded.

Usage:

crm metadata get-optionset [OPTIONS] NAME

Options:

  -h, --help  Show this message and exit.

list-actions

List OData actions advertised by the service ($metadata).

Usage:

crm metadata list-actions [OPTIONS]

Options:

  -h, --help  Show this message and exit.

list-functions

List OData functions advertised by the service ($metadata).

Usage:

crm metadata list-functions [OPTIONS]

Options:

  -h, --help  Show this message and exit.

list-optionsets

List global option set definitions.

Usage:

crm metadata list-optionsets [OPTIONS]

Options:

  --custom-only
  --top INTEGER
  -h, --help     Show this message and exit.

picklist

Retrieve option set values for a picklist / state / status attribute.

Usage:

crm metadata picklist [OPTIONS] LOGICAL_NAME ATTRIBUTE

Options:

  --no-global  Skip GlobalOptionSet expansion.
  -h, --help   Show this message and exit.

relationships

Show one-to-many, many-to-one, and many-to-many relationships.

Usage:

crm metadata relationships [OPTIONS] LOGICAL_NAME

Options:

  -h, --help  Show this message and exit.

update-attribute

Update an attribute (column) definition (retrieve-merge-write).

Option-set option edits are NOT handled here — use update-optionset.

Usage:

crm metadata update-attribute [OPTIONS] ENTITY ATTRIBUTE

Options:

  --display TEXT                  New UI label.
  --description TEXT
  --required [None|Recommended|ApplicationRequired]
  --max-length INTEGER            String/memo: max characters.
  --precision INTEGER             Decimal/double/money: precision (decimals).
  --min FLOAT                     Numeric: minimum value.
  --max FLOAT                     Numeric: maximum value.
  --format TEXT                   String: Text|Email|Url|Phone|TextArea.
                                  Datetime: DateOnly|DateAndTime.
  --solution TEXT                 Apply via MSCRM.SolutionUniqueName.
  --publish / --no-publish        Run PublishAllXml after update. Default:
                                  publish.
  -h, --help                      Show this message and exit.

update-entity

Update an entity (table) definition (retrieve-merge-write).

Usage:

crm metadata update-entity [OPTIONS] LOGICAL_NAME

Options:

  --display TEXT                  New singular UI label.
  --display-collection TEXT       New plural UI label.
  --description TEXT              New entity description.
  --ownership [UserOwned|OrganizationOwned]
                                  Note: Dataverse rejects ownership changes
                                  post-create.
  --has-activities / --no-has-activities
                                  Enable/disable activities.
  --has-notes / --no-has-notes    Enable/disable notes.
  --solution TEXT                 Apply via MSCRM.SolutionUniqueName.
  --publish / --no-publish        Run PublishAllXml after update. Default:
                                  publish.
  -h, --help                      Show this message and exit.

update-optionset

Granular update: insert/update/delete/reorder options.

Usage:

crm metadata update-optionset [OPTIONS] NAME

Options:

  --insert-option TEXT      Insert option 'value:label' or ':label'.
                            Repeatable.
  --update-option TEXT      Update existing option 'value:new_label'.
                            Repeatable.
  --delete-option INTEGER   Delete option by value. Repeatable.
  --reorder TEXT            Comma-separated full ordered list of values, e.g.
                            '1,2,7,4'.
  --solution TEXT           Target solution uniquename
                            (MSCRM.SolutionUniqueName). Defaults to the
                            profile's default_solution.
  --require-solution        Fail if no solution resolves (also via
                            CRM_REQUIRE_SOLUTION).
  --publish / --no-publish
  -h, --help                Show this message and exit.

update-relationship

Update a relationship definition (retrieve-merge-write).

Usage:

crm metadata update-relationship [OPTIONS] SCHEMA_NAME

Options:

  --cascade-assign [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-delete [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-reparent [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-share [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-unshare [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --cascade-merge [NoCascade|Cascade|Active|UserOwned|RemoveLink|Restrict]
  --menu-behavior [UseLabel|UseCollectionName|DoNotDisplay]
  --menu-label TEXT
  --menu-order INTEGER
  --solution TEXT                 Apply via MSCRM.SolutionUniqueName.
  --publish / --no-publish        Run PublishAllXml after update. Default:
                                  publish.
  -h, --help                      Show this message and exit.

query

Run OData and FetchXML queries.

Usage:

crm query [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

count

Count rows for an entity via RetrieveTotalRecordCount (cached server-side).

Usage:

crm query count [OPTIONS] ENTITY

Options:

  -h, --help  Show this message and exit.

fetchxml

Run a FetchXML query.

Usage:

crm query fetchxml [OPTIONS] ENTITY_SET

Options:

  --xml TEXT                      Inline FetchXML string.
  --file FILE                     Path to a FetchXML file.
  --annotations / --no-annotations
  -h, --help                      Show this message and exit.

odata

OData v4 query over an entity set.

Usage:

crm query odata [OPTIONS] ENTITY_SET

Options:

  --select TEXT
  --filter TEXT                   OData $filter expression.
  --top INTEGER
  --orderby TEXT
  --expand TEXT
  --count                         Also request $count.
  --page-size INTEGER
  --annotations / --no-annotations
  -h, --help                      Show this message and exit.

saved

Execute a system view (savedquery) by GUID. Use --json query odata savedqueries to discover IDs.

Usage:

crm query saved [OPTIONS] ENTITY_SET SAVEDQUERY_ID

Options:

  --annotations / --no-annotations
  --page-size INTEGER
  -h, --help                      Show this message and exit.

user

Execute a saved view (userquery) by GUID.

Usage:

crm query user [OPTIONS] ENTITY_SET USERQUERY_ID

Options:

  --annotations / --no-annotations
  --page-size INTEGER
  -h, --help                      Show this message and exit.

repl

Interactive REPL (default when no subcommand is provided).

Usage:

crm repl [OPTIONS]

Options:

  -h, --help  Show this message and exit.

service-document

GET the root service document — lists every entity set the server exposes.

Usage:

crm service-document [OPTIONS]

Options:

  -h, --help  Show this message and exit.

session

Local session state.

Usage:

crm session [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

clear

Usage:

crm session clear [OPTIONS]

Options:

  -h, --help  Show this message and exit.

history

Usage:

crm session history [OPTIONS]

Options:

  -h, --help  Show this message and exit.

info

Usage:

crm session info [OPTIONS]

Options:

  -h, --help  Show this message and exit.

skill

Install the bundled agent skill (SKILL.md) for Copilot / Claude / Cursor.

Usage:

crm skill [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

install

Copy the bundled SKILL.md into the agent's skill directory.

Usage:

crm skill install [OPTIONS]

Options:

  --target [claude|copilot|cursor]
                                  Where to install the skill. Ignored if
                                  --dest is given.  [default: copilot]
  --dest DIRECTORY                Custom destination directory (overrides
                                  --target).
  --force                         Overwrite an existing SKILL.md at the
                                  destination.
  -h, --help                      Show this message and exit.

path

Show the path of the bundled SKILL.md inside the installed package.

Usage:

crm skill path [OPTIONS]

Options:

  -h, --help  Show this message and exit.

uninstall

Remove the installed SKILL.md (and its directory if empty).

Usage:

crm skill uninstall [OPTIONS]

Options:

  --target [claude|copilot|cursor]
                                  [default: copilot]
  --dest DIRECTORY
  -h, --help                      Show this message and exit.

solution

Solution lifecycle (create-publisher / create / list / info / components / export / import).

Usage:

crm solution [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

components

Usage:

crm solution components [OPTIONS] UNIQUE_NAME

Options:

  -h, --help  Show this message and exit.

create

Create an unmanaged solution bound to a publisher (solutions).

Usage:

crm solution create [OPTIONS]

Options:

  --name TEXT                     Solution unique name, e.g. 'CRMWorx'.
                                  [required]
  --display TEXT                  Friendly name (defaults to --name).
  --version TEXT                  Solution version (default 1.0.0.0).
  --publisher TEXT                Publisher unique name (mutually exclusive
                                  with --publisher-id).
  --publisher-id TEXT             Publisher GUID (mutually exclusive with
                                  --publisher).
  --if-exists [error|skip]
  --set-default / --no-set-default
                                  Write default_solution back to the active
                                  named profile (default on).
  -h, --help                      Show this message and exit.

create-publisher

Create a solution publisher (publishers).

Usage:

crm solution create-publisher [OPTIONS]

Options:

  --name TEXT                     Publisher unique name, e.g. 'crmworx'.
                                  [required]
  --display TEXT                  Friendly name (defaults to --name).
  --prefix TEXT                   Customization prefix: 2-8 alphanumeric,
                                  starts with a letter, not 'mscrm'. e.g.
                                  'cwx'.  [required]
  --option-value-prefix INTEGER   Option-value prefix (integer 10000-99999).
                                  [required]
  --if-exists [error|skip]
  --set-default / --no-set-default
                                  Write publisher_prefix back to the active
                                  named profile (default on).
  -h, --help                      Show this message and exit.

export

Usage:

crm solution export [OPTIONS] UNIQUE_NAME

Options:

  -o, --output FILE               [required]
  --managed
  --export-setting [autonumbering|calendar|customizations|email-tracking|general|isv-config|marketing|outlook-sync|relationship-roles|sales]
                                  Repeatable; include a named export setting
                                  in the solution payload.
  --timeout INTEGER               Async operation timeout in seconds.
                                  Overrides profile.async_timeout.
  --no-retry                      Disable the 429/5xx retry loop for this
                                  invocation.
  -h, --help                      Show this message and exit.

import

Usage:

crm solution import [OPTIONS] ZIP_PATH

Options:

  --no-publish
  --no-overwrite
  --timeout INTEGER  Async operation timeout in seconds. Overrides
                     profile.async_timeout.
  --no-retry         Disable the 429/5xx retry loop for this invocation.
  -q, --quiet        Suppress per-tick import-progress lines on stderr.
  -h, --help         Show this message and exit.

info

Usage:

crm solution info [OPTIONS] UNIQUE_NAME

Options:

  -h, --help  Show this message and exit.

job-cancel

Alias for crm async cancel <id>.

Usage:

crm solution job-cancel [OPTIONS] ASYNC_OPERATION_ID

Options:

  --yes       Skip interactive confirmation.
  -h, --help  Show this message and exit.

job-status

Alias for crm async get <id> — inspect a solution import/export job.

Usage:

crm solution job-status [OPTIONS] ASYNC_OPERATION_ID

Options:

  -h, --help  Show this message and exit.

list

Usage:

crm solution list [OPTIONS]

Options:

  --managed / --unmanaged  Filter by managed flag.
  -h, --help               Show this message and exit.

publish

Call PublishXml with a Publish Request Schema XML payload.

Usage:

crm solution publish [OPTIONS]

Options:

  --xml TEXT       Inline Publish Request Schema XML.
  --xml-file FILE  Path to a Publish Request Schema XML file.
  -h, --help       Show this message and exit.

publish-all

Call PublishAllXml — publish every unpublished customization.

Usage:

crm solution publish-all [OPTIONS]

Options:

  -h, --help  Show this message and exit.

view

Create and manage system views (savedquery).

Usage:

crm view [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

create

Create a public system view on ENTITY.

Usage:

crm view create [OPTIONS] ENTITY

Options:

  --name TEXT               View display name.  [required]
  --otc INTEGER             Entity ObjectTypeCode (from `metadata entity
                            <name>`).  [required]
  --column TEXT             Repeatable 'logicalname[:width]'. Order preserved.
                            [required]
  --order TEXT              Attribute to sort by (ascending).
  --filter-active           Filter to statecode=0 (active) rows.
  --default                 Mark as the default view.
  --if-exists [error|skip]
  --solution TEXT           Target solution uniquename
                            (MSCRM.SolutionUniqueName). Defaults to the
                            profile's default_solution.
  --require-solution        Fail if no solution resolves (also via
                            CRM_REQUIRE_SOLUTION).
  --publish / --no-publish  Run PublishAllXml after creation. Default:
                            publish.
  -h, --help                Show this message and exit.

workflow

List, activate, and trigger D365 workflows.

Usage:

crm workflow [OPTIONS] COMMAND [ARGS]...

Options:

  -h, --help  Show this message and exit.

activate

Activate a workflow (statecode=1, statuscode=2).

Usage:

crm workflow activate [OPTIONS] WORKFLOW_ID

Options:

  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

deactivate

Deactivate a workflow (statecode=0, statuscode=1).

Usage:

crm workflow deactivate [OPTIONS] WORKFLOW_ID

Options:

  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.

list

List workflow definitions.

Usage:

crm workflow list [OPTIONS]

Options:

  --category INTEGER   Filter by category (0=Workflow, 4=BPF, 5=Modern Flow).
  --entity TEXT        Filter by primary entity logical name.
  --activated / --all  Restrict to activated workflows. Default returns all
                       states.
  --on-demand          Only on-demand workflows.
  -h, --help           Show this message and exit.

run

Trigger an on-demand workflow against a target record via ExecuteWorkflow.

Usage:

crm workflow run [OPTIONS] WORKFLOW_ID

Options:

  --target TEXT             GUID of the record to run the workflow against.
                            [required]
  --as-user GUID            Impersonate systemuser by GUID via MSCRMCallerID
                            header.
  --suppress-dup-detection  Send MSCRM.SuppressDuplicateDetection: true.
  --bypass-plugins          Send MSCRM.BypassCustomPluginExecution: true
                            (requires prvBypassCustomPluginExecution).
  -h, --help                Show this message and exit.