Install the cli:
curl -s https://raw.githubusercontent.com/promptify-it/cli/main/installer.sh | bash
Create a token from Web Application:
- Click on
Api Tokens
; - Give it a name and click on
Create
; - Copy the token;
- Save the token in a safe place.
Add the token to the cli with the following command:
pfy auth:token
The cli will ask for the token. Paste it and press enter.
Thats it! You are ready to go.
pfy list
- Create a new command from Web Ui
- Give it a name and a description (fill signature and description)
- Add nodes to the command.
-
Assign
Assign a value to a variable
{ "type": "assign", "content": { "key": "NAME", "value": "Daniele" } }
Key Description Values Support variables key Variable name String No value Value to assign String No -
Condition
{ "type": "condition", "content": { "left": "{{ $NAME }}", "operator": "==", "right": "Daniele" } }
Key Description Values Support variables left Left side of the condition String Yes operator Operator ==
,===
,!=
,!==
,>
,<
,>=
,<=
No right Right side of the condition String Yes -
FileTemplate
Generate a file from a template. The template is an array of strings. Each string is a line of the file. The output is the file name.
You can use variables in the template. Variables are defined with
{{ $VARIABLE_NAME }}
.{ "type": "file-template", "content": { "template": [ "<?php", "", "class {{ $NAME_studly }} {", " public function __construct() {", " echo 'Hello, World!';", " }", "}" "" ], "output": "$NAME.php" } }
Key Description Values Support variables template Template Array of strings Yes output Output file name String Yes -
PassworInput
Ask for a password
{ "type": "password-input", "content": { "key": "name", "label": "Type your password", } }
Key Description Values Support variables key Variable name String No label Value to assign String No -
SelectInput
Ask for a selection
{ "type": "select-input", "content": { "key": "name", "label": "John", "options": [ "Option 1", "Option 2", "Option 3" ] } }
Key Description Values Support variables key Variable name String No label Value to assign String No options Options Array of strings No -
Shell
Execute a shell script
{ "type": "shell", "content": { "script": "echo 'Hello, World!'" } }
Key Description Values Support variables script Shell script String Yes -
TextInput
Ask for a text input
{ "type": "text-input", "content": { "key": "name", "label": "What's your name?", } }
Key Description Values Support variables key Variable name String No label Value to assign String No