Login
Back to bricks list
Introduction Version

Introduction

Constellab embed a CLI tool to simplify development and execute tasks. The CLI is automatically available in Constellab and is accessible through the gws command. 


Here are the main functionalities of the cli : 


  • run server and tests
    • generate code (bricks, tasks...)
      • manage dev env
        • test streamlit app



          Commands


          server


          This command is used to start the server, run tests and run experiments.


          run


          Command to start the server. When used the VsCode debugger can't be activated. 


          Options:


          • --settings-path : string. Path to the main settings file. This file describe the brick and version to use on start.
            • --log-level : INFO, DEBUG, ERROR. Level for the logs. Default to INFO.
              • --show-sql : flag. If set the SQL request are logged. Useful for debugging.
                • --port : string. Port to use by the server. Default to 3000.

                  test


                  Command to run tests file of a brick.


                  Argument: 


                  • The names of the test files to run. Can provide multiple file by separating them with a space. Supports regex. Enter 'all' or '*' to launch all the tests.


                    Options:


                    • --brick-name: str. Name of the brick that contains the tests to run. If not provided, the system run the test of the brick of the current folder.
                      • --log-level : INFO, DEBUG, ERROR. Level for the logs. Default to INFO.
                        • --show-sql : flag. If set the SQL request are logged. Useful for debugging.

                          run-experiment


                          Command used by the system to run a experiment in another linux process. 


                          • --experiment-id : string. Id of the experiment to run.
                            • --user-id : string. Id of the user that run the experiment.
                              • --settings-path : string. Path to the main settings file. This file describe the brick and version to use on start.
                                • --log-level : INFO, DEBUG, ERROR. Level for the logs. Default to INFO.
                                  • --show-sql : flag. If set the SQL request are logged. Useful for debugging.
                                    • --is-test : flag. Set if the experiment is run during test.

                                      run-process


                                      Command used by the system to run a process of an experiment in another linux process.


                                      • --experiment-id : string. Id of the experiment to run.
                                        • --protocol-model-id : Id of the protocol model. that contain the process
                                          • --process-instance-name : Name of the process instance inside the protocol.
                                            • --user-id : string. Id of the user that run the experiment.
                                              • --settings-path : string. Path to the main settings file. This file describe the brick and version to use on start.
                                                • --log-level : INFO, DEBUG, ERROR. Level for the logs. Default to INFO.
                                                  • --show-sql : flag. If set the SQL request are logged. Useful for debugging.
                                                    • --is-test : flag. Set if the experiment is run during test.

                                                      brick


                                                      Command to manipulate brick.


                                                      generate


                                                      Command to generate a brick skeleton inside the /lab/user/bricks folder. 


                                                      Argument:


                                                      • Name of the brick to generate.

                                                        task


                                                        Command to manipulate task.


                                                        generate


                                                        Command to generate a task python file inside the current folder. 


                                                        Argument:


                                                        • Name of the task class to create (Pascal case).

                                                          Options:


                                                          • --human-name : Human name of the task.
                                                            • --short-description : Short description of the task.

                                                              dev-env


                                                              Command to manipulate the development environment.


                                                              reset


                                                              Command to reset the data of the dev environment. It clears the database, the files, the virtual environments...



                                                              streamlit


                                                              Command to test streamlit app.


                                                              run-dev


                                                              Command to run in dev mode a streamlit app. This is useful when developing an advanced streamlit app to fasten the development and debug. 


                                                              It runs the streamlit app in the same configuration as in production mode. 


                                                              Argument: 


                                                              • Path of the config.json file that describe how to run the app (path of the app, inputs and params).