Install Command Line Interface (CLI)
Zet is a command line interface that helps developers build and package widgets in Zoho Creator. The Command Line Interface, or CLI, is used to send commands to a software program as lines of texts in order to interact with it. This interaction includes typing commands into the interface and receiving responses to them. This text-based interface has its basis in the Graphical User Interface (GUI) but provides a mechanism that is easier to use. Developers use CLIs to create applications, software, and operating systems.
Zoho Creator enables you to create and integrate a widget using CLI.
Prerequisites to install CLI
- Download the nodejs source code from "https://nodejs.org/en/download/"
- Use the following command to verify the installation:$ node -v
$ npm -v
- Run the following command to install the zapps cli node package:$ npm install -g zoho-extension-toolkit
- Run the following command to ensure that the installation is successful:$ zet // Help information about 'zet' command will be shown.
Create a project
- Run the following command to create new project:$ zet init
The list of Zoho Services you need to create a project template for will appear.
- Select Zoho Creator and create a Project Folder.
- Include resources: All the files that are required for rendering your widget will appear inside the "app" folder of your project.
- Run the following command to start a local HTTP server that allows you to run your app locally and to test it in your sandbox instance:$ zet run
This will run the HTTP server in your local machine in port number 5000. The port should not be occupied with any other process before starting the server.
- To verify whether the server has started successfully, you need to open the following URL in your web browser: http://127.0.0.1:5000/app/widget.html
- Run the following command to validate your application:$ zet validate
This will validate your app package and identify any violations. They should be corrected before updating the zip in the developer console.
- Run the following command to generate a zip of your application that can be uploaded:$ zet pack
This will create a zip file of the application in the "dist" folder of your project directory. This zip file needs to be uploaded to the Zoho Creator.