Skip to main content

CLI

Installation Command

RoostGPT binary is available at https://github.com/roost-io/roost-support/releases

Add the "roostgpt-<linux|macos|win.exe>" binary to your PATH environment variable

For Linux/MacOS,  you can execute the below command to install roostgpt

curl https://raw.githubusercontent.com/roost-io/roost-support/master/roostgpt.sh | bash -

 

CLI Commands

./roostGPT-macos   (for mac) &  ./roostGPT-win.exe (for windows)

This command is used to run the RoostGPT CLI on your operating system.

  • -h, --help: Displays the help message that provides information about the available options and usage.

  • roostgpt config create:  Creates roostgpt configuration file. The configuration file contains environment variables used by RoostGPT application.
  • --ui:  It opens the web form in order to create downloadable configuration file.
  • --output-dir, -o <path>:  Creates a configuration file in a specific directory. The configuration file contains environment variables used by the RoostGPT application. Default path is pwd.
  • --name <name>: Creates the configuration file with specific name. Default name is default.env

  • roostgpt config update: Updates the roostgpt configuration file.

  • --config, -c <path>: Specifies the location of the environment configuration file. The configuration file contains environment variables used by the RoostGPT application.

  • --name <name>:  loads pwd/$name.env. It is ignored if the --file is provided

  • roostgpt test create: Triggers the test code.

  • --config,-c <path>: Path to the configuration file if provided, otherwise the configuration will retrieved from Environment variables .

Instructions for creating .env file

An easy way to download the .env file is to use https://app.roost.ai/gptCLIForm

The .env file should be in the same folder path as RoostGPT binary.

Here is what the content of your .env file will look like:

# GIT env vars
GIT_TYPE=                    # supportsSupports "github",github, "gitlab",gitlab, "azure",azure, "bitbucket",bitbucket, "local"local
HOSTED_TYPE=                 # supportsSupports "cloud"cloud and "hosted"hosted default is "cloud"
GIT_HOSTED_URL=                   # Required if HOSTED_TYPE="hosted"cloud
LOCAL_PROJECT_PATH=          # Required if GIT_TYPE is "local",local, Path to your workspace.
GIT_HOSTED_URL=              # Required if HOSTED_TYPE=hosted
SOURCE_GIT_TOKEN=            # Required
SOURCE_OWNER_NAME=           # Required
SOURCE_REPO_NAME=            # Required
SOURCE_REPO_ID=              # Required for GIT_TYPE="azure" or GIT_TYPE="gitlab"gitlab
SOURCE_PROJECT_NAME=         # Required for GIT_TYPE="azure" or GIT_TYPE="bitbucket"azure
SOURCE_PROJECT_ID=           # Required for GIT_TYPE="azure" or GIT_TYPE="bitbucket"bitbucket
SOURCE_BASE_BRANCH=          # Required
SOURCE_RELATIVE_DIRECTORY=   # Optional, the relative path of the repository
SAME_TARGET_DETAIL=          # optionalOptional default "true"true, Supports true and false
DESTINATION_GIT_TOKEN=       # Required if SAME_TARGET_DETAIL="true"false
DESTINATION_OWNER_NAME=      # Required if SAME_TARGET_DETAIL="true"false
DESTINATION_REPO_NAME=       # Required if SAME_TARGET_DETAIL="true"false
DESTINATION_REPO_ID=         # Required if SAME_TARGET_DETAIL="true"false and GIT_TYPE="azure" or GIT_TYPE="gitlab"gitlab
DESTINATION_PROJECT_NAME=    # Required if SAME_TARGET_DETAIL="true" andfor GIT_TYPE="azure" or GIT_TYPE="bitbucket"azure
DESTINATION_PROJECT_ID=      # Required if SAME_TARGET_DETAIL="true"false and GIT_TYPE="azure" or GIT_TYPE="bitbucket"bitbucket
DESTINATION_BASE_BRANCH=     # Required if SAME_TARGET_DETAIL="true"false

# Open AI env vars
OPENAI_API_MODEL=            # optionalOptional default value is "gpt-4"4
OPENAI_API_KEY=              # Required if AI_TYPE="openai"openai

# Vertex AI env vars
VERTEX_FINE_TUNE=            # Optional default value is false, Supports true and false
VERTEX_PROJECT_ID=           # Required if AI_TYPE="vertexai"vertexai
VERTEX_REGION=               # Required if AI_TYPE="vertexai"vertexai and VERTEX_FINE_TUNE=true
VERTEX_BEARER_TOKEN=         # Required if AI_TYPE="vertexai"vertexai
VERTEX_MODEL=                # optionalRequired, defaultSupports valuetext-bison, iscode-bison, "text-bison"
VERTEX_FINE_TUNE=codechat-bison

# optionalAzure defaultOpen valueAI isenv "false"vars
AZURE_OPENAI_ENDPOINT=       # Required if AI_TYPE=azure_open_ai
AZURE_DEPLOYMENT_NAME=       # Required if AI_TYPE=azure_open_ai
AZURE_OPENAI_KEY=            # Required if AI_TYPE=azure_open_ai

# Open source env vars
OPEN_SOURCE_MODEL_ENDPOINT=  # Required if AI_TYPE=open_source_ai
OPEN_SOURCE_MODEL=           # Optional, Supports meta-llama/Llama-2-13b-chat and HuggingFaceH4/starchat-beta

# Jira board env vars
JIRA_HOST_NAME=              # Required if TEST_TYPE="functional"functional and BOARD_TYPE="jira"jira
JIRA_EMAIL=                  # Required if TEST_TYPE="functional"functional and BOARD_TYPE="jira"jira
JIRA_TOKEN=                  # Required if TEST_TYPE="functional"functional and BOARD_TYPE="jira"jira

# Azure board env vars
AZURE_ORG=                   # Required if TEST_TYPE="functional"functional and BOARD_TYPE="azure"azure
AZURE_PROJECT=               # Required if TEST_TYPE="functional"functional and BOARD_TYPE="azure"azure
AZURE_TOKEN=                 # Required if TEST_TYPE="functional"functional and BOARD_TYPE="azure"azure

# Log env vars
LOG_SOURCE=                  # optionalOptional default value is "elks"elks
LOG_SOURCE_PATH=             # optional,Optional, the log file path
LOG_ELASTICSEARCH_URL=       # optional,Optional, the Elastic search URL
LOG_ELASTICSEARCH_USER=      # optional,Optional, the Elastic search user name
LOG_ELASTICSEARCH_TOKEN=     # optional,Optional, the Elastic search token
LOG_ELASTICSEARCH_API_KEY=   # optional,Optional, the Elastic search api key

# SwaggerBehavioural test cases env vars
SWAGGER_URL=BEHAVIORAL_TEST_TYPE=        # RequiredOptional, Supports gherkin
BEHAVIORAL_TEST_SOURCE=      # Optional, Supports file, gitpath, url
BEHAVIORAL_TEST_FILE_PATH=   # Optional, path of the source file if TEST_TYPE="artillery-swagger"source is file/gitpath. Relative path in case of gitpath.
BEHAVIORAL_TEST_URL=         # Optional, url of the source file if source is url

# API Spec env vars
API_SPEC_TYPE=               # Optional, Supports swagger and postman
API_SPEC_SOURCE=             # Optional, Supports file, gitpath, url
API_SPEC_FILE_PATH=          # Optional, path of the source file if source is file/gitpath. Relative path in case of gitpath.
API_SPEC_URL=                # Optional, url of the source file if source is url


# License env vars
ROOST_DOMAIN=                # Optional default value is "app.roost.ai"ai
ROOST_TOKEN=                 # Required, the Roost token

# Additional vars
USE_CLI=TEST_NAME=                   # optionalOptional default value is "true"roost-test
TEST_NAME=ROOST_DIR=                   # optionalOptional default value is "roost-test"/var/tmp/Roost/RoostGPT
ROOST_DIR=LANGUAGE=                    # optionalOptional default value is "/var/tmp/Roost/RoostGPT"java LANGUAGE=Supports java, go, python, csharp, nodejs 
AI_TYPE=                     # optionalOptional default value is "java"openai, supportsSupports "java",openai, "go",vertexai, "python",azure_open_ai, "c#", "nodejs" 
AI_TYPE=                          # optional default value is "openai", supports "openai", "vertexai", "open_source"open_source_ai
PACKAGES_TO_SCAN=            # Required for LANGUAGE="java",java, The package to scan and generate test for example - com.demo.sample
ITERATION=                   # optionalOptional default value is 2
TIMEOUT=                     # optionalOptional default value is "60"1 minhour
TEST_TYPE=                   # optionalOptional default value is "unit"unit supportsSupports "unit",unit, "functional",functional, "artillery",artillery, "artillery-swagger"api-spec, integration
RETRIGGER=                   # optionalOptional default value is "false"false, supportsSupports true and false
TRIGGER_ID=                  # unique id to identify multiple triggers
BOARD_TYPE=                  # optionalOptional default value is "jira"jira supportsSupports "jira"jira and "azure"azure #and Improve test env vars
IMPROVE_TEST=                     # optional default value is "false"
FILE_PATH=                        # Required if IMPROVE_TEST="true"
USER_CONTENT=                     # Required if IMPROVE_TEST="true"none
GIT_PR_URL=                  # The Git pr url of the generated test
TELEMETRY=                   # Optional default value is true, Supports true and false, send telemetry data to roost, no private information is shared.

# Improve test env vars
IMPROVE_TEST=                # Optional default value is false, Supports true and false
FILE_PATH=                   # Required if IMPROVE_TEST=true
USER_CONTENT=                # Required if IMPROVE_TEST=true
Here's a description of each variable:
  • GIT_TYPE: Specifies the type of Git repository.
     Supported values: "github", "gitlab", "azure", "bitbucket_cloud", "bitbucket_server".
  • GIT_TOKEN: A token for authenticating the specific Git repository.
  • OWNER_NAME: The name of the repository owner (Git username).
  • REPO_NAME: The name of the repository.
  • REPO_ID: The ID of the repository.
  • PROJECT_NAME: The name of the project.
  • PROJECT_ID: The ID of the project .
  • USER_IP: User IP required for "bitbucket_server".
  • BASE_BRANCH: The base branch of the repository (set to "master").
  • RELATIVE_DIRECTORY: The relative directory path within the repository.
# GPT env vars
  • OPENAI_API_MODEL: Specifies the type of the OpenAI API model.
    Supported values: "gpt-4", "gpt-3.5-turbo" etc. ( This models availability depends on the OPENAI_API_KEY ).
    Default value: "gpt-4".
  • OPENAI_API_KEY: The API key for accessing the OpenAI API.
# Vertex env vars
  • VERTEX_PROJECT_ID: The ID of the Vertex project.
  • VERTEX_REGION: The region where the Vertex project is located (example "us-central1").
  • VERTEX_BEARER_TOKEN: The bearer token for accessing the Vertex API.
  • VERTEX_MODEL: The name of the Vertex model to use.
    Supported values: "text-bison", "code-bison".
  • VERTEX_FINE_TUNE: Indicates whether fine-tuning is enabled for the model.
    Supported values: "true", "false".
    Default value: "false".
# Jira board env vars
  • JIRA_EMAIL: The email address associated with your Jira account.
  • JIRA_HOST_NAME: The hostname of your Jira instance.
  • JIRA_PASSWORD: The password for your Jira account.
# Azure board env vars
  • AZURE_ORG: The organization associated with your Azure Devops account.
  • AZURE_TOKEN: The access token for authenticating with Azure Devops.
  • AZURE_PROJECT: The name of the Azure Devops project.
# Logstash env vars
  • LOG_STASH_TYPE: Specifies the type of Logstash integration.
    Supported values: "api", "file".
    Default value: "api".
  • LOG_STASH_DATA: It is required if LOG_STASH_TYPE="file".
  • LOG_STASH_URL: The URL for the Logstash endpoint.
  • LOG_STASH_USE_API_KEY: Indicates whether Logstash uses an API key for authentication.
    Supported values: "true", "false".
  • Default value: "false".
  • LOG_STASH_API_KEY: The API key for authenticating with Logstash.
    It is required if LOG_STASH_USE_API_KEY="true"
  • LOG_STASH_USER_NAME: The username for authenticating with Logstash.
  • LOG_STASH_TOKEN: The token for authenticating with Logstash.
# Swagger env vars
  • SWAGGER_DATA: The URL for the Swagger file or the Swagger JSON file path.
# Additional vars
  • TEST_NAME: The name of the test.
    Default value: "roost-test".
  • ROOST_DIR: The directory path for Roost.
    Default value: "/var/tmp/Roost/RoostGPT".
  • LANGUAGE: The programming language of the source code.
    Supported values: "java", "go", "python", "csharp".
    Default value: "java".
  • AI_MODEL: The AI model being used to generate tests.
    Supported values: "gpt", "vertex".
    Default value: "gpt".
  • PACKAGES_TO_SCAN: The packages to be scanned, supports single package or comma separated values. 
    ( Required for JAVA ex. com.example.product or com.example.product,com.example.controller )
  • ITERATION: The iteration number to improve and run the test.
    Default value: "2".
  • TRIGGER_ID: The ID of the trigger. Unique id to identify multiple triggers
  • TIMEOUT: The timeout duration, after this the test generation will automatically stop.
    Default value: "30" ( 30 minutes ).
  • GITOPS: Indicates whether to create PR for the generated tests or not.
    Supported values: "true", "false".
    Default value: "true".
  • TEST_TYPE: The type of test to generate.
    Supported values: "unit", "functional", "artillery", "swagger".
    Default value: "functional".
  • RETRIGGER: Indicates whether to re-trigger existing test generated that from where it left.
    Supported values: "true", "false".
    Default value: "false".
  • BOARD_TYPE: The type of board to be used.
    Supported values: "jira", "azure".
    Default value: "jira".