Skip to main content

Using the Edge Computing CLI

You can create a new Edge Computing application in Arvancloud both in the terminal and in the panel. To work with Edge Computing in terminal environments, you can use this product's CLI, called r1ec. This tool is a command-line interface for setting up and deploying applications on Edge Computing.

Installation​

Before installing the CLI, you need to have Node.js version 18 or later installed on your system. It is also recommended that you use LTS versions.

You can use this tool directly with the npx command, without installing it:

npx r1ec [command]

Or you can install the CLI globally on your system with the following command and access it:

npm install --global r1ec
yarn install --global r1ec

Commands​

In this section, you can see the different commands of the r1ec tool.

Documentation​

To see the Arvancloud Edge Computing documentation, use this command:

r1ec docs

To set the documentation language, you can use the -l flag. This flag accepts fa for Persian or en for English. For example, to access the English documentation, enter the following command:

r1ec docs -l en

Login​

To log in and authenticate, you need a machine user key with Workspace Owner access. To get an access key, use the Machine User guide.

r1ec login -m <value>

Replace <value> with your access key.

Creating a Project​

To get started with Edge Computing, you can use Arvancloud's ready-made samples. To create a sample project, use the following command:

r1ec init [PROJECTNAME]

If you don't choose a name for your application instead of [PROJECTNAME], the sample's default name is used.

Deploying a Project​

If you have a bundled JavaScript file, you can deploy it on Arvancloud Edge Computing with the following command:

r1ec deploy [PROJECTNAME] -f <value>

Choose a name for the application instead of [PROJECTNAME], and put the path to the JavaScript file instead of <value>.

Auto Complete​

With the following command, you can enable command auto-completion in your terminal:

r1ec autocomplete [SHELL] [-r]

Depending on your terminal type, you can put one of bash, zsh, or powershell instead of [SHELL]. For example:

r1ec autocomplete bash

Also, the -r or --refresh-cache flag clears the command cache. For example:

r1ec autocomplete --refresh-cache

Logout​

With the following command, you can log out of your account in the CLI:

r1ec logout