Loading...
Loading...
Use this skill to manage the full lifecycle of a DevOps Center pipeline — list all pipelines, get a single pipeline's details, create a new pipeline linked to a Git repository, add or remove stages, rename a stage, add or remove Salesforce environments on stages, attach or detach projects, and activate or deactivate the pipeline. Invoke when the user wants to set up a release pipeline, wire promotion stages across integration, UAT, staging, and production orgs, connect environments to stages, attach a project, or activate a continuous delivery pipeline. Uses sf devops pipeline and sf devops stage commands with --json output. DO NOT TRIGGER for work-item lifecycle, promotion or deployment execution, conflict detection, or standalone project creation (separate skills).
npx skill4agent add forcedotcom/sf-skills dx-devops-pipeline-managesf devops pipeline list --json--repo--repo <url>--repo-type--create-repo--repo <name> --create-repo --repo-type github --repo-owner <org-or-user>--repo <name> --create-repo --repo-type bitbucket --bitbucket-workspace <workspace>--bitbucket-project-key <key>--description--next-stage-idsf devops pipeline get--org-type--json--target-org <alias>sf devops pipelinesf devops stage--jsonlistgetsf org display --jsonsf org login web --set-default --alias <alias>sf devops pipeline list --json--target-org <alias>sf devops pipeline list --json # all pipelines in the org
sf devops pipeline get --pipeline-id <pipeline-id> --json # one pipeline, with stages/repos/projectslist.result.pipelines[].Id.Name.IsActiveget.result.id.name.stages[].connectedProjects[].id.name.nextStageId.branchName.environment.{id,name}nextStageIdnextStageId: nullget--name--repo# Existing repo (GitHub or Bitbucket) — pass the full repo URL, nothing else
sf devops pipeline create --name "<pipeline-name>" --repo <repo-url> --json
# New GitHub repo — requires --repo-owner
sf devops pipeline create --name "<pipeline-name>" --repo <repo-name> \
--create-repo --repo-type github --repo-owner <org-or-user> --json
# New Bitbucket repo — requires --bitbucket-workspace (--bitbucket-project-key optional)
sf devops pipeline create --name "<pipeline-name>" --repo <repo-name> \
--create-repo --repo-type bitbucket --bitbucket-workspace <workspace> \
--bitbucket-project-key <key> --json
# Custom stage chain (any scenario) — repeat --stage in promotion order
sf devops pipeline create --name "<pipeline-name>" --repo <repo-url> \
--stage Dev --stage QA --stage Prod --json--repo-owner--bitbucket-workspace--repo-type--create-repo--repo-s/--stage--stage Dev --stage QA --stage Prod--description "<text>"sf devops pipeline list --jsonreferences/parsing-patterns.mdreferences/cli-commands.md# Insert an empty stage BEFORE an existing stage (get the next-stage-id from `pipeline get`)
sf devops pipeline stage add --pipeline-id <id> --name "<stage-name>" --next-stage-id <stage-id> --json
# Rename a stage
sf devops pipeline stage update --pipeline-id <id> --stage-id <stage-id> --name "<new-name>" --json
# Delete a stage (predecessor auto-relinks to successor)
sf devops pipeline stage delete --pipeline-id <id> --stage-id <stage-id> --jsonstage add--next-stage-id# Validate the org-type against the fixed enum BEFORE calling the CLI
bash scripts/validate-org-type.sh "<Production|Sandbox>" # exits non-zero on an invalid value
sf devops stage environment add --pipeline-id <id> --stage-id <stage-id> \
--environment-name "<env-name>" --org-type <Production|Sandbox> --json
# Remove an environment (pipeline must be inactive)
sf devops stage environment delete --pipeline-id <id> --environment-id <env-id> --json--org-typeProductionSandboxscripts/validate-org-type.sh <value>stage environment add--no-browsersf devops pipeline project add --pipeline-id <id> --project-id <project-id> --json
sf devops pipeline project delete --pipeline-id <id> --project-id <project-id> --jsonsf devops project list --jsonreferences/parsing-patterns.md# Before activating, confirm the deterministic ≥1-stage prerequisite
bash scripts/check-activation-ready.sh <id> [target-org] # exits non-zero if stage-less
sf devops pipeline update --pipeline-id <id> --activate --json # activate
sf devops pipeline update --pipeline-id <id> --deactivate --json # deactivate
sf devops pipeline update --pipeline-id <id> --name "<new-name>" --json # rename--activatescripts/check-activation-ready.sh <id>--activate--deactivate--deactivate--namescripts/verify-operation.sh# Assert a captured command's JSON status is 0 (pipe the CLI output in)
sf devops pipeline update --pipeline-id <id> --activate --json | bash scripts/verify-operation.sh status -
# Assert post-state after activate / stage / project ops
bash scripts/verify-operation.sh active <id> true [target-org] # isActive == true
bash scripts/verify-operation.sh has-stage <id> "<stage>" [target-org] # stage present in chain
bash scripts/verify-operation.sh has-project <id> "<project>" [target-org] # project connectedsf devops pipeline list --json.Name.Idhas-stagehas-projectsf devops pipeline get.result.stages[].result.connectedProjects[]active <id> truegetnextStageIdsf devops--jsonstatus: 0scripts/verify-operation.sh status -sf devops pipeline list --json--repo-owner--bitbucket-workspace--org-typescripts/validate-org-type.shscripts/verify-operation.sh has-stage ....result.connectedProjects[]scripts/verify-operation.sh has-project ...scripts/check-activation-ready.sh.result.isActivetruescripts/verify-operation.sh active <id> true| Constraint | Rationale |
|---|---|
All sf devops commands must use | Structured output is required for headless consumption; human-readable output is unreliable for parsing |
| A pipeline requires a Git repo at create time | |
| New-repo create needs provider-specific flags | GitHub requires |
| Pipeline ID required for get, update, and all stage/environment/project ops | These commands identify the pipeline only by |
Stage IDs come from | |
| Stages carry no environment until one is added; build the chain by anchoring to the following stage |
| The flag is a fixed enum; other values fail |
| Pipeline must have ≥1 stage before activation | |
| Do not modify stages after activate + promote | DevOps Center locks stage structure once changes have been promoted through an active pipeline |
| Environment delete requires an inactive pipeline | |
| A project attaches to only one pipeline | |
| Idempotent create via check-before-create | The CLI does not dedupe; list existing pipelines and return the match instead of erroring |
Prefer | |
| Issue | Resolution |
|---|---|
| No default org set | Run |
| Create fails — missing repo | |
| New-repo create fails — missing provider flag | GitHub new repo needs |
| |
| Environment add hangs in CI | The OAuth browser flow blocks headless runs; add |
| Activation rejected | The pipeline needs at least one stage; add a stage (and its environment) before |
| Cannot modify stages | The pipeline is active and has promoted changes; stage structure is locked — configuration must complete before activation |
| Environment delete fails | The pipeline is active; deactivate with |
| Project already attached | A project attaches to only one pipeline; detach from the other pipeline first via |
| Pipeline / stage / project not found | The ID is invalid; run |
nextStageIdsf devops pipelinesf devops stage| Delegate to | When |
|---|---|
| The user wants to create or advance work items once the pipeline is active |
sf devops project list --jsonreferences/parsing-patterns.md| File | When to read |
|---|---|
| When you need detailed CLI flag documentation and JSON output schemas for each |
| When you need jq snippets to parse the JSON (stage chains, pipeline/project ID resolution), error-handling reference, the check-before-create idempotent pattern, or auth requirements |
| When the user's request matches a common pattern (end-to-end pipeline setup, inserting a stage, binding an environment, attaching a project, activation) |
| Run before |
| Run before |
| Run in Phase 3 to assert a command's JSON status and post-state fields ( |