Command Line Interface
Introduction
A Command Line Interface or CLI is a computer interface that allows a user to interact with a computer program through a text-based interface.
YepCode has GUI (Graphic User Interface), you can visit it at https://cloud.yepcode.io, and CLI, that you can use to interact with YepCode cloud.
YepCode CLI
The YepCode Command Line Interface allows to interact with YepCode cloud from your workstation command line.
It's the best way if you prefer to write and test the processes source code in your local workspace instead of using the web IDE of YepCode cloud.
Using YepCode CLI you can use a version control system like git
to manage your code and syncronize your repository with YepCode cloud.
In summary, it allows to run a clone
command for your team, downloading all your team workspaces. Then you'll be able to use the run
command to test locally your code, and finally the push
will allow you to upload the changes to the YepCode cloud.
In this video we show an overview about how the YepCode CLI may be used (we also have the spanish version).
YepCode CLI is only available in paid plans.
Installation
Each team that wants to install the YepCode CLI must have an account in our npm registry.
If you don't have an account, you can ask for one contacting us.
The credentials are shared for any team member, and after you receive them, the installation may be done with the following commands (that will ask for the provided user and password):
npm login --scope=@yepcode --registry=https://registry-js.yepcode.io
npm install --location=global @yepcode/cli
Usage
Ask for help
As in any other command line tool, you may run the help command that will show the list of available commands:
$ yepcode help
YepCode Command Line Interface
VERSION
@yepcode/cli/1.0
USAGE
$ yepcode [COMMAND]
COMMANDS
clone Clone team processes
help Display help for yepcode.
login Login to the service
logout Logout from service
...
Login to your YepCode account
Before interact with your account, you need to login. Don't confuse these credentials with the ones used in the installation process. These ones are personal, and would grant you access to your YepCode teams.
$ yepcode login
What is your yepcode email?: ada.lovelace@yepcode.io
What is your yepcode password (not stored)?: **********
🔑 Checking credentials... done
👐 Hi, Ada Lovelace!
You can provide your credentials using credentials prompt, or you can use the --email
and --password
options.
$ yepcode login --email your-email --password your-password
Logout from your YepCode account
You may perform a logout to remove the access to your YepCode account.
$ yepcode logout
👋 Bye!
Clone your team workspace locally
You may clone one of your team workspaces:
$ yepcode clone ada-lovelace
fetching processes...
fetching modules...
fetching credentials...
fetching variables...
🎉 ada-lovelace team processes cloned successfully!
💲 cd ada-lovelace
If you don't provide parameters to the clone
command, you'll see the list of available teams.
$ yepcode clone
🏢 Allowed teams:
ada-lovelace
sandbox
You may inspect the generated folder, and you'll see some folders and files:
📦 ada-lovelace
┣ 📂 modules
┃ ┣ 📜 <module-name>.js
┃ ┣ 📜 <module-name>.py
┃ ┗ 📜 ...
┣ 📂 credentials
┃ ┣ 📜 <credential-name>.json
┃ ┗ 📜 ...
┣ 📂 processes
┃ ┣ 📂 <javascript-process-name (process-id)>
┃ ┃ ┣ 📜 README.md
┃ ┃ ┣ 📜 index.js
┃ ┃ ┣ 📜 parametersSchema.json
┃ ┃ ┗ 📜 parameters.json
┃ ┣ 📂 <python-process-name (process-id)>
┃ ┃ ┣ 📜 README.md
┃ ┃ ┣ 📜 index.py
┃ ┃ ┣ 📜 parametersSchema.json
┃ ┃ ┗ 📜 parameters.json
┃ ┗ 📂 ...
┣ 📜 variables.env
┣ 📜 .gitignore
┗ 📜 .yepcode.json
processes
: the processes source code, includes one folder by each process with process files.README.md
: the markdown file with the process description.index.js
orindex.py
: the process source code in JavaScript or Python.parametersSchema.json
: The parameters schema JSON file.parameters.json
: This is a sample input file dynamically generated. It will be used as default input file in local executions, but you may provide another one. Read more about run --parameters .
credentials
: includes one file by each one of the team credentials. The credentials sensitive information won't be filled, so if you want to test some local execution, you must fill the values.modules
: includes one file by each one of the team modules. This source code may be updated and also used during local executions.variables.env
: Includes all team variables in env file format (KEY=VALUE)..gitignore
: Auto generated gitignore file. It will be used in case you create a git repo for this directory to ignore the sensitive resources (credentials and variables.env)..yepcode.json
: YepCode workspace metadata file.
The credentials sensitive information and sensitive variables won't be filled, so if you want to test some local execution, you must fill the values.
.yepcode.json
file is a JSON file that contains the workspace metadata and it's not meant to be edited by the user.
Execute processes locally
If you want to execute a process locally, you can use the run
command:
$ yepcode run <process-id>
To see the list of available processes, you can use the processes
command.
By default, the process will be executed using as input params the parameters.json
file located in the process folder. You may provide another input params using the --parameters
option:
$ yepcode run <process-id> --parameters path/to/parameters.json
Pull changes from cloud
If you (or some of your colleages), has performed changes in the YepCode cloud, you may update your local files.
You may fetch all credentials from cloud and save them locally:
$ yepcode pull
fetching processes...
- [new] -> Create process name (<process-id>)
- [updated] -> Updated process name (<process-id>)
- [deleted] -> Deleted process name (<process-id>)
modules are up to date.
credentials are up to date.
variables are up to date.
If you or your team have modified process both local and cloud, CLI prompt you what do you want to do in order to solve conflicts:
🔥 conflictive-process-name (<process-id>) has been modified both cloud and local!
Do you want to override local changes? yes/no:
Push changes to cloud
After upgrade your processes or modules locally, you can update your cloud workspace from local changes using push
command.
$ yepcode push
uploading processes...
[uploaded] -> modified-process-name (<process-id>) uploaded to origin.
[overwritten] -> conflictive-process-name (<process-id>) overwritten in origin.
If you or your team have modified process both local and cloud, CLI prompt you what do you want to do in order to solve conflicts:
🔥 conflictive-process-name (<process-id>) has been modified both origin and local!
Do you want force push to origin? yes/no:
All resources (processes
, modules
, variables
and credentials
) only can be created and removed using YepCode cloud.
Resource topics
Each workspace resource has a dedicated topic, it means that you can use the following commands to manage your workspace resources independently using topics (credentials, modules, processes, variables):
Topic/Command | status | pull | push |
---|---|---|---|
processes | ✅ | ✅ | ✅ |
modules | ✅ | ✅ | ✅ |
credentials | ✅ | ✅ | - |
variables | ✅ | ✅ | - |
List resources
You may list all available resources using the status
command:
$ yepcode processes:status
processes status:
id name status
──────────────────────────────────── ──── ────────────────
a79003ec-82e6-4c25-9046-d5b2bec61561 Foo ✅ (up-to-date)
d62a0ff8-af59-4498-b1fc-2824abcee5a3 Bar ✅ (up-to-date)
Pull resources changes from cloud
In addition you can fetch from cloud resources and update locally:
$ yepcode credentials:pull
fetching credentials...
credentials are up to date.
Push resources changes to cloud:
As well as you can update cloud resources with local changes:
$ yepcode modules:push
updating modules...
modules up-to-date
If you or your team have modified process both local and cloud, CLI prompt you what do you want to do in order to solve conflicts using both pull
and push
commands
Update CLI
If you want to update the CLI, you can do it using the npm install
command:
$ npm install --location=global @yepcode/cli
If a new version is available, you will be notified to update the CLI.
$ yepcode --version
__ __ _____ _
\ \ / / / ____| | |
\ \_/ /__ _ __ | | ___ __| | ___
\ / _ \ '_ \| | / _ \ / _` |/ _ \
| | __/ |_) | |___| (_) | (_| | __/
|_|\___| .__/ \_____\___/ \__,_|\___|
| |
|_|
Update available x.y.z → X.Y.Z
Run `npm i -g @yepcode/cli` to update
@yepcode/cli/x.y.z darwin-x64 node-v16.x.x