---
schema_version: "1"
id: 2e380edb0374a2183bad680467cf96203d4b172b755c9d2b50adc7612f05ba36
title: devops pipeline create
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfclireference/guides/devops/cli_reference_devops_pipeline_create.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-cli-reference/guide/cli_reference_devops_pipeline_create.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 359d977d2a3cc27913c06f65662e623e9409abfddfa3e051fc62124d3babd0a3
products:
  - Salesforce CLI Command Reference
  - salesforcedx
---
<!-- prettier-ignore-start -->

# devops pipeline create

Create a DevOps Center pipeline.

## Description for devops pipeline create

Provide the URL of an existing repository, or use `--create-repo` with a repository name to create one. After you create the pipeline, add stages, and activate the pipeline.

## Flags

| Flag Name (Long) | Flag Name (Short) | Description |
|------------------|-------------------|-------------|
| <code>&#8209;&#8209;api&#8209;version</code> | N/A | **Type:** Value<br><br>Override the api version used for api requests made by this command |
| <code>&#8209;&#8209;bitbucket&#8209;project&#8209;key</code> | N/A | **Type:** Value<br><br>Bitbucket project key to associate with the repository. Optional when creating a Bitbucket repository using '--create-repo'. |
| <code>&#8209;&#8209;bitbucket&#8209;workspace</code> | N/A | **Type:** Value<br><br>Bitbucket workspace that will own the repository. Required when creating a Bitbucket repository using '--create-repo'. |
| <code>&#8209;&#8209;create&#8209;repo</code> | N/A | **Type:** Boolean<br><br>Create a repository if it doesn't exist. |
| <code>&#8209;&#8209;flags&#8209;dir</code> | N/A | **Type:** Value<br><br>Import flag values from a directory. |
| <code>&#8209;&#8209;json</code> | N/A | **Type:** Boolean<br><br>Format output as json. |
| <code>&#8209;&#8209;name</code> | <code>&#8209;n</code> | **Type:** Value<br>**Required**<br><br>Name of the pipeline. |
| <code>&#8209;&#8209;project&#8209;id</code> | N/A | **Type:** Value<br><br>ID of a project to associate with the pipeline. Repeat the flag to associate multiple projects. |
| <code>&#8209;&#8209;repo</code> | <code>&#8209;r</code> | **Type:** Value<br>**Required**<br><br>URL of an existing repository or the name of a repository to create. |
| <code>&#8209;&#8209;repo&#8209;owner</code> | N/A | **Type:** Value<br><br>Owner (organization or user) of the GitHub repository. Required when creating a GitHub repository using '--create-repo'. |
| <code>&#8209;&#8209;repo&#8209;type</code> | N/A | **Type:** Value<br>**Valid Values:** `github`, `bitbucket`<br><br>Type of the source code repository. Required when creating a repository using '--create-repo'. |
| <code>&#8209;&#8209;stage</code> | <code>&#8209;s</code> | **Type:** Value<br><br>Name of a pipeline stage, in promotion order. Repeat the flag for each stage. Defaults to Integration, UAT, Staging, and Production. |
| <code>&#8209;&#8209;target&#8209;org</code> | <code>&#8209;o</code> | **Type:** Value<br>**Required**<br><br>Username or alias of the target org. Not required if the `target-org` configuration variable is already set. |

## Examples for devops pipeline create

Create a pipeline and associate it with an existing GitHub repository:

```shell
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo https://github.com/myorg/myrepo
```

Create a pipeline and associate it with a new GitHub repository:

```shell
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo my-new-repo --repo-type github --repo-owner myorg --create-repo
```

Create a pipeline and create a new Bitbucket repository:

```shell
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo my-new-repo --repo-type bitbucket --bitbucket-workspace myworkspace --bitbucket-project-key PROJ --create-repo
```

Create a pipeline and associate it with an existing Bitbucket repository:

```shell
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo https://bitbucket.org/myworkspace/myrepo
```

Create a pipeline with custom stage names instead of the default stages:

```shell
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo https://github.com/myorg/myrepo --stage Dev --stage QA --stage Prod
```

Create a pipeline and associate one or more projects with it:

```shell
sf devops pipeline create --target-org my-devops-org --name "Release Pipeline" --repo https://github.com/myorg/myrepo --project-id 0Hn000000000001 --project-id 0Hn000000000002
```
<!-- prettier-ignore-end -->
