Builder companion
Introduction
The CLI can be used as a companion for the Builder, that is, the Builder can enable additional features if it can connect to a CLI running in server mode. This chapter will show you how to do that.
Running the CLI in server mode
You might have noticed a small round button located at the upper left corner of the canvas, with an icon inside it that looks like an unplugged cable and a thin red border. That is the button to toggle on/off one of the killer features of Nebulant!
We know that two of the key things any tool should offer are speed and easiness. No matter how good the tool is, if it required too many extra steps to make it process or execute the user's work, or if it takes too long to do it, users get a negative UX and avoid using the tool altogether.
As shown in the previous chapter, in order to actually run a blueprint, it first needs to be converted to a blueprint and then manually executed with the CLI. We thought we can improve the process and reduce all the steps to a single click!
Instead of simply executing a blueprint, the CLI can be executed in server mode by running the CLI with the -d parameter:
./nebulant -d
This will make the CLI listen for incoming connections at 127.0.0.1:15678
.
Then, using the previously mentioned button, the Nebulant builder app that is
running in the browser can establish a Websocket connection with the CLI.
This allows Nebulant to offer several very nice features.
1-click blueprint execution
1-click blueprint execution means that you can run the blueprint you're currently working on with a single click. The conversion of the blueprint into a blueprint and the execution of that blueprint by the CLI is made transparently by the Nebulant builder app, without any actions required from user.
Furthermore, because the CLI and the web app are connected via Websocket, some additional features are available. For example, while the CLI is running the blueprint, the currently being executed action/s will be highlighted, allowing you to clearly see the execution flow of your blueprint. You'll also be able to pause, resume or stop the execution at any moment.
Note that the pause and stop buttons will wait for the currently being executed action to finish before actually pausing / stopping the process.
Autocomplete capabilities
The vast majority of actions that perform tasks on remote resources of some sort will require you to provide them with some sort of ID for the resources you want them to work on. Aside from user defined variables and action provided variables, the builder will show you suggestions extracted from the provider of the action that you're working with (if credentials are available / configured and the web app is connected to the CLI).
If any of the actions requires access tokens, API keys or endpoints, login credentials such as usernames and passwords, or any other information in order to work, the CLI will try to locate that information by the means described in the documentation of that action's provider. It will then proceed with the execution of the blueprint or with the autocomplete attempt.