Skip to main content

Command Line Interface

Introduction

A Command Line Interface (CLI) is a text-based interface that enables users to interact with a computer program. YepCode provides both a Graphic User Interface (GUI), accessible at https://cloud.yepcode.io, and a CLI for interacting with YepCode Cloud.

YepCode CLI

The YepCode Command Line Interface facilitates interaction with YepCode Cloud directly from your local workstation's command line. It's particularly useful if you prefer developing and testing processes' source code locally rather than using the web IDE of YepCode Cloud.

By using YepCode CLI, you can employ version control systems like git to manage your code and synchronize your repository with YepCode Cloud. In essence, the CLI allows you to run commands such as clone to download all your team workspaces, run to test your code locally, and push to upload changes to YepCode Cloud.

Watch the video below for an overview of how YepCode CLI can be used (Spanish version):

caution

Video was recorded when it was needed to ask for access to install CLI. Right now is open to every YepCode user.

Installation

YepCode CLI is published on npmjs so just install it as any other nodejs package:

npm install -g @yepcode/cli

Usage

Ask for help

As with any other command-line tool, you can run the help command to display 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 interacting with your account, you need to log in. These credentials are personal and 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 the credentials prompt, or you can use the --email and --password options.

$ yepcode login --email your-email --password your-password
info

We don't yet support the external identity providers in YepCode CLI (Google Auth, Github or Microsoft).

If you have used it to create your account, you need ask for a password reset and setup one:

Logout from your YepCode account

Perform a logout to remove access to your YepCode account.

$ yepcode logout
👋 Bye!

Clone your team workspace locally

Clone one of your team workspaces using:

$ yepcode clone ada-lovelace
fetching processes...

fetching modules...

fetching credentials...

fetching variables...

🎉 ada-lovelace team processes cloned successfully!

💲 cd ada-lovelace
tip

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

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: Processes' source code, with one folder per process, containing process files.
    • README.md: Markdown file with the process description.
    • index.js or index.py: Process source code in JavaScript or Python.
    • parametersSchema.json: Parameters schema JSON file.
    • parameters.json: 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 per team credential. Sensitive information won't be filled, so for local execution testing, you must fill the values.
  • modules: Includes one file per team module. This source code may be updated and 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 if you create a git repo for this directory to ignore sensitive resources (credentials and variables .env).
  • .yepcode.json: YepCode workspace metadata file.
caution

Sensitive credentials and variables won't be filled, so for local execution testing, you must fill the values.

danger

.yepcode.json is a JSON file containing workspace metadata and is not meant to be edited by the user.

Execute processes locally

Execute a process locally using the run command:

$ yepcode run <process-id>
tip

To see the list of available processes, use the processes command.

By default, the process is executed using 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 your colleages have performed changes in YepCode cloud, update your local files.

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.

info

If you or your team have modified process both locally and in the cloud, the CLI prompts you on how to resolve 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 upgrading your processes or modules locally, 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.
info

If you or your team have modified processes both locally and in the cloud, CLI prompts you on how to resolve conflicts:

🔥  conflictive-process-name (<process-id>) has been modified both origin and local!
Do you want force push to origin? yes/no:
caution

All resources (processes, modules, variables and credentials) can only be created and removed using YepCode cloud.

Resource topics

Each workspace resource has a dedicated topic, allowing you to manage your workspace resources independently using topics (credentials, modules, processes, variables):

Topic/Commandstatuspullpush
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 resources from the cloud ansd update locally:

$ yepcode credentials:pull
fetching credentials...
credentials are up to date.

Push resources changes to cloud

You can update cloud resources with local changes:

$ yepcode modules:push
updating modules...
modules up-to-date
info

If you or your team have modified processes both locally and in the cloud, the CLI prompts you on how to resolve 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 -g @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