Commerce Cloud includes the ccw
utility, a command-line tool that allows you to create new content on Commerce Cloud with the IDE or code editor of your choice. This tool allows you to create new widgets, and then upload them to the server.
For detailed information on working with widgets, stacks and elements, refer to the Developing Widgets guide.
The format for implementing the ccw
is:
ccw [options]
Understand ccw utility options
The following table describes the options you can use with the ccw
utility.
Option | Description |
---|---|
| Identifies the base directory. |
| Provides usage information for the utility. |
| Uses the supplied locale as the default locale. Also, the informational messages displayed by the |
| The URL for the administration interface on the target Commerce Cloud instance, for example, |
| The application key to use to log into the target Commerce Cloud administration interface. It is recommended that you create an application key for authentication purposes. For detailed information on creating an application key, refer to the refer to the Use the application key for authentication section. It is also possible to specify the application key using the CC_APPLICATION_KEY environment variable. |
| Provides the utility’s version number. |
| Creates a new widget. |
Create a widget with the ccw utility
When you create a new widget, the ccw
asks a number of questions so that it may create an element. The extension is created by calling the appropriate endpoints.
Initiate the ccw
with the option to create a new widget:
ccw -w
This brings up the following wizard interface:
Understand the ccw utility questions
When creating the widget, you are prompted to answer a number of questions. The way that you answer these questions affects the way that the widget is created. The following section provides details of the questions asked during the creation of the widget.
Question | Explanation |
---|---|
| The textual name used to create the widget directory. It is also the name used when the widget is created on the Commerce Cloud instance. |
| Global widgets are a way to include common JavaScript code across every page layout in the store. A global widget can have only a single instance. Note that a global widget is not the same as a global |
| Internationalized widgets require additional resource bundles, which are created if you answer yes. |
| If you answer yes , you are indicating that the widget requires user configurable meta data. Refer to the Developing Widgets guide for information on configuring widgets. |
| If you respond yes, the generated widget will contain various instructions and examples to assist those new to widget development. |
| If you respond yes, the new widget will be created as an extension on the target Commerce Cloud instance. If you answer no, the widget is created the next time you do a |
After you have answered all of the questions, the responses are validated and a skeleton widget is created. Once the ccw
has been created, it is sent to the server as an extension., unless the –noSync
option has been supplied. Once you get the response that the upload is successful, you can drag the widget onto a layout.
Delete a widget with the ccw utility
The ccw
utility creates widgets as extensions, allowing you to delete a previously created widget by deactivating and deleting the corresponding extension.
To delete the widget from your local disk after you have deleted the extension, issue the following command:
ccw –-grab –-clean