Export Command
Use the export command to create reusable API asset packages from a source environment.
On this page:
Overview
The export command extracts assets from a source environment and generates a YAML format artifact that you can:
- Promote assets from the source to a target environment
- Back up the configurations for future reference
Before you begin:
- Prepare the environment configuration file with the source environment configuration.
- Create a repository folder for the exported assets.
- An export-config.yaml file that defines the assets to export
For more information, see Export configuration.
Syntax
The following is the syntax for the export command:
Linux:
Copy
./api-ops.sh command=export \
baseConfigFolder=<path_to_config_folder> \
environmentConfig=<environment_config_file> \
commandConfig=<export_config_file> \
encryptionKeystorePath=<path_to_encryption_keystore>
Windows:
Copy
api-ops.bat command=export
baseConfigFolder=<path_to_config_folder>
environmentConfig=<environment_config_file>
commandConfig=<export_config_file>
encryptionKeystorePath=<path_to_encryption_keystore>
The following table shows the parameter description:
| Parameter | Required | Description |
|---|---|---|
| command | Yes | Specifies the operation to run (export). |
| baseConfigFolder | Yes | Specifies the path to the API Ops CLI configuration directory that contains the base configuration files. |
| environmentConfig | Yes | Specifies the environment configuration file that defines environment‑specific settings for the export operation. |
| commandConfig | Yes | Specifies the export configuration file that defines the parameters used during the export process. |
| encryptionKeystorePath | Optional | Specifies the path to the encryption keystore file that stores the encryption keys used during the export process. |
Example:
Execute the export command from the /bin directory:
Linux:
Copy
./api-ops.sh command=export baseConfigFolder=/Users/apiops.user/Temp/api-ops-2026.1.0/config environmentConfig=environment-config.yaml commandConfig=export-config.yaml encryptionKeystorePath=/Users/apiops.user/Temp/api-ops-2026.1.0/keystore/encryption-keystore.p12
Windows:
Copy
api-ops.bat command=export baseConfigFolder=C:/Users/apiops.user/Temp/api-ops-2026.1.0/config environmentConfig=environment-config.yaml commandConfig=export-config.yaml encryptionKeystorePath=C:/Users/apiops.user/Temp/api-ops-2026.1.0/keystore/encryption-keystore.p12
Result:
After you run the export command, verify that the assets are exported successfully.
- Validate the response.Copy
APIs successfully exported:
- "Payment_Initiation_API" - Validate the logs/promotion.log for asset export status.
- Verify the assets are exported to the configured directory. The CLI organizes exported assets into a directory structure that supports reuse and portability.