Skip to content

YepCode Command Line Interface

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.

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):

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

Terminal window
npm install -g @yepcode/cli

As with any other command-line tool, you can run the help command to display the list of available commands:

Terminal window
$ 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
...

Before interacting with your account, you need to log in. These credentials are personal and grant you access to your YepCode teams.

Terminal window
$ 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.

Terminal window
$ yepcode login --email your-email --password your-password

Perform a logout to remove access to your YepCode account.

Terminal window
$ yepcode logout
👋 Bye!

Clone one of your team workspaces using:

Terminal window
$ yepcode clone ada-lovelace
fetching processes...
fetching modules...
fetching variables...
🎉 ada-lovelace team processes cloned successfully!
$ cd ada-lovelace
Terminal window
$ yepcode clone
🏢 Allowed teams:
ada-lovelace
sandbox

Inspect the generated folder, and you’ll see some folders and files:

📦 ada-lovelace
┣ 📂 modules
┃ ┣ 📂 <javascript-module-slug>
┃ ┃ ┗ 📜 <module-slug>.js
┃ ┣ 📂 <python-module-slug>
┃ ┃ ┗ 📜 <module-slug>.py
┃ ┣ 📂 <module-with-versions>
┃ ┃ ┣ 📂 versions
┃ ┃ ┃ ┣ 📂 v1.0
┃ ┃ ┃ ┃ ┗ 📜 <module-slug>.js
┃ ┃ ┃ ┗ 📂 ...
┃ ┃ ┗ 📜 <module-slug>.js
┃ ┗ 📂 ...
┣ 📂 processes
┃ ┣ 📂 <javascript-process-slug>
┃ ┃ ┣ 📜 README.md
┃ ┃ ┣ 📜 index.js
┃ ┃ ┣ 📜 parametersSchema.json
┃ ┃ ┗ 📜 parameters.json
┃ ┣ 📂 <python-process-slug>
┃ ┃ ┣ 📜 README.md
┃ ┃ ┣ 📜 main.py
┃ ┃ ┣ 📜 parametersSchema.json
┃ ┃ ┗ 📜 parameters.json
┃ ┣ 📂 <process-slug-with-versions>
┃ ┃ ┣ 📂 versions
┃ ┃ ┃ ┣ 📂 v1.0
┃ ┃ ┃ ┃ ┣ 📜 README.md
┃ ┃ ┃ ┃ ┣ 📜 index.js
┃ ┃ ┃ ┃ ┣ 📜 parametersSchema.json
┃ ┃ ┃ ┃ ┗ 📜 parameters.json
┃ ┃ ┃ ┗ 📂 ...
┃ ┃ ┣ 📜 README.md
┃ ┃ ┣ 📜 index.js
┃ ┃ ┣ 📜 parametersSchema.json
┃ ┃ ┗ 📜 parameters.json
┃ ┗ 📂 ...
┣ 📜 datastore.json
┣ 📜 variables.env
┣ 📜 variables.local.env
┣ 📜 .gitignore
┗ 📂 .yepcode
  • 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.
    • versions: if process has published versions, a new folder will exists and each version folder will have a process replica with the published contents.
  • modules: Modules’ source code, with one folder per module, containing the module file.
    • versions: if module has published versions, a new folder will exists and each version folder will have a module replica with the published contents.
  • variables.env: Includes all team variables in .env file format (KEY=VALUE).
  • variables.local.env: Local environment variables that override variables.env.
  • datastore.json: YepCode datastore file.
  • .gitignore: Auto generated gitignore file. It will be used if you create a git repo for this directory to ignore sensitive resources (variables .env).
  • .yepcode: YepCode workspace metadata directory.

Execute a process locally using the run command:

Terminal window
$ yepcode run <process-slug>

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:

Terminal window
$ yepcode run <process-slug> --parameters path/to/parameters.json

YepCode support custom dependencies to use any npmjs or pypi package in your processes. Check dependencies section for more information.

In order to run a process, you need to install your team configured dependencies. You can do that with the dependencies command:

Terminal window
$ yepcode dependencies [all|javascript|python]

There are two flags to manage dependencies:

  • --check: Check if dependencies are installed and installed versions are up to date.
  • --reset: Performs a full reinstall of configured dependencies.

If you or your colleages have performed changes in YepCode cloud, update your local files.

Fetch all processes from cloud and save them locally:

Terminal window
$ yepcode pull
fetching processes...
- [new] -> Create process name (<process-slug>)
- [updated] -> Updated process name (<process-slug>)
- [deleted] -> Deleted process name (<process-slug>)
modules are up to date.
variables are up to date.

After upgrading your processes or modules locally, update your cloud workspace from local changes using push command.

Terminal window
$ yepcode push
uploading processes...
[uploaded] -> modified-process-name (<process-slug>) uploaded to remote.
[overwritten] -> conflictive-process-name (<process-slug>) overwritten in remote.

If you have created resources on your local workspace, you can add them to keep track and after that they could be pushed to remote:

ℹ️ 1 processes only existing in local: a-new-local-process
Use command 'yepcode processes:add' to keep track of these resources

Using the yepcode processes:add command, it will be added and then will be shown in the status log.

YepCode CLI is able to work with multiple remotes. This is pretty interesting to keep sync processes or modules between those environments.

Let’s say that you have a YepCode staging enviroment where you test your code before going to production. You cloud clone the staging environment and then add a new remote for the production envinroment. This is done with the yepcode remote command:

Terminal window
$ yepcode remote
Add a remote team workspace
USAGE
$ yepcode remote:COMMAND
COMMANDS
remote:add Add a remote team workspace
remote:set Set the active remote team workspace

After adding a new remote, it may be needed to perform a yepcode add just to keep track of the files in this new environment. After that, you could go with a yepcode push to deploy changes to the cloud.

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

Topic/Commandstatuspullpush
processes:white_check_mark::white_check_mark::white_check_mark:
modules:white_check_mark::white_check_mark::white_check_mark:
variables:white_check_mark::white_check_mark::sparkles: (just create)

You may list all available resources using the status command:

Terminal window
$ yepcode processes:status
processes status:
slug name status
────────────────────────────── ────────────────────────────────── ────────────────
hello-world Hello world (up-to-date)
stripe-customers-from-supabase Stripe Customers From Supabase Bar (up-to-date)

In addition, you can fetch resources from the cloud and update locally:

Terminal window
$ yepcode processes:pull
fetching processes...
processes are up to date.

You can update cloud resources with local changes:

Terminal window
$ yepcode modules:push
updating modules...
modules up-to-date

You can debug your yepcode processes using vscode.

In order to have full debugging support you need to encapsulate your code in a main() function:

javascript example
const { yepcode } = require('yepcode');
async function main() {
// your code
}
module.exports = { main };
python example
from yepcode import yepcode, logger
def main():
# your code

Then you need to create the vscode configuration files. You can do it with the setup-debug command:

Terminal window
$ yepcode setup-debug
Created .vscode/launch.json
Created .vscode/settings.json

Now in your vscode Run and Debug tab you can select which process you want to debug:

Screenshot
  • The first two entries will debug your current file, you need to select Python/Node Debugger option depending on the language of your process.
  • Next entries will be your processes, you can select one of them to debug.

If you want to update the CLI, you can do it using the npm install command:

Terminal window
$ npm install -g @yepcode/cli

If a new version is available, you will be notified to update the CLI.

Terminal window
$ 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