> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/use-harness-platform/automation/cli/content/reference/v0.md).

# V0

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

### Synopsis <a href="#synopsis" id="synopsis"></a>

```
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:
   development

COMMANDS:
   update, upgrade                 Check for updates and upgrade the CLI
   secret, secret-token            Secrets specific commands. eg: apply (create/update)
   service, svc                    Service specific commands, eg: apply (create/update), list
   environment, env                Environment specific commands, eg: apply (create/update), list
   connector, conn                 Connector specific commands, eg: apply (create/update), list
   gitops-application, gitops-app  Gitops application specific commands, eg: apply (create/update), list
   gitops-cluster, gitops-cluster  Gitops Cluster specific commands, eg: apply (create/update), list
   gitops-repository, gitops-repo  Gitops repository specific commands, eg: apply (create/update), list
   infrastructure, infra           Infrastructure specific commands, eg: apply (create/update), list
   pipeline, pipeline              Pipeline specific commands, eg: apply (create/update), run, 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 NG_BASE_URL  provide the NG_BASE_URL for self managed platforms
   --api-key API_KEY       API_KEY for the target account to authenticate & authorise the user.
   --account-id value      provide an Account Identifier of 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 <a href="#description" id="description"></a>

Setup Harness CD & GitOps in a few commands

### Commands <a href="#commands" id="commands"></a>

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

`harness update` - Updates the CLI.

`harness secret` - Creates or updates a Harness Secret.

`harness connector` - Creates or updates a Harness Connector.

`harness gitops-repository` - Creates or updates a GitOps Repository.

`harness gitops-cluster` - Creates or updates a GitOps Cluster.

`harness gitops-application` - Creates or updates a GitOps Application.

`harness environment` - Creates or updates a Harness Environment.

`harness infrastructure` - Creates or updates a Harness Infrastructure.

`harness service` - Creates or updates a Harness Service.

`harness pipeline` - Creates, updates or runs a Harness Pipeline.

### Global options <a href="#global-options" id="global-options"></a>

`--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.

### Command Reference <a href="#command-reference" id="command-reference"></a>

#### 1. `harness secret apply help` <a href="#id-1-harness-secret-apply-help" id="id-1-harness-secret-apply-help"></a>

```
NAME:
   harness secret apply - Create a new secret or Update an existing one.

USAGE:
   harness secret apply [command options] [arguments...]

OPTIONS:
   --token value        specify your secret token
   --secret-name value  provide the secret name
   --secret-type value  provide the secret type
   --domain value       domain for cloud data center
   --org-id value       provide an Organization Identifier
   --project-id value   provide a Project Identifier
   --help, -h           show help
```

#### 2. `harness connector apply help` <a href="#id-2-harness-connector-apply-help" id="id-2-harness-connector-apply-help"></a>

```
NAME:
   harness connector apply - Create a new connector or Update an existing one.

USAGE:
   harness connector apply [command options] [arguments...]

OPTIONS:
  --file value                    path to YAML file containing connector configuration
  --docker-user value             docker username for the docker connector
  --git-user value                git username for the github connector
  --aws-access-key value          AWS Access Key for AWS Connector
  --aws-secret-key value          AWS Secret Key for AWS Connector
  --gcp-project-id value          provide the Google Cloud Platform project id.
  --gcp-bucket-name value         provide the Google Cloud Platform bucket name.
  --gcp-service-account value     provide the Google Cloud Platform service account email.
  --cloud-region value            provide the Google Cloud Platform bucket name.
  --org-id value                  provide an Organization Identifier
  --project-id value              provide a Project Identifier
  --help, -h                      show help
```

#### 3. `harness environment apply help` <a href="#id-3-harness-environment-apply-help" id="id-3-harness-environment-apply-help"></a>

```
NAME:
   harness environment apply - Create a new environment or Update an existing one.

USAGE:
   harness environment apply [command options] [arguments...]

OPTIONS:
   --file value           path to YAML file containing environment configuration
   --domain value         domain for cloud data center
   --org-id value         provide an Organization Identifier
   --project-id value     provide a Project Identifier
   --help, -h             show help
```

#### 4. `harness infrastructure apply help` <a href="#id-4-harness-infrastructure-apply-help" id="id-4-harness-infrastructure-apply-help"></a>

```
NAME:
   harness infrastructure apply - Create a new infrastructure or Update an existing one.

USAGE:
   harness infrastructure apply [command options] [arguments...]

OPTIONS:
   --file value           path to YAML file containing infrastructure configuration
   --domain value         domain for cloud data center
   --org-id value         provide an Organization Identifier
   --project-id value     provide a Project Identifier
   --help, -h             show help
```

#### 5. `harness service apply help` <a href="#id-5-harness-service-apply-help" id="id-5-harness-service-apply-help"></a>

```
NAME:
   harness service apply - Create a new service or Update an existing one.

USAGE:
   harness service apply [command options] [arguments...]

OPTIONS:
   --file value           path to YAML file containing service configuration
   --domain value         domain for cloud data center
   --org-id value         provide an Organization Identifier
   --project-id value     provide a Project Identifier
   --help, -h             show help
```

#### 6. `harness gitops-cluster apply help` <a href="#id-6-harness-gitops-cluster-apply-help" id="id-6-harness-gitops-cluster-apply-help"></a>

```
NAME:
   harness gitops-cluster apply - Create a new gitops-cluster or Update an existing one.

USAGE:
   harness gitops-cluster apply [command options] [arguments...]

OPTIONS:
   --agent-identifier value  provide GitOps Agent Identifier.
   --org-id value            provide an Organization Identifier
   --project-id value        provide a Project Identifier
   --help, -h                show help
```

#### 7. `harness gitops-cluster link help` <a href="#id-7-harness-gitops-cluster-link-help" id="id-7-harness-gitops-cluster-link-help"></a>

```
NAME:
   harness gitops-cluster link - Links a GitOps-cluster with an environment.

USAGE:
   harness gitops-cluster link [command options] [arguments...]

OPTIONS:
   --agent-identifier value  provide GitOps Agent Identifier.
   --cluster-id value        provide a Cluster Identifier.
   --environment-id value    provide an Environment Identifier.
   --org-id value            provide an Organization Identifier.
   --project-id value        provide a Project Identifier.
   --help, -h                show help
```

#### 8. `harness gitops-repository apply help` <a href="#id-8-harness-gitops-repository-apply-help" id="id-8-harness-gitops-repository-apply-help"></a>

```
NAME:
   harness gitops-repository apply - Create a new gitops-repository or Update an existing one.

USAGE:
   harness gitops-repository apply [command options] [arguments...]

OPTIONS:
   --agent-identifier value  provide GitOps Agent Identifier.
   --org-id value            provide an Organization Identifier
   --project-id value        provide a Project Identifier
   --help, -h                show help
```

#### 9. `harness gitops-application apply help` <a href="#id-9-harness-gitops-application-apply-help" id="id-9-harness-gitops-application-apply-help"></a>

```
NAME:
   harness gitops-application apply - Create a new gitops-application or Update an existing one.

USAGE:
   harness gitops-application apply [command options] [arguments...]

OPTIONS:
   --agent-identifier value  provide GitOps Agent Identifier.
   --git-user value          provide your GitHub username
   --org-id value            provide an Organization Identifier
   --project-id value        provide a Project Identifier
   --help, -h                show help
```

#### 10. `harness pipeline apply help` <a href="#id-10-harness-pipeline-apply-help" id="id-10-harness-pipeline-apply-help"></a>

```
NAME:
   harness pipeline apply - Create a new pipeline or Update an existing one.

USAGE:
   harness pipeline apply [command options] [arguments...]

OPTIONS:
   --docker-user value  docker username for the docker connector
   --git-user value     git username for the github connector
   --org-id value       provide an Organization Identifier
   --project-id value   provide a Project Identifier
   --help, -h           show help
```

#### 11. `harness pipeline run help` <a href="#id-11-harness-pipeline-run-help" id="id-11-harness-pipeline-run-help"></a>

```
NAME:
  harness pipeline run - Run a pipeline.

USAGE:
  harness pipeline run [command options] [arguments...]

OPTIONS:
  --pipeline-id value  identifier of pipeline to execute
  --inputs-file value  path to YAML file containing pipeline inputs
  --org-id value       provide an Organization Identifier
  --project-id value   provide a Project Identifier
  --help, -h           show help
```

### Files <a href="#files" id="files"></a>

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

### Author <a href="#author" id="author"></a>

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

### License <a href="#license" id="license"></a>

Harness CLI is released under the terms of the [MIT License](https://github.com/harness/harness-cli/blob/develop/LICENSE).
