---
schema_version: "1"
id: b73ff8b990cb4c541d647c5b9e195ba9b9a25011737b2851b2fd75bc76c56fd0
title: Using Anypoint Platform DataGraph CLI and API Extensions
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/datagraph/overview-cli-extensions.md
canonical_url: https://docs.mulesoft.com/datagraph/overview-cli-extensions
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f2f9179d6398de33a932ec4657dc77f68f486014b15abdf9ec4eb47c3a7c3340
description: MuleSoft Documentation Site
latest: true
---
---
product: DataGraph
---

# Using Anypoint Platform DataGraph CLI and API Extensions

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

You can use the Anypoint CLI DataGraph commands to add and edit API sources in DataGraph. To do so,
you must first add the appropriate DataGraph API extensions to the API source.

## Adding Extensions to Your Project

You must add the extensions to your API-specification project as a dependency and then publish the
project to Exchange. After you publish your API-specification project, you can add the API to
DataGraph using the CLI.

Use API Designer to add the extensions to your project. Follow the steps in
[Add Dependencies to an API-Specification Project](https://docs.mulesoft.com/design-center/design-add-api-dependency#add-dependencies-to-an-api-specification-project),
choosing **Fragments** as the dependency type.

API Designer adds the required dependencies to `exchange.json` and validates the syntax of any
annotations you added before publishing your project to Exchange.

## Maintaining RAML Compatibility

To maintain compatibility in RAML specifications with tools that do not support API extensions,
these extensions include a “RAML companion” that provides a simple version of RAML annotations
definition. To use DataGraph API extensions in RAML, add the following code to the main file of the
API-project specification:

uses: dg: exchange\_modules/<group>/<asset>/<version>/datagraph-api-extensions.raml

You can change the prefix `dg` if needed, but it must match the prefix used in the extensions.

The `<group>`, `<asset>`, and `<version>` reference the API extensions that are published in
Exchange.

## Using the DataGraph CLI versus the DataGraph UI

If you add an API source using the CLI, you cannot edit it or update its version directly in the UI.
You must make these changes using the CLI.

## See Also

- [Anypoint DataGraph API Extension Reference](https://docs.mulesoft.com/datagraph/api-extensions)

- [Anypoint DataGraph CLI Reference](https://docs.mulesoft.com/datagraph/datagraph-cli)
