Skip to content

Terminal actions

Terminal actions are used to perform actions related to the terminal in the editor. You can use these actions to run commands, clear the terminal, and more.

Execute a terminal command

Execute a terminal command in the terminal.

{
"action": "executeTerminalCommand",
"command": "<command to execute>",
"terminalId": "<terminal id (optional)>"
}

Execute a script in the background

Execute a script in the background of which you can use the output in the next steps.

{
"action": "executeScript",
"id": "<script id>",
"path": "<script to execute>",
"command": "node" // Can be powershell, bash, shell, python, etc.
}

Example of using the output of a script

demo.json
{
"title": "Script example",
"description": "",
"steps": [
{
"action": "executeScript",
"id": "firstName",
"path": "writeFirstName.mjs",
"command": "node"
},
{
"action": "create",
"path": "sample.json",
"content": "{\n \"firstName\": \"{SCRIPT_firstName}\"\n}"
},
{
"action": "open",
"path": "sample.json"
}
]
}
writeFirstName.mjs
console.log('Elio');

Close a terminal

Close the terminal.

{
"action": "closeTerminal",
"terminalId": "<terminal id (optional)>"
}