Command-Line API (CLI)

Node.js is fully extensible and has several CLI options to execute scripts and other runtime options. It currently supports RabbitMQ, MongoDB, Aerobase, history and notifications providers, and related commands.

To manually run the commands listed in the table below:

  1. Open a Command Prompt.

  2. Go to the admin-cli folder: C:\Nintex\PDServer\Support\kryon-admin-cli.

  3. Run these commands:

    set CONFIG_DIR=C:\nintex\config

    set NODE_ENV=prod

    set KRYON_ENC_CFG=C:\nintex\config\prod\general\kryon-decrypt.json

    set NODE_PATH=C:\nintex\PDServer\MicroServices\node_modules

  4. Run the relevant execution path from the table below:

Command Name Provider Command Description Parameters Execution
addClient Aerobase Adds a client. If the public client is set to false, the system will generate a client secret credential that will be output in a file client-data.txt.
  • userName

  • auth

  • clientId

  • publicClient

  • bearerOnly

Copy

Command

node bin\cli.js --provider=aerobase --command=addClient --userName=authadmin --auth=Kryon123!  --clientId=kryon-server --publicClient=false 
addRoleClientAndUser Aerobase Adds a new role, clientId, and user.
  • userPrefix

  • roleName

  • tenantId

  • userName

  • machineName

Copy

Command

node bin\cli.js --provider=aerobase --command=addRoleClientAndUser  --userPrefix="cpx"  --roleName=clients-proxy  --tenantId=b517acbf-c9c5-4746-9a29-f94f39dc6893 --userName=kryon.proxy --machineName=default
addUser RabbitMQ Adds a user to RabbitMQ.
  • userName
  • password

Copy

Command

node bin\cli.js --provider=rabbitmq --command=addUser --userName=testUser --password=test-pass
addUser Aerobase

Adds a user on Aerobase with a given existing role:

  • If an auth parameter is not provided, a password will be generated (10 characters: at least 1 of each: number/uppercase/lowercase/symbol).

  • When the vault path is provided, the encrypted password is saved to the Process Discovery’s vault file with the prefix Kryon_PD_Web_Client.

  • When isRemoveDefaultRoles = true, all default roles will be removed for the user. When isRemoveDefaultRoles is false, or no parameter is specified, all default roles will be assigned to the user.

  • authUserName
  • authUserPassword

  • userName

  • auth (optional)

  • roleName

  • vaultPath (optional)
  • isRemoveDefaultRoles

    (optional)
Copy

Command

node bin\cli.js --provider=aerobase --command=addUser --authUserName=authAdmin --authUserPassword=Kryon123! --userName=pddr --auth=Pd123456789!! --roleName=pd-robot
Copy

Command

node bin\cli.js --provider=aerobase --command=addUser --authUserName=authAdmin --authUserPassword=Kryon123! --userName=pddr --roleName=pd-robot --vaultPath=C:\Kryon\PdServer\support\pddr.keys --isRemoveDefaultRoles=true
changeUserPassword Aerobase

Changes an existing user password.

  • When the vault path is provided, the encrypted password is saved to Process Discovery’s vault file with the prefix Kryon_PD_Web_Client.

  • authUserName
  • authUserPassword

  • userName

  • auth

  • vaultPath (optional)
Copy

Command

node bin\cli.js --provider=aerobase --command=changeUserPassword --authUserName=authAdmin --authUserPassword=Kryon123! --userName=pddr --auth=Kryon123! --vaultPath=C:\Kryon\PdServer\support\pddr.keys
createAdminUser MongoDB Creates MongoDB admin user.
  • authUserName
  • authUserAuth

Copy

Command

node bin\cli.js --provider=mongodb --command=createAdminUser --adminUserName=kryon-admin --adminUserAuth=Kryon2020!  
createDatabase MongoDB Creates MongoDB database.
  • dbName

Copy

Command

node bin\cli.js --provider=mongodb --command=createDatabase --dbName=kryon-db
createIndex MongoDB Creates MongoDB index.
  • tableName
  • indexName

  • fileName

Copy

Command

node bin\cli.js --provider=mongodb --command=createIndex --tableName=pd-rawdata-570ca6c0-6a10-11eb-977a-770907e2d7b2 --indexName=t_r_a --fileName=indexConf.json
createQueue RabbitMQ Creates RabbitMQ queue.
  • queueName
  • expiration

  • dlqName

  • dlqExpiration

  • dlExchange
Copy

Command

node bin\cli.js --provider=rabbitmq --command=createQueue --queueName=tasks-queue --expiration=300000 --dlqName=failed-tasks --dlqExpiration=3000000 --dlExchange=tasks-queue-DLX
createSecretsClientsAndRoles Aerobase Creates kryon-secrets, kryon-secrets-admin, and kryon-secrets-reader clients with secrets-admin and secrets-reader roles.
  • authUserName
  • authUserPassword

Copy

Command

node bin\cli.js --provider=aerobase --command=createSecretsClientsAndRoles --authUserName=authAdmin --authUserPassword=Kryon123!
createTTLCollection MongoDB Creates a MongoDB collection with a TTL (Time To Live) index (based on the time it was created. For example, if you set it with TTL 60 seconds, it will be automatically deleted 60 seconds after it was created - mostly createdAt).
  • collectionName
  • expireAfterSeconds

  • fieldName

Copy

Command

node bin\cli.js --provider=mongodb --command=createTTLCollection --collectionName=test-collection --expireAfterSeconds=60 --fieldName=createdAt
createUser MongoDB Creates MongoDB user.
  • dbName
  • userName

  • userAuth

Copy

Command

node bin\cli.js --provider=mongodb --command=createUser --dbName=kryon-db --userName=kryon-rw --userAuth=Kryon123!
dbCreate pdSetup Creates Nintex Process Discovery database.
  • msqlScriptPath
  • mysqlHosts

Copy

Command

node bin\cli.js --provider=pdSetup --command=dbCreate --dbProvider=mysql --msqlScriptPath=/home/arik.levin/git/deployments/pd-resources/DBScripts
decryptPhrase vault Decrypts a phrase using PD vault encryption.
  • phrase

Copy

Command

node bin\cli.js --provider=vault --command=decryptPhrase --phrase=eb5c616455661d6de54a49aa6e04dc86
deleteDuplicates MongoDB Removes duplicates from a collection.
  • collectionName
  • uniqueFields

    (recordingId,actionId)

Copy

Command

node bin\cli.js --provider=mongodb --command=deleteDuplicates --collectionName=pd-rawdata-3cd2b0c0-61ad-11ec-9b55-67c89939575d --uniqueFields="recordingId,actionId"
deleteQueue RabbitMQ Deletes RabbitMQ queue.
  • queueName
  • dlqName

  • dlExchange

Copy

Command

node bin\cli.js --provider=rabbitmq --command=deleteQueue --queueName=test-queue --dlqName=test-queue-failed --dlExchange=text-queue-DLX
encryptPhrase vault Encrypts a phrase using PD vault encryption.
  • phrase

Copy

Command

node bin\cli.js --provider=vault --command=encryptPhrase --phrase=Kryon123!
ensureAerobaseClientTenantId userMigration Adds tenantId protocol-mapper to clients specified in the aerobase_auth.json config file.
  • authUserName
  • authUserPassword

Copy

Command

node bin\cli.js --provider=userMigration --command=ensureAerobaseClientTenantId --authUserName=authadmin --authUserPassword=Kryon123!
ensureAerobaseTenantGroups userMigration Creates/updates tenant groups according to data from LeoCompanies table.
  • authUserName
  • authUserPassword

Copy

Command

node bin\cli.js --provider=userMigration --command=ensureAerobaseTenantGroups --authUserName=authadmin --authUserPassword=Kryon123!
ensureFederationAttributeMapper userMigration Adds hardcoded-attribute-mapper according to data in LeoFederationGroups table.
  • authUserName
  • authUserPassword

Copy

Command

node bin\cli.js --provider=userMigration --command=ensureFederationAttributeMapper --authUserName=authadmin --authUserPassword=Kryon123!
ensureFederationGroupMapper userMigration Adds hardcoded-ldap-group-mapper according to data in LeoFederationGroups table.
  • authUserName
  • authUserPassword

Copy

Command

node bin\cli.js --provider=userMigration --command=ensureFederationGroupMapper --authUserName=authadmin --authUserPassword=Kryon123!
fixCache rawData If the cache has had a mismatch for some reason, or double reporting, this fixes it. Currently only supported in MongoDB.
  • tenant

Copy

Command

node bin/cli --tenant={tenantId} --provider=rawData --command=fixCache
fixDashboardData rawData Fixes PD dashboard data.
  • tenantId

Copy

Command

node bin\cli.js --tenantId=_____________ --provider=rawData  --command=fixDashboardData 
generateClientSecret Aerobase Generates a client secret in a file client-data.txt format: {"clientId":"kryon-server","data":{"type":"secret","value":"d7884f9c-5023-45a9-9ddf-5d244e2d0bfe"}}
  • userName
  • auth

  • clientId

Copy

Command

node bin\cli.js --provider=aerobase --command=generateClientSecret --userName=authadmin --auth=******  --clientId=kryon-server
generateProxyFile proxyClient Generates a client proxy file.    
getClientGuid Aerobase Gets client guid in a file client-data.txt format: {"clientId":"kryon-server","clientGuid":"53c85377-697c-400d-86d9-440bf4f53ff3"}
  • userName
  • auth

  • clientId

Copy

Command

node bin\cli.js --provider=aerobase --command=getClientGuid --userName=authadmin --auth=Kryon123!  --clientId=kryon-server 
getClientSecret Aerobase Gets client secret in a file client-data.txt format: {"clientId":"kryon-server","data":{"type":"secret","value":"d7884f9c-5023-45a9-9ddf-5d244e2d0bfe"}}
  • userName
  • auth

  • clientId

Copy

Command

node bin\cli.js --provider=aerobase --command=getClientSecret --userName=authadmin --auth=******  --clientId=kryon-server
getIndexes MongoDB Gets a list of table indexes.
  • tableName

Copy

Command

node bin\cli.js --provider=mongodb --command=getIndexes --tableName='pd-rawdata-1'
getOcrStats algoData

Exports words recognized in tenant recording.

Creates one file containing the number of appearances per word and another containing the number of images each word appears in.

  • tenantId
  • savePath

Copy

Command

node bin\cli.js --provider=algoData --command=getTranscripts --tenantId=3cd2b0c0-61ad-11ec-9b55-67c89939575d --savePath=C:\Kryon\tmp\data\
getTables MongoDB Gets a list of tables.
  • tablesPattern

Copy

Command

node bin\cli.js --provider=mongodb --command=getTables --tablesPattern='pd-rawdata-'
getTranscripts algoData Exports OCR transcripts to SQLite files.
  • tenantId
  • savePath

Copy

Command

node bin\cli.js --provider=algoData --command=getTranscripts --tenantId=3cd2b0c0-61ad-11ec-9b55-67c89939575d --savePath=C:\Kryon\tmp\data\
joinDockerCluster RabbitMQ Executes all commands for joining a cluster, based on Docker.
  • clusterName
  • dockerName

Copy

Command

node bin\cli.js --provider=rabbitmq --command=joinDockerCluster --clusterName="rabbit@kryon-rabbitmq1" --dockerName="kryon-rabbitmq3"
leaveDockerCluster RabbitMQ Executes all commands for leaving a cluster, based on Docker.
  • clusterName
  • dockerName

Copy

Command

node bin\cli.js --provider=rabbitmq --command=leaveDockerCluster --dockerName="kryon-rabbitmq3"
makeIconsFile pdApps Creates a map of icons in Base64 JSON file from png/jpg’s folder.
  • path
  • outputPath

  • outputFilename

Copy

Command

node bin\cli.js --provider=pdApps --command=makeIconsFile --path='/home/israel.israeli/Desktop/icons' --outputPath='/home/israel.israeli/Desktop' --outputFilename='iconsMap.json'
migrate algoData Migrates algo data from MySQL to MongoDB.  
Copy

Command

node bin\cli.js --provider=algoData--comnand=migrate
migrateAerobaseToTenant userMigration Creates a tenantId attribute for local users in Aerobase from pre-tenant versions with Aerobase.
  • authUserName
  • authUserPassword

Copy

Command

node bin\cli.js --provider=userMigration --command=migrateAerobaseToTenant --authUserName=authadmin --authUserPassword=Kryon123!
migrateApps pdApps Migrates the tenant’s apps from MariaDB to MongoDB.  
Copy

Command

node bin\cli.js --provider=pdApps --comnand=migrateApps
migrateClientsToRobots clientsToRobotsMigration Migrates LeoAutomationClients table data to robots schema and attaches the Application Credentials Vault to the “new” robot.  
Copy

Command

node bin\cli.js --provider=clientsToRobotsMigration --command=migrateClientsToRobots
migrateEventLog algoData Migrates the old formatter event log to the new CV event log.
  • collectionsPattern (default)

Copy

Command

node bin\cli.js --provider=algoData --command=migrateEventLog --collectionsPattern=* 
notify notificationsClient Sends notifications to RabbitMQ from a file.
  • fileName

Copy

Command

node bin\cli.js --provider=notificationsClient --command=notify --fileName=E:\dev\KRYON\github\node-monorepo\automations\generalNotification.json
notifyFolder notificationsClient Sends bulk notifications to RabbitMQ from a folder.
  • folder

Copy

Command

node bin\cli.js --provider=notificationsClient --command=notifyFolder --folder=E:/dev/KRYON/github/node-monorepo/automations/notifications/
partialAerobaseImport userMigration Loads data from partialRealmJson, replaces all placeholders named $CLIENT_SECRET$ with corresponding data from realmJson, and imports the result data to Aerobase.
  • authUserName
  • authUserPassword

  • partialRealmJson

  • realmJson

Copy

Command

node bin\cli.js --provider=userMigration --command=partialAerobaseImport --authUserName=authadmin --authUserPassword=Kryon123! --partialRealmJson=c:\kryon-realm20.3to.21.04.json --realmJson=c:\kryon-realm.json
publishHistory historyClient

Publishes a history message (mainly for testing).

JSON files are supported with the following format :

Copy

robotHistory

{
  "metadata" : {
    "type" : "robotHistory",
    "sender" : "script" 
  },
  "data" : {
    "robotId" : "50825a0c-c148-447a-b9b3-b2b1aaeb1a6b",
    "robotState": "running",
    "eventType" : "progress",
    "osUser": "localadmin",
    "details" : { "event_id" : "4567" , "attr1" : "value1"}
  }
}
Copy

taskSummary

{
  "metadata" : {
    "type" : "taskSummary",
    "sender" : "script" 
  },
  "data" : {
    "taskId": "35",
    "robotId" : "50825a0c-c148-447a-b9b3-b2b1aaeb1a6b",
    "queueId": "afb3af03-099f-49af-a5de-62e1adcbe9ba",
    "workflowId" : "3fbd9408-7673-479c-99bf-971d351f3826",
    "tenantId": "6301f6f8-4591-4254-b5c0-4fc66ffbedbb",
    "producerId" : "a72c1d20-a721-4853-b816-18eb9dfcb3cb",
    "taskName": "task name",
    "startedDateTime": "2020-11-17 03:31:45.703",
    "endedDateTime" : "2020-11-17 03:37:41.703",
    "durationSec" : 6
  }
}
Copy

queueHistory

{
  "metadata" : {
    "type" : "queueHistory",
    "sender" : "script" 
  },
  "data" : {
    "id": "23825a0c-c148-447a-b9b3-b2b1aaeb1a6e",
    "queueName" : "test",
    "queueId": "afb3af03-099f-49af-a5de-62e1adcbe9ba",
    "tenantId": "6301f6f8-4591-4254-b5c0-4fc66ffbedbb",
    "eventType": "queue created",
    "eventDetails": { "event_id" : "4567" , "attr1" : "value1"}
  }
}
Copy

taskHistory

{
  "metadata" : {
    "type" : "taskHistory",
    "sender" : "script" 
  },
  "data" : {
    "taskId": "35",
    "robotId" : "50825a0c-c148-447a-b9b3-b2b1aaeb1a6b",
    "queueId": "afb3af03-099f-49af-a5de-62e1adcbe9ba",
    "workflowId" : "3fbd9408-7673-479c-99bf-971d351f3826",
    "tenantId": "6301f6f8-4591-4254-b5c0-4fc66ffbedbb",
    "producerId" : "a72c1d20-a721-4853-b816-18eb9dfcb3cb",
    "name": "task name",
    "state": "in progress",
    "producerType" : "trigger",
    "operationalHours" : "",
    "businessProcess" : "",
    "retryLimit" : 3,
    "retryTimes" : 0,
    "ttl" : 0,
    "priority": 1,
    "taskConfigurationJson": { "key" : "value" , "key1" : "value1"},
    "eventType": "task starting",
    "eventDetails": { "event_id" : "4567" , "attr1" : "value1"},
    "wizardApplications" : "",
    "avgTaskRun" : 170,
    "robotVersion" :"20.10"
  }
}
 
Copy

Command

node bin\cli.js --provider=historyClient --command=publishHistory --fileName=E:\dev\KRYON\github\node-monorepo\automations\robotHistory.json
publishHistoryFolder historyClient Sends bulk history messages to RabbitMQ from a folder.
  • folder

Copy

Command

node bin\cli.js --provider=historyClient --command=publishHistoryFolder --folder=E:/dev/KRYON/github/node-monorepo/automations/tasksSummary
queuesSetup RabbitMQ Creates all queues according to the setup file.
  • queuesConfigFile

Copy

Command

node bin\cli.js --provider=rabbitmq --command=queuesSetup --queuesConfigFile=queues.json
sendMessage RabbitMQ

Sends messages to RabbitMQ.

Copy

Example

{
    "taskData": {
      "taskName": "MyTrigger 32 (#180220180907)",
      "wizardID": 250,
      "tenantID": 2,
      "queueID": "bc328d8c-29ca-4349-a57f-51ee0f75a221",
      "priority": 1,
      "retryLimit": 1,
      "retryInterval": "0 */5 * ? * *",
      "businessProcess": "some very important shit",
      "operationalHours": "0 0 6-19 ? * MON,TUE,WED,THU *",
      "wizardApplications": [],
      "customWizardName" : "",
      "ttl": "2020-04-22T20:56:18+03:00",
      "assignmentId": "",
      "assignmentType": "",
      "extraData": {},
      "notifications": {},
      "variables": []
    },
    "id " : "cc328d8c-29ca-4349-a57f-51ee0f75a222",
    "triggerID": "2",
    "triggerName": "MyTrigger 32",
    "triggerType": "kryon-scheduled",
    "createUser": "<TriggersManager>"
}
  • fileName
  • queueName

Copy

Command

node bin\cli.js --provider=rabbitmq --command=sendMessage --queueName=AddTaskToSpecificQueueRequest --fileName=E:\dev\KRYON\github\node-monorepo\automations\taskRequest.json
setCryptoKey secrets Creates a new secret key.
  • tenantId
  • algo (aes-256-gcm/aes-256-cbc)

  • product (PD/RPA)

  • keyType (env/ssm)

  • data
Copy

Command

node bin\cli.js --provider=secrets --command=setCryptoKey --tenantId=<tid> --algo=aes-256-gcm --product=pd --keyType=env data='asdfdv4455443'
setHAPolicy RabbitMQ Sets HA Policy for RabbitMQ cluster.
  • policyName

Copy

Command

node bin\cli.js --provider=rabbitmq --command=setHAPolicy --policyName="kryon-ha"
syncUserRolesToAerobase userMigration

Synchronizes user(s) roles in the Aerobase according to the data in dbo.LeoUserRoles table.

  • HasStudioPermission studio-developer

  • HasPlayerPermission attended-robot

  • HasConsoleUserPermission console-user

  • HasConsoleAdminPermission console-view-only

  • HasUnattendedRobotPermission unattended-robot

  • HasAutomationApiPermission supports-api-calls

  • authUserName
  • authUserPassword

  • userId (optional)

Copy

To synchronize roles for all users

node bin\cli.js --provider=userMigration --command=syncUserRolesToAerobase --authUserName=authadmin --authUserPassword=*****
Copy

To synchronize roles for the user with ID 123

node bin\cli.js --provider=userMigration --command=syncUserRolesToAerobase --userId=123 --authUserName=authadmin --authUserPassword=*****
uploadAppsToDb pdApps Uploads predefined JSON apps to MongoDB.
  • collectionName
  • path

Copy

Command

node bin\cli.js --provider=pdApps --comnand=uploadAppsToDb --collectionName='teams-data' --path='/home/israel.israeli/Desktop/prepps.json'
uploadCodex MongoDB Uploads the masking codex.
  • collectionName
  • fileName (in config\general)

  • regexFileName (in config\general)

  • tenantName (default)

  • upsert (default is false)

Copy

Command

node bin\cli.js --provider=mongodb --command=uploadCodex --collectionName=masking-codex --fileName=masking-private-codex.csv --regexFileName=masking-regex-codex.csv --tenantName=default --upsert=true
uploadIconsToDb pdApps Uploads JSON file icons to MongoDB.
  • collectionName
  • path

Copy

Command

node bin\cli.js --provider=pdApps --comnand=uploadIconsToDb --collectionName='teams-data' --path='/home/israel.israeli/Desktop/preicons.json'
uploadRawData rawData

Uploads PD raw data SQLite files to the MongoDB path parameter.

It should be a folder with SQLite files to upload.

  • tenant
  • dbProvider

  • path

Copy

Command

node bin\cli.js --tenant=714e6950-9518-11eb-85dc-ff8896fdb21c --provider=rawData  --command=uploadRawDataToDB --dbProvider=mongodb --path='C:/kryon/data'
uploadRawDataToGW rawData Uploads raw data to the gateway.
  • tenant
  • path

Copy

Command

node bin\cli.js --tenant=_____________ --provider=rawData  --command=uploadRawDataToGW --vaultAuthPath='C:/nintex/PDServer/Support/pddr.keys' --path='___________'
validateTablesIndexes MongoDB

Validates tables and indexes on MongoDB.

If indexes do not exist, it will create them.

  • validationConfigFile

Copy

Command

node bin\cli.js --provider=mongodb --command=validateTablesIndexes --validationConfigFile=dbModelManager.json