Skip to main content

Harness CLI Reference

Documentation containing information about all available commands and options within the Harness CLI utility tool.

Synopsis

NAME:
harness - CLI utility to interact with Harness Platform to manage various Harness modules and its diverse set of resources.

USAGE:
harness [global options] command [command options] [arguments...]

VERSION:
vX.X.X

COMMANDS:
update, upgrade Check for updates and upgrade the CLI
secret, secret-token Secrets specific commands. eg: apply (create/update), delete
service, svc Service specific commands, eg: apply (create/update), delete, list
environment, env Environment specific commands, eg: apply (create/update), delete, list
connector, conn Connector specific commands, eg: apply (create/update), delete, list
infrastructure, infra Infrastructure specific commands, eg: apply (create/update), delete, list
pipeline, pipeline Pipeline specific commands, eg: apply (create/update), delete, list
login, login Login with account identifier and api key.
account, acc Fetch Account details
help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:
--base-url Provide the NG_BASE_URL for self managed platforms
--api-key API_KEY for the target account to authenticate & authorise the user.
--account-id API_KEY for the target account to authenticate & authorise the user.
--load FILE FILE to load flags from.
--debug Prints debug level logs (default: false)
--json Log as JSON instead of standard ASCII formatter (default: false)
--help, -h Show help
--version, -v Print the version

Description

Setup Harness CD & GitOps in a few commands

Commands

harness login - Authenticate via the CLI by providing an API token and an Account Identifier.

harness update - Updates the CLI.

harness secret - Creates or deletes a Harness Secret.

harness connector - Creates, deletes or update a Harness Connector.

harness environment - Creates, deletes or update a Harness Environment.

harness infrastructure - Creates, deletes or update a Harness Infeastructure.

harness service - Creates, delete or update a Harness Service.

harness pipeline - Creates, delete or update a Harness Pipeline.

Global Options

--api-key - Accepts a Harness API Token as a value for CLI login.

--account-id - Accepts an Account Identifier as a value for CLI login.

--base-url - Specifies the URL of the self-managed Harness instance.

--debug - Prints debug level logs. Defaults to false.

--json - Command outputs in JSON format.

--load - Load flags inputs from a file.

--version - Prints the utility version.

--help - Shows a list of commands or help for one command.

Files

~/.secrets.json - Serves as a repository for credentials, containing the Harness API Token and Account Id..

Author

The original authorship of the Harness CLI utility tool can be attributed to Harness, Inc.

License

Harness CLI is released under the terms of the MIT License.

See also