---
title: Track changes using the CLI
source: https://docs.newrelic.com/docs/change-tracking/config/cli
---

The change tracking feature is a good way to monitor the effects of specific changes on your customers and systems. You do this by designating which changes you want to monitor and then viewing the results in the New Relic UI.

While you can designate which changes you want to monitor by using GraphQL or a CI/CD integration, you can also use our CLI to do the same thing. If you use the CLI to designate the changes you want to monitor, you can run either a [GraphQL query](https://docs.newrelic.com/docs/change-tracking/config/nerdgraph) or execute an [NRQL query](https://docs.newrelic.com/docs/change-tracking/query-data#use-nrql) against the New Relic database to retrieve a list of those changes.

/\* Here's a two-minute overview video, or you can jump right to the steps below.

 \*/

## Prerequisites [#prerequisites]

-   Ensure that you have New Relic CLI version `0.104.5` or higher. Follow the [install or upgrade](https://github.com/newrelic/newrelic-cli#installation--upgrades) documentation to get latest version.

## Make a change marker with the CLI [#make-marker-cli]

The CLI has a range of options (shown below), but the `create` command marks a specific change for a given New Relic entity.

### Change tracking events

This is the syntax to create a marker:

````shell
  newrelic changeTracking create [flags]
```

Examples:

<CollapserGroup>
  <Collapser
    className="freq-link"
    id="example-1"
    title="Change tracking deployment event example with complex entity search"
  >
    ```shell
      newrelic changeTracking create \
        --entitySearch "name = 'MyService' AND type = 'SERVICE'" \
        --category Deployment \
        --type Basic \
        --description "Deployed version 1.2.3 to production" \
        --version "1.2.3" \
        --changelog "https://github.com/myorg/myservice/releases/tag/v1.2.3" \
        --commit "abc123def456" \
        --user "ci-cd-bot"
    ```
  </Collapser>
  <Collapser
    className="freq-link"
    id="example-2"
    title="Feature Flag event"
    >
    ```shell
      newrelic changeTracking create \
        --entitySearch "name = 'MyApp'" \
        --category "Feature Flag" \
        --type Basic \
        --description "Enabled new checkout flow feature flag" \
        --featureFlagId "checkout-flow-v2" \
        --validationFlags FAIL_ON_FIELD_LENGTH \
        --user "product-team"
    ```
  </Collapser>
  <Collapser
    className="freq-link"
    id="example-3"
    title="Custom category/type example with custom attributes and multiple validation flags"
    >
    ```shell
      newrelic changeTracking create \
        --entitySearch "id = '<Entity GUID>'" \
        --category Operational \
        --type "Maintenance Window" \
        --description "Database maintenance completed" \
        --customAttributes '{cloud_vendor: "vendor_name", region: "us-east-1", isProd: true, instances: 2}' \
        --validationFlags ALLOW_CUSTOM_CATEGORY_OR_TYPE,FAIL_ON_FIELD_LENGTH,FAIL_ON_REST_API_FAILURES \
        --user "ops-team"
    ```
  </Collapser>
  <Collapser
    className="freq-link"
    id="example-4"
    title="Custom category/type example using repeated --validationFlags style and separate flag"
    >
    ```shell
      newrelic changeTracking create \
        --entitySearch "id = '<Entity GUID>'" \
        --category Operational \
        --type "Maintenance Window" \
        --description "Database maintenance completed" \
        --customAttributes '{cloud_vendor: "vendor_name", region: "us-east-1", isProd: true, instances: 2}' \
        --validationFlags ALLOW_CUSTOM_CATEGORY_OR_TYPE \
        --validationFlags FAIL_ON_FIELD_LENGTH \
        --validationFlags FAIL_ON_REST_API_FAILURES \
        --user "ops-team"
    ```
  </Collapser>
</CollapserGroup>

### Primary (parent) options

  ```shell
  [output]     --category string           category of event, e.g., DEPLOYMENT, CONFIG_CHANGE, etc. category is required.
  [output]     --changelog string          changelog for the deployment
  [output]     --commit string             commit hash for the deployment
  [output]     --customAttributes string   custom attributes: use '-' for STDIN, '{...}' for inline JS object, or provide a file path
  [output]     --deepLink string           deep link URL for the deployment
  [output]     --description string        a description of the event
  [output]     --entitySearch string       the NRQL entity search query for this event. Example: name = 'MyService' AND type = 'SERVICE' (required)
  [output]     --featureFlagId string      ID of the feature flag
  [output]     --groupId string            string that can be used to correlate two or more events
  [output] -h, --help                      help for create
  [output]     --shortDescription string   short description for the event
  [output] -t, --timestamp int             the time of the event, the number of milliseconds since the Unix epoch, defaults to now
  [output]     --type string               type of event, e.g., BASIC, ROLLBACK, etc. type is required.
  [output]     --user string               username of the actor or bot
  [output]     --validationFlags strings   comma-separated list of validation flags, e.g. ALLOW_CUSTOM_CATEGORY_OR_TYPE,FAIL_ON_FIELD_LENGTH,FAIL_ON_REST_API_FAILURES
  [output]     --version string            version of the deployment
  ```

  ### Options inherited from parent commands

  ```shell
  [output] -a, --accountId int    the account ID to use. Can be overridden by setting NEW_RELIC_ACCOUNT_ID
  [output]     --debug            debug level logging
  [output]     --format string    output text format [JSON, Text, YAML] (default "JSON")
  [output]     --plain            output compact text
  [output]     --profile string   the authentication profile to use
  [output]     --trace            trace level logging
  ```


````

### Change tracking deployments (Legacy)

This is the syntax to create a marker:

```shell
newrelic entity deployment create [flags]
```

Here's an example:

```shell
newrelic entity deployment create --guid INSERT_YOUR_GUID_HERE --version <1.0.0>
```

#### Primary (parent) options

```shell
[output] -h, --help                    help for create
[output] -g, --guid string             the entity GUID to create change tracker
[output] -v, --version string          the tag names to add to the entity
[output]     --changelog string        a URL for the changelog or list of changes if not linkable
[output]     --commit string           the commit identifier, for example, a Git commit SHA
[output]     --deepLink string         a link back to the system generating the deployment
[output]     --deploymentType string   type of deployment, one of BASIC, BLUE_GREEN, CANARY, OTHER, ROLLING or SHADOW
[output]     --description string      a description of the deployment
[output]     --groupId string          string that can be used to correlate two or more events
[output] -t  --timestamp int64         the start time of the deployment, the number of milliseconds since the Unix epoch, defaults to now
[output] -u  --user string             username of the deployer or bot
```

#### Options inherited from parent commands

```shell
[output] -a, --accountId int    the account ID to use. Can be overridden by setting NEW_RELIC_ACCOUNT_ID
[output]     --debug            debug level logging
[output]     --format string    output text format [JSON, Text, YAML] (default "JSON")
[output]     --plain            output compact text
[output]     --profile string   the authentication profile to use
[output]     --trace            trace level logging
```

## What's next [#whats-next]

[View and analyze changes](https://docs.newrelic.com/docs/change-tracking/view-analyze-data/)

Learn advanced techniques for correlating change data with performance metrics and system behavior.

[Query your changes](https://docs.newrelic.com/docs/change-tracking/query-data)

Learn how to query your change data in New Relic.

[Notify your team](https://docs.newrelic.com/docs/change-tracking/change-tracking-webhooks)

Learn how to set up notifications for your change tracking events.
