Interactive prompt with REPL

After you run $ foundry go in your terminal, the interactive prompt becomes active. The prompt gives you two things:

  1. A way to interact with your cloud environment, emulated Firestore, and emulated users

  2. Read-Eval-Print-Loop (REPL) functionality for your Cloud Functions

With the REPL-like functionality it's easy to build, debug, and test your Cloud Functions. Every time you save your code, Foundry CLI gets notified and uploads your code to the cloud environment you are connected to. Foundry then triggers yours functions there, according to the foundry.yaml configuration file. The output of your Cloud Functions - both stdout and stderr - is then sent back and you can see it in the prompt's output.

Bellow is a video showing the interactive prompt on the right side in the action:


Available prompt commands

Only trigger the specified functions and show in the prompt's output:

> watch function_name_1 function_name_2

Reverse the watch command - all functions specified in foundry.yaml will be triggered and showed in the prompt's output:

> watch:all

Set the specified environment variables in your cloud environment:

> env-set ENV_1=VALUE ENV_2=VALUE

Delete the specified environment variables in your cloud environment:

> env-delete ENV_1 ENV_2

Print all previously set environment variables in your cloud environment:

> env-print