API Catalog CLI | MuleSoft Documentation
# API Catalog CLI
Command | Description  
---|---  
api-catalog autocomplete |  Configures autocompletion for API Catalog commands  
api-catalog conf |  Creates or deletes a credentials configuration file  
api-catalog create-descriptor |  Creates a descriptor file  
api-catalog update-descriptor |  Updates a descriptor file  
api-catalog publish-asset |  Publishes assets to Exchange  
Discover and catalog your API definitions, documentation files, and associated metadata as part of an automated process with API Catalog CLI. You can embed the publish asset command in your automation tools, such as a CI/CD pipeline or custom scripts, to automatically trigger the publishing of your API assets to Exchange. API Catalog CLI is agnostic of CI/CD tools and runtime environments.
See Autocataloging APIs Using API Catalog CLI.
## api-catalog autocomplete
```
$ api-catalog autocomplete [flags]
```

This command accepts the following flags:
Flag | Description  
---|---  
Displays instructions for configuring autocompletion  
Installs autocompletion using Bash shell settings  
Installs autocompletion using Z shell settings  
-r, --refresh cache |  Removes the current autocompletion configuration. Use this before running the command with a different shell type.  
**Examples**
```
$ api-catalog autocomplete
$ api-catalog autocomplete bash
$ api-catalog autocomplete zsh
$ api-catalog autocomplete --refresh-cache
```

The API Catalog CLI autocomplete plugin is not currently supported in Windows.   
---  
## api-catalog conf
Manage authentication credentials in a configuration file (config.json) by adding and removing key value pairs. Set one key value pair per command execution.
```
> api-catalog conf <authkey> <authkeyvalue> [flags]
```

`<authkey>` The authentication key name. Possible key names are: username password client_id client_secret host environment organization
`<authkeyvalue>` The value for the specified authentication key.
This command accepts the following flags:
Flag | Description  
---|---  
Deletes the config file entry for the given key  
Shows the help for this command  
`-k`, `--key=key` |  Shows the value that corresponds with the given key  
`-v`, `--value=value` |  Shows the key that corresponds with the given value  
## api-catalog create-descriptor
```
> api-catalog create-descriptor [flags]
```

This command accepts the following flags:
Flag | Description  
---|---  
`-d`, `--file=file` |  Default: `catalog.yaml` The name and location in which to save the generated catalog descriptor file  
Generates an `exchange.json` file for each API described in the descriptor file and adds a reference to each of those in the descriptor file using the `ref` tag in the `projects` section  
## api-catalog update-descriptor
```
> api-catalog update-descriptor [flags]
```

This command accepts the following flag:
Flag | Description  
---|---  
`-d`, `--descriptor-file=descriptor-file` |  Default: `catalog.yaml` The name and location in which to save the updated catalog descriptor file information  
## api-catalog publish-asset
```
> api-catalog publish-asset [flags]
```

This command accepts the general and authentication flags in addition to the following flags:
Flag | Description  
---|---  
Runs the publish job asynchronously.  
`-d`, `--descriptor-file=descriptor-file` ANYPOINT_DESCRIPTOR_FILE environment variable |  Default: ./catalog.yaml The name and location of the catalog descriptor file.
  * If the file does not exist, no assets are cataloged.
  * If the file exists but is empty, the command creates and prints the catalog descriptor YAML results. It outputs cataloging information for all API definitions it finds in the full directory tree relative to the current working directory.
  * If a valid YAML file exists, the command catalogs the assets as specified.

See Create a Descriptor File Using the CLI.  
Runs the command to verify that the descriptor file is valid. No APIs are published.  
`--force-publish` |  Bypasses the comparison and creates a new version of the asset in Exchange regardless of the content.  
`--force-update-metadata` |  Updates the asset’s metadata, such as tags, in the latest version in Exchange regardless of the content. This does not republish the asset.  
Prints the execution result in JSON format.  
Enables silent logging.  
`-t`, `--trigger-criteria=<descriptor-tag>:<value>` `--trigger-criteria=<descriptor-tag>:value` |  This flag works in conjunction with the `triggerConditions` section in the descriptor file. For each run of the `api-catalog publish-asset` command, the trigger values are compared to trigger condition values in the descriptor file to determine whether to publish the APIs described in the descriptor file. To match multiple conditions, specify separate `--trigger-criteria` flags for each condition. For the APIs to be published, all trigger conditions set in the descriptor file must be matched by `--trigger-criteria` flag values. Example: `--trigger-criteria=branch:main --trigger-criteria=anytag:release/ --trigger=user:admin` See Descriptor YAML Schema.  
`-v`, `--verbose` |  Enables verbose logging.  
`--version-strategy-criteria=<descriptor-tag>:<value>` |  This flag works in conjunction with the `versionStrategyConditions` section in the descriptor file. The `api-catalog publish-asset` command compares the version strategy criteria values to version strategy condition values in the descriptor file to determine the version strategy to use to publish the APIs. To match multiple conditions, specify separate `--version-strategy-criteria` flags for each condition. Example: `--version-strategy-criteria=branch:main --version-strategy-criteria=anytag:release/ --version-strategy-criteria=user:admin` See Descriptor YAML Schema.  
## General and Authentication Flags
Following are the general and authentication flags for commands that authenticate to Anypoint Platform:
Flag | Description  
---|---  
`--client_id=client_id` `ANYPOINT_CLIENT_ID` environment variable |  Connected app client ID See Authentication.  
`--client_secret` `ANYPOINT_CLIENT_SECRET` environment variable |  Prompt for the connected app secret for the client ID See Authentication.  
`--collectMetrics` `COLLECT_METRICS` environment variable |  Not currently used  
`--environment=environment` `ANYPOINT_ENV` environment variable |  The name of the Anypoint Platform environment where the APIs are cataloged  
`--host=host` `ANYPOINT_HOST` environment variable |  Default: ```
anypoint.mulesoft.com
```
The Anypoint Platform base URL without the protocol For the US Anypoint Platform, use: ```
anypoint.mulesoft.com
```
For the European Anypoint Platform, use: ```
eu1.anypoint.mulesoft.com
```
  
`--organization=organization` `ANYPOINT_ORG` environment variable |  The ID of the Anypoint Platform organization where the APIs are cataloged  
`-p`, `--password` `ANYPOINT_PASSWORD` environment variable |  Anypoint user password See Authentication.  
`-u`, `--username=username` `ANYPOINT_USERNAME` environment variable |  Anypoint username See Authentication.