DevOps Center Pipeline Management
Manages the complete pipeline lifecycle in DevOps Center — from creation against a repository, through stage and environment configuration and project attachment, to activation of a ready-to-promote release pipeline. Provides headless CLI-driven operations for autonomous release workflows.
Scope
- In scope: List pipelines, get pipeline details, create a pipeline (linked to an existing or new Git repo), add/delete/rename stages, add/delete Salesforce environments on stages, attach/detach projects, and activate/deactivate/rename the pipeline
- Out of scope: Work-item lifecycle, promotion/deployment execution, conflict detection, standalone project creation (separate skills)
Required Inputs
Gather or infer before proceeding:
- Operation type: list, get, create, add-stage, delete-stage, rename-stage, add-environment, delete-environment, attach-project, detach-project, activate, or deactivate
- For get / any stage or environment op: pipeline ID (required) — obtain via
sf devops pipeline list --json - For create: pipeline name (required) and a Git repo (
--repo, required). Repo flags differ by scenario:- Existing repo (GitHub or Bitbucket): only
--repo <url>— do not pass--repo-type/--create-repo - New GitHub repo:
--repo <name> --create-repo --repo-type github --repo-owner <org-or-user> - New Bitbucket repo:
--repo <name> --create-repo --repo-type bitbucket --bitbucket-workspace <workspace>(--bitbucket-project-key <key>optional) - Description (
--description) optional in all cases
- Existing repo (GitHub or Bitbucket): only
- For add-stage: pipeline ID, new stage name, and
--next-stage-id(the stage the new one precedes) — get stage IDs viasf devops pipeline get - For add-environment: pipeline ID, stage ID, environment name, and
--org-type(Production or Sandbox) - For attach/detach-project: pipeline ID and project ID
- For activate/deactivate/rename: pipeline ID
Defaults unless specified:
- Output format:
--jsonfor headless consumption - Target org: use
--target-org <alias>if not relying on the default org
If the user gives a clear request ("create a pipeline on repo myorg/myrepo", "add a UAT stage before Production", "activate pipeline 0XB..."), proceed immediately without unnecessary questions.
Workflow
All operations use sf devops pipeline and sf devops stage CLI commands with --json output for structured consumption. Pipeline IDs and stage IDs are the primary identifiers — resolve them via list and get before mutating.
Phase 1 — Identify Operation
- Determine the operation type from user intent:
- "list", "show all pipelines" → list; "details of pipeline", "show stages" → get
- "create", "set up", "new pipeline" → create
- "add stage", "insert stage" → add-stage; "rename stage" → rename-stage; "remove/delete stage" → delete-stage
- "connect environment", "add org to stage" → add-environment; "remove environment" → delete-environment
- "attach project", "connect project" → attach-project; "detach project" → detach-project
- "activate", "turn on"; "deactivate", "turn off"; "rename pipeline" → lifecycle update
Phase 2 — Execute Operation
-
Verify org authentication before any operation:
- If no default org is set or auth has expired, instruct the user to run
sf org login web --set-default --alias <alias> - Confirm the org has DevOps Center enabled by running
sf devops pipeline list --json - Add
--target-org <alias>to every command when targeting a specific org
- If no default org is set or auth has expired, instruct the user to run
-
Inspect pipelines:
listreturns SObject records under.result.pipelines[]with capitalized fields (.Id,.Name,.IsActive) — it does not include stages or connected projectsgetreturns a single pipeline under.resultwith camelCase fields (.id,.name,.stages[],.connectedProjects[]); each stage has.id,.name,.nextStageId,.branchName, and.environment.{id,name}. Stages are a linked list — order is defined bynextStageId, and the terminal stage hasnextStageId: null. Usegetto discover stage IDs before any stage or environment operation
-
Create a pipeline — the pipeline must be linked to a Git repository.
--nameand--repoare always required; the remaining flags depend on the repo scenario:- Provider-specific required flags: GitHub new repo →
--repo-owner; Bitbucket new repo →--bitbucket-workspace. Omitting the provider's required flag fails the create - Do not pass
--repo-type/--create-repofor an existing repo — supply only the repo URL via--repo - Custom stages at create time: a new pipeline seeds the default stage chain Integration → UAT → Staging → Production. To seed different stages, repeat
-s/--stageonce per stage in promotion order — e.g.--stage Dev --stage QA --stage Prod. This avoids adding/renaming stages afterward - Add
--description "<text>"optionally in any scenario - Capture the returned pipeline ID for subsequent stage/environment/project/activation steps
- Idempotency: the CLI does not dedupe. Before creating, run
sf devops pipeline list --jsonand check for a pipeline with the same name/repo; return the existing one if found. Seereferences/parsing-patterns.mdfor the check-before-create snippet
- Provider-specific required flags: GitHub new repo →
-
Configure stages — a stage is added relative to an existing stage, then bound to an environment. Read
references/cli-commands.mdfor full flag details before multi-stage work:stage addinserts an empty stage (no branch/environment) before--next-stage-id; configure its environment separately- Build the promotion chain by inserting each new stage before the stage that should follow it
-
Bind environments to stages — attach a Salesforce org to a stage:
--org-typemust be exactlyProductionorSandbox— runscripts/validate-org-type.sh <value>first and only proceed on exit 0- Headless caveat:
stage environment addtriggers an OAuth browser flow. In headless/CI runs pass--no-browser— the CLI prints a redirect URL for manual authentication
-
Attach / detach a project — a project can be attached to only one pipeline:
- If the user names a project instead of providing its ID, resolve it via
sf devops project list --json(seereferences/parsing-patterns.md)
- If the user names a project instead of providing its ID, resolve it via
-
Activate / deactivate / rename the pipeline:
- Before
--activate, runscripts/check-activation-ready.sh <id>and only proceed on exit 0 — it fails with an actionable message when the pipeline has no stages - Stages cannot be modified after the pipeline is activated and changes are promoted through it — finish stage/environment configuration before activating
--activateand--deactivateare mutually exclusive;--deactivateand--namemay be combined in one command
- Before
Phase 3 — Verify and Report
-
Verify operation success — use
scripts/verify-operation.sh, which performs the deterministic JSON-status and post-state field checks and exits non-zero with an actionable message on mismatch:- Create: confirm the pipeline appears in
sf devops pipeline list --jsonby.Nameand capture its.Id - Stage / environment / project changes: verify with the
has-stage/has-projectmodes above (they readsf devops pipeline getand check.result.stages[]/.result.connectedProjects[]) - Activate: verify with the
active <id> truemode
- Create: confirm the pipeline appears in
-
Report results:
- List: pipeline name, ID, and active state per pipeline (no stages — that's what
getis for) - Get: pipeline name, ID, active state, stage chain (each stage's name → environment → branch, ordered via
nextStageId), connected projects - Create: pipeline ID, name, and linked repo (or "existing pipeline returned" on idempotent match)
- Stage / environment / project op: the resulting stage chain with each stage's environment, in promotion order
- Lifecycle: the new active state and/or name
- List: pipeline name, ID, and active state per pipeline (no stages — that's what
Verification Checklist (gate before reporting success)
Confirm the items for the operation you performed. Do not report success until every applicable box holds:
- Every
sf devopscommand was run with--jsonand returnedstatus: 0(scripts/verify-operation.sh status -) - Create: the new pipeline appears in
sf devops pipeline list --jsonby name, and (for a new repo) the provider-specific flags were supplied (--repo-ownerfor GitHub,--bitbucket-workspacefor Bitbucket) - Add-stage / add-environment: the stage exists in the chain and
--org-typepassedscripts/validate-org-type.sh(scripts/verify-operation.sh has-stage ...) - Attach-project: the project shows in
.result.connectedProjects[](scripts/verify-operation.sh has-project ...) - Activate:
scripts/check-activation-ready.shpassed beforehand and.result.isActiveis nowtrue(scripts/verify-operation.sh active <id> true) - Delete-environment: the pipeline was inactive before the delete
Rules / Constraints
Gotchas
Output Expectations
Deliverables vary by operation:
- List: pipelines with ID, name, and active state (no stages/projects in the list view)
- Get: a pipeline with ID, name, active state, its stage chain (each with environment and branch, ordered via
nextStageId), and connected projects - Create: pipeline ID, name, and linked repository (or the pre-existing pipeline on idempotent match)
- Stage op: the updated ordered stage chain
- Environment op: the stage with its bound environment (name, org-type)
- Project op: confirmation of attach/detach
- Lifecycle: the new active state and/or pipeline name
Outputs are derived from sf devops pipeline and sf devops stage CLI commands.
Cross-Skill Integration
If a project the user wants to attach can't be found, resolve or list existing projects with sf devops project list --json (see references/parsing-patterns.md) rather than delegating — project creation is out of scope for this skill.


