Modify and push metadata changes to the pipeline
Create a user story, set up the local work context, make metadata changes in the org, check dependencies, run local quality gates, and push the changes into the Copado pipeline.
The entire inner loop, from story creation to push, happens locally without switching to a browser. AI agents in Cursor can drive each step while you review the output.
- 1
Create the user story and note the returned ID (for example US-0042).
$ agentia cicd work create --title "Add Account Rating field to Opportunity layout" --project <your-project-id> --json - 2
Set the active work item. This calls the CICD gateway work/set endpoint, fetches the base branch from origin, and creates or checks out feature/US-0042.
$ agentia cicd work set US-0042 - 3
Make your changes in the org (custom field, page layout, flow), then refresh the metadata index and confirm the changes are detected.
$ agentia cicd metadata refresh run --env <your-dev-environment-id>$ agentia cicd metadata refresh status --job-id <event-id-from-previous-command>$ agentia cicd metadata list --source Changed --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id> - 4
Check metadata dependencies before committing, so no hidden dependency breaks the deployment.
$ agentia cicd metadata dependency list --from-changes --base-ref origin/main --retrieve-mode all --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id>Best practiceIf a dependency is missing from your change set, add it to the user story metadata selection before pushing. Missing dependencies are the most common cause of downstream deployment failures.
- 5
Run local quality gates. This executes .agentia_quality_gates.sh (macOS/Linux) or .agentia_quality_gates.cmd (Windows) from the project root, generated by agentia setup.
$ agentia cicd work test --local - 6
Stage and commit your changes locally.
$ git add force-app/main/default/objects/Account/fields/Rating__c.field-meta.xml$ git commit -m "feat: add Account Rating field to Opportunity layout [US-0042]" - 7
Push the feature branch and register the commits with Copado, then confirm the push was registered.
$ agentia cicd work push$ agentia cicd work statusBest practicework push publishes your commits to the remote branch and registers them in Copado. It does not start a promotion.
- 8
Submit for validation. This triggers a validation promotion and deployment (quality gates plus pull request).
$ agentia cicd work submit --apex-test-classes MyTriggerTest,AccountHandlerTest --skip-pull-request - 9
Once validation passes, mark the work item done to promote and deploy it into the pipeline.
$ agentia cicd work done
The story, the metadata selection, and the commits are all registered in Copado, with dependency gaps and quality gate failures caught locally before the pipeline runs.