Skip to main content

CLI

Summary of all CLI commands and options

Usage

harness-upgrade [global options] command [command options] [arguments...]

Commands

CommandDescription
update, upgradeCheck for updates and upgrade the CLI
account-summaryGet a summary of the account
application-summaryGet a summary of an app
user-groupsImport user groups from First Gen to Next Gen
accountImport secrets managers, secrets, connectors. This will not migrate services, environments, triggers, pipelines etc
appImport an app into an existing project by providing the appId
service, servicesImport services into an existing project from an application
secretsImport secrets
environmentsImport environments into an existing project from an application
connectorsImport connectors
workflowsImport workflows as stage or pipeline templates by providing the appId & workflowIds
pipelinesImport pipelines into an existing project by providing the appId & pipelineIds
triggersImport triggers by providing the appId & triggerIds
expressionslooks for harness CG expressions in current directory & sub directories from current folder & replaces them with equivalent NG expressions
projectProject specific commands like create, delete, list etc.
orgOrg specific commands.
templatesTemplate specific commands.
help, hShows a list of commands or help for one command

Global Options

FlagDescription
--env ENVpossible values - Prod, Prod3, SelfManaged, QA, Dev
--base-url BASE_URLprovide the BASE_URL for self managed platforms
--account ACCOUNTACCOUNT that you wish to migrate
--api-key API_KEYAPI_KEY to authenticate & authorise the migration
--secret-scope SCOPESCOPE to create secrets in. Possible values - account, org, project
--connector-scope SCOPESCOPE to create connectors in. Possible values - account, org, project
--workflow-scope SCOPESCOPE to create stage templates in. Possible values - account, org, project
--template-scope SCOPESCOPE to create templates in. Possible values - account, org, project
--user-group-scope SCOPESCOPE to create user groups in. Possible values - account, org, project
--org IDENTIFIERorganisation IDENTIFIER in next gen
--project IDENTIFIERproject IDENTIFIER in next gen
--app APP_IDAPP_ID in current gen
--identifier-format FORMATFORMAT to use for generation of identifiers. Supported values as CAMEL_CASE & LOWER_CASE (default: CAMEL_CASE)
--custom-expressions FILEprovide a FILE to load custom expressions from
--override FILEprovide a FILE to load overrides
--target-account ACCOUNTdestination ACCOUNT that you wish to migrate to
--target-api-key API_KEYAPI_KEY for the target account to authenticate & authorise the migration.
--target-gateway-url URLdestination gateway URL. For Prod1 & Prod2, use https://app.harness.io/gateway, for Prod3 use https://app3.harness.io/gateway
--load FILEFILE to load flags from
--insecureallow insecure API requests. This is automatically set to true if environment is Dev (default: false)
--log-levelset the log level. Possible values - trace, debug, info, warn, error, fatal, panic. Default is info
--flags valueprovide a list of flags for custom logic. Please refer here.
--jsonlog as JSON instead of standard ASCII formatter (default: false).
--help, -hshow help.
--version, -vprint the version

If not all the required flags are provided we will fall back to prompt based technique to capture all the required details.