Using the CLI for Edge Computing
Creating new edge computing in Arvancloud is possible both in the terminal and from the user panel. For working with edge computing in terminal environments, you can use the CLI of this product called r1ec
. This tool is a command-line interface for launching and deploying applications in edge computing.
Installation
Before installing the CLI, you must have Node.js version 18 or higher installed on your system. It is also recommended to use LTS versions.
You can use this tool directly without installation using the npx
command:
npx r1ec [command]
Or you can install the CLI globally on your system with the following command:
npm install --global r1ec
yarn install --global r1ec
Commands
In this section, you can see the various commands of the r1ec
tool.
Documentation
To view the documentation of Arvancloud's edge computing, use this command:
r1ec docs
To set the language of the documentation, you can use the l-
flag. This flag accepts fa
for Persian or en
for English. For example, to access the Persian documentation, enter the following command:
r1ec docs -l fa
Login
For logging in and authentication, you need a machine user key with "owner access". For obtaining the access key, refer to the machine user guide.
r1ec login -m <value>
Replace
<value>
with your access key.
Creating a Project
To start working with edge computing, you can use the ready examples of Arvancloud. To create a sample project, use the following command:
r1ec init [PROJECTNAME]
If you do not choose a specific name for your application instead of [PROJECTNAME], it will take the default sample name.
Deploying a Project
If you have a bundled JavaScript file, you can deploy it on Arvancloud's edge computing using the following command:
r1ec deploy [PROJECTNAME] -f <value>
Choose a name for the application instead of [PROJECTNAME] and place the JavaScript file path instead of <value>
.
Auto Complete
With the following command, you can enable command auto-complete or Auto-Complete in your terminal:
r1ec autocomplete [SHELL] [-r]
Depending on your terminal type, you can place one of the values `,
zsh, or
powershell` instead of [SHELL]. For example:
r1ec autocomplete
Also, with the r-
flag or --refresh-cache
, the command cache will be deleted. For example:
r1ec autocomplete --refresh-cache
Logout
With the following command, you can log out of your account in the CLI environment:
r1ec logout