Skip to content

Welcome to Beatrix CLI Tool Documentation

Introduction

The Beatrix CLI tool is a tool for generating code from Beatrix Model (YAML) using a terminal.


System Requirements


Install

Using a terminal, go to your WORKSPACE folder and run the following command:

Linux:

1
2
3
4
5
# Install the unzip command-line utility:
sudo apt install unzip

# Download and install the beacli:
curl -o- https://clitool.beatrix.io/scripts/install.sh | bash

This installs the tool in your $HOME folder and links to it in your current workspace folder.

Windows:

1
2
3
4
5
# Download the powershell script:
Invoke-WebRequest https://clitool.beatrix.io/scripts/beacli.ps1 -OutFile beacli.ps1

# Install the beacli in your WSL environment:
.\beacli.ps1 -install

Please, review your PowerShell execution policies to allow scripts to run.


Usage

1-Preparing your Solution

Create a .bea folder in your solution and, inside it, create a file named Model.yaml, containing your solution model.


2-Configure

For the first use of the tool, you need to create a profile for communication with the Beatrix platform:

Linux:

1
./beacli MySolution configure
Windows:
1
.\beacli.ps1 MySolution configure

The following inputs will be requested to create the profile:

  • Profile Name: The same used in your solution's clitool.env file;
  • Client Id: Provided by the Beatrix team;
  • Client Secret: Provided by the Beatrix team;
  • User Name: Your Beatrix Username;
  • PIN: Create a PIN to protect your Beatrix credentials locally;

3-Login

You must open a session to use the Beatrix platform. After login, you can use the CLI tool for a few hours, without repeating the process.

Linux:

1
./beacli MySolution login
Windows:
1
.\beacli.ps1 MySolution login

Note: You may be asked to enter your PIN from time to time.

The following input will be requested to login:

  • Beatrix Password: Your Beatrix Password;

4-Create Solution

For the first time code generation, you must create a new related solution on the Beatrix platform.

Linux:

1
./beacli MySolution create-solution
Windows:
1
.\beacli.ps1 MySolution create-solution

Note: A new file solution.json will be created in your .bea folder.


5-Pull new Version

To generate the source code using your Model.YAML file, run the command:

Linux:

1
./beacli MySolution pull
Windows:
1
.\beacli.ps1 MySolution pull

Note: A new version.json file will be created in your .bea folder, and your solution files will be updated/generated. You can control the output folder using the variable OUTPUT_FOLDER in the clitool.env file.