Sureapp - app management CLI toolThe sureapp command is a powerful CLI (command-line interface) tool that allows you to create and manage web applications on your account. In order to use the sureapp tool, you need to connect to your account over SSH. You can connect to your account over SSH as described in the SSH section of our online documentation. Here are some of the functionalities the sureapp tool offers:
Note: If you do not have a WebApps section in your Control Panel, then this tutorial is not suitable for your particular hosting environment. You can submit a support ticket through our ticketing system if you need assistance. Getting helpIf you call the sureapp command without any arguments, you will see a list of its commands. To get help with a specific command and see its subcommands, you need to call: sureapp help command where you need to replace command with the actual command you wish to see help information for. Here is a list of the available commands in the sureapp CLI tool:
For example, if you would like to see the subcommands and the help information of the sureapp project command, you need to call: sureapp help project Then, to see the help information of the sureapp project create command for example, you need to call: sureapp help project create Creating a web appGenerally, web apps can be created through the WebApps section of the Control Panel. This way, all necessary options can be configured via a visual interface. However, you can use the sureapp CLI tool to create web apps as well. This can be done with the sureapp project create command. In order to create a web app through the command line, it is recommended that you first create the subdomain you wish to run the app on through the Subdomains section of the Control Panel, as well as the deployment directory for the web app. To see a list of the available options for the command, call the command without any arguments: sureapp project create In order to create a web app through the sureapp CLI tool, it is mandatory to specify the web app name and at least the following options:
In addition, you can also specify the following options:
For example, if you would like to create a web app that will run on the current version of Node.js, available at http://www.yourdomain.com/path/to/your/webapp/, running from the /home/your_username/private/your_webapp_dir/ directory, and with the name MyWebApp, you need to call the sureapp project create command as follows: sureapp project create --engine node --engine-version current --subdomain www --domain yourdomain.com --release-dir /home/your_username/private/your_webapp_dir/ --url-path /path/to/your/webapp/ MyWebApp Please note that all options are case-sensitive. Logging in to a web app shellYou can log in to a web app shell with the following command: sureapp project shell MyWebApp This command will log you in to the shell for the MyWebApp web app. You need to replace MyWebApp with the actual name of the web app you wish to manage. Most of the management commands of the sureapp tool work only after logging in to the web app shell. Managing a web appModifying the settings of a web appOnce you log in to a web app shell, you can modify its settings with the sureapp project modify command. The command takes the same arguments as the sureapp project create command which is described in the Creating a web app section of this article. For example, if you would like to change the engine of a web app to custom, you need to log in to the web app shell and call: sureapp project modify --engine custom --engine-version - Managing the state of a web appYou can enable, disable, start, stop, signal, and check the status of a web app with the sureapp service command. The command has several subcommands:
The sureapp service manage command takes the following options:
The sureapp service signal command takes the following options to send the corresponding signal to the application process tree:
For example, if you would like to enable a web app, you need to log in to the web app shell and call: sureapp service manage --enable Managing the environment variables of a web appOnce you log in to the web app shell, you can manage the environment variables of the web app with the sureapp env command. The command has several subcommands:
For example, if you would like to set the value of NEWVALUE to the variable VAR1 for a web app, you need to log in to the web app shell and call: sureapp env set VAR1 NEWVALUE Viewing the configuration of a web appOnce you log in to the web app shell, you can get the configuration values of the web app in a machine-readable format with the sureapp meta config command. The command has several options, depending on the format you would like to get the output in:
For example, if you would like to get the configuration for a web app in pretty printed JSON format, you need to log in to the web app shelland call: sureapp meta config --json Viewing the logs of a web appThe sureapp CLI tool allows you to view and monitor the logs of a web app in real time. Once you log in to the web app shell, you can view and monitor logs with the sureapp log command. The command has several subcommands:
For example, if you would like to monitor the logs for a web app, you need to log in to the web app shelland call: sureapp log follow Deleting a web appGenerally, web apps can be deleted through the WebApps section of the Control Panel. However, you can also delete web apps through the command line by using the sureapp project remove command of the sureapp CLI tool. For example, if you would like to delete a web app named MyWebApp, you need to call: sureapp project remove MyWebApp Managing the web apps supervisorThe web apps supervisor is a system application that makes sure your web apps are running. The web apps supervisor can start, stop, or restart a web app when needed. It also manages the processes started by web apps. The web apps supervisor application itself can be managed through the command line with the sureapp supervisor command. The command has several subcommands:
For example, if you would like to check whether the web apps supervisor is running, you need to call: sureapp supervisor status |