Skip to main content

RoostGPT CLI

Instructions for creating .env file

# GIT env vars
GIT_TYPE="github"
GIT_TOKEN="ghp_************************************"
OWNER_NAME="git_username"
REPO_NAME="repo_name"
REPO_ID="repo_id"
PROJECT_NAME=""
PROJECT_ID=""
USER_IP=""
BASE_BRANCH="master"
RELATIVE_DIRECTORY="relative_directory_name"                         # GPTsupports "github", "gitlab", "azure", "bitbucket", "local"
HOSTED_TYPE=                      # supports "cloud" and "hosted" default is "cloud"
GIT_HOSTED_URL=                   # Required if HOSTED_TYPE="hosted"
LOCAL_PROJECT_PATH=               # Required if GIT_TYPE is "local", Path to your workspace.  
SOURCE_GIT_TOKEN=                 # Required
SOURCE_OWNER_NAME=                # Required
SOURCE_REPO_NAME=                 # Required
SOURCE_REPO_ID=                   # Required for GIT_TYPE="azure" or GIT_TYPE="gitlab"
SOURCE_PROJECT_NAME=              # Required for GIT_TYPE="azure" or GIT_TYPE="bitbucket"
SOURCE_PROJECT_ID=                # Required for GIT_TYPE="azure" or GIT_TYPE="bitbucket"
SOURCE_BASE_BRANCH=               # Required
SOURCE_RELATIVE_DIRECTORY=        # Optional, the relative path of the repository
SAME_TARGET_DETAIL=               # optional default "true"
DESTINATION_GIT_TOKEN=            # Required if SAME_TARGET_DETAIL="true"
DESTINATION_OWNER_NAME=           # Required if SAME_TARGET_DETAIL="true"
DESTINATION_REPO_NAME=            # Required if SAME_TARGET_DETAIL="true"
DESTINATION_REPO_ID=              # Required if SAME_TARGET_DETAIL="true" and GIT_TYPE="azure" or GIT_TYPE="gitlab"
DESTINATION_PROJECT_NAME=         # Required if SAME_TARGET_DETAIL="true" and GIT_TYPE="azure" or GIT_TYPE="bitbucket"
DESTINATION_PROJECT_ID=           # Required if SAME_TARGET_DETAIL="true" and GIT_TYPE="azure" or GIT_TYPE="bitbucket"
DESTINATION_BASE_BRANCH=          # Required if SAME_TARGET_DETAIL="true"

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

# Vertex AI env vars
VERTEX_PROJECT_ID=                # Required if AI_TYPE="vertex-project"vertexai"
VERTEX_REGION=                    # Required if AI_TYPE="us-central1"vertexai"
VERTEX_BEARER_TOKEN=              # Required if AI_TYPE="ya29.**************************************************************************************"vertexai"
VERTEX_MODEL=                     # optional default value is "text-bison"
VERTEX_FINE_TUNE=                 # optional default value is "false"

# Jira board env vars
JIRA_HOST_NAME=                   # Required if TEST_TYPE="functional" and BOARD_TYPE="jira"
JIRA_EMAIL=                       # Required if TEST_TYPE="jira_email"functional" JIRA_HOST_NAME=and BOARD_TYPE="_____.atlassian.net"jira"
JIRA_PASSWORD=JIRA_TOKEN=                       # Required if TEST_TYPE="functional" and BOARD_TYPE="jira"

# Azure board env vars
AZURE_ORG="azure_org"
AZURE_TOKEN="zvp******************************************"
AZURE_PROJECT="azure+project_name"                        # LogstashRequired if TEST_TYPE="functional" and BOARD_TYPE="azure"
AZURE_PROJECT=                    # Required if TEST_TYPE="functional" and BOARD_TYPE="azure"
AZURE_TOKEN=                      # Required if TEST_TYPE="functional" and BOARD_TYPE="azure"

# Log env vars
LOG_STASH_TYPE=LOG_SOURCE=                       # optional default value is "api"elks"
LOG_STASH_DATA_PATH=""LOG_SOURCE_PATH=                  LOG_STASH_URL="https://**************"# LOG_STASH_USE_API_KEY="true"optional, LOG_STASH_API_KEY="SElx*************************************************"the LOG_STASH_USER_NAME="elastic"log LOG_STASH_TOKEN="lC_*****************"file path
LOG_ELASTICSEARCH_URL=            # optional, the Elastic search URL
LOG_ELASTICSEARCH_USER=           # optional, the Elastic search user name
LOG_ELASTICSEARCH_TOKEN=          # optional, the Elastic search token
LOG_ELASTICSEARCH_API_KEY=        # optional, the Elastic search api key

# Swagger env vars
SWAGGER_DATA=SWAGGER_URL=                      # Required if TEST_TYPE="https://****************************artillery-swagger"

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

# Additional vars
USE_CLI=                          # optional default value is "true"
TEST_NAME=                        # optional default value is "dummy-roost-test"
ROOST_DIR=                        # optional default value is "/var/tmp/Roost/RoostGPT"
LANGUAGE=                         # optional default value is "JAVA"java" AI_MODEL=supports "vertex"java", "go", "python", "c#", "nodejs" 
AI_TYPE=                          # optional default value is "openai", supports "openai", "vertexai", "open_source"
PACKAGES_TO_SCAN=                 # Required for LANGUAGE=""java", The package to scan and generate test for example - com.demo.sample
ITERATION=                        # optional default value is 2
TIMEOUT=                          # optional default value is "2"60" min
TEST_TYPE=                        # optional default value is "unit" supports "unit", "functional", "artillery", "artillery-swagger"
RETRIGGER=                        # optional default value is "false" supports true and false
TRIGGER_ID=                       # unique id to identify multiple triggers
BOARD_TYPE=                       # optional default value is "1234567"jira" TIMEOUT=supports "30"jira" GITOPS=and "azure"

# Improve test env vars
IMPROVE_TEST=                     # optional default value is "false"
FILE_PATH=                        # Required if IMPROVE_TEST="true"
TEST_TYPE=USER_CONTENT=                     # Required if IMPROVE_TEST="unit"true"
RETRIGGER="false"GIT_PR_URL=                       BOARD_TYPE="jira"# The Git pr url of the generated test
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".

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.

  • --trigger: Triggers the test creation process.

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

  • --create-config: Creates a sample configuration file in the current directory. This helps users set up the required environment variables for the RoostGPT application.

  • --output <path>, -o <path>: Specifies the path where the configuration file should be created. The configuration file contains environment variables used by the RoostGPT application.

Note: You can either use the --config option or the --create-config option to configure the environment variables. The --config option takes precedence over the --create-config option if both are provided.