Product Preview · AlphaCommands, flags and behavior may change without notice. Expect the occasional plot twist — and tell us about it.
    Quick guides

    How-to
    quick guides.

    Four real Copado delivery scenarios, end to end. Run them from a terminal, from VS Code, or fully autonomously in Cursor through the built-in MCP server. Every action stays traceable to a Copado user story.

    Prerequisites (all use cases)

    Complete this one-time setup before running any of the guides below.

    1. 1

      Install the CLI globally.

      $ npm install -g @copado/agentia-cli
    2. 2

      Run the guided setup wizard. It stores your CICD and Agentia Testing credentials in the OS keychain, sets up the Cursor MCP integration, creates local quality gate scripts, and generates an AGENTS.md file for your AI agents.

      $ agentia setup

      Credentials are handled by the wizard, so there is no separate authentication step. If you ever need to review or update them later, use agentia auth get and agentia auth set.

    3. 3

      Set your project defaults.

      $ agentia cicd project default set --project <your-project-id> --environment <your-dev-environment-id> --assign-me

      The repository linked to your pipeline must already exist in Copado and be cloned locally. work set, work push, and work submit operate on the Git repository in the current working directory, so always start your terminal or MCP server from the repo root.

    4. 4

      Verify environment authentication, and run the browser login if the status is not authenticated.

      $ agentia cicd environment auth status <your-dev-environment-id>
      $ agentia cicd environment auth web login <your-dev-environment-id>
    Use case A · cicd
    15 min

    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.

    Steps
    1. 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. 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. 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. 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. 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. 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. 7

      Push the feature branch and register the commits with Copado, then confirm the push was registered.

      $ agentia cicd work push
      $ agentia cicd work status

      Best practicework push publishes your commits to the remote branch and registers them in Copado. It does not start a promotion.

    8. 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. 9

      Once validation passes, mark the work item done to promote and deploy it into the pipeline.

      $ agentia cicd work done
    Result

    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.

    Use case B · cicd
    18 min

    Ship a CPQ metadata change all the way to Integration

    Add a custom field to a CPQ object, update a quote template, commit both under one user story, and deploy them to the Integration environment.

    CPQ changes often span multiple metadata types (fields, templates, price rules). The CLI lets you inspect dependencies and compare org states before deploying, reducing the risk of partial deployments.

    Steps
    1. 1

      Create the user story and note the returned ID (for example US-0087).

      $ agentia cicd work create --title "CPQ - Add Discount Tier field and update Quote Template" --project <your-project-id> --json
    2. 2

      Set the active work item. The command creates feature/US-0087-cpq-discount-tier-field from the root of the repository linked to the CPQ pipeline.

      $ agentia cicd work set US-0087
    3. 3

      Add the field (for example SBQQ__Quote__c.Discount_Tier__c), update the Quote Template in the CPQ editor, save in the org, then refresh the metadata index.

      $ agentia cicd metadata refresh run --env <your-dev-environment-id>
    4. 4

      List the changed CPQ metadata, compare the field between Dev and Integration, and check dependencies for price or product rules referencing the new field.

      $ agentia cicd metadata list --source Changed --metadata-types CustomField,SBQQQuoteTemplate --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id>
      $ agentia cicd metadata content compare --metadata-type CustomField --api-name SBQQ__Quote__c.Discount_Tier__c --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id> --target-org-id <your-integration-org-id>
      $ agentia cicd metadata dependency list --metadata-type CustomField --metadata-name SBQQ__Quote__c.Discount_Tier__c --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id>

      Best practiceCPQ metadata is highly interconnected. Price rules, product rules, and quote templates that reference a new field must be included in the same user story or deployed first.

    5. 5

      Stage and commit your changes locally.

      $ git add force-app/main/default/objects/SBQQ__Quote__c/fields/Discount_Tier__c.field-meta.xml
      $ git add force-app/main/default/quoteTemplates/
      $ git commit -m "feat(cpq): add Discount Tier field and update Quote Template [US-0087]"
    6. 6

      Submit for validation. This runs local quality gates, pushes the branch, registers commits, and triggers a validation promotion.

      $ agentia cicd work submit --apex-test-classes CPQQuoteTest
    7. 7

      Once validation passes, mark the work item done to promote and deploy to Integration, then check the story with work status. It prints the user story plus its latest jobs (commit, validate, promote and deploy) with status and error message, so you do not need separate promotion commands.

      $ agentia cicd work done
      $ agentia cicd work status

      Best practiceIf a job shows status Error, the message in the status output tells you what to fix (for example a merge conflict on the promotion, or a duplicate value on commit). Use agentia cicd job log get <job-id> only when you need the full log.

    Result

    Field, template, and dependent CPQ components move to Integration as one governed user story, with the org-to-org delta reviewed before promotion.

    Use case C · testing
    12 min

    Run a Copado Robotic Testing job, read the logs, and fix the script

    Confirm Copado Robotic Testing (CRT) readiness, find a job, download the Robot Framework script, run it, review the results and artifacts, fix a failing keyword, and push the corrected script back.

    The full test debug cycle stays in the terminal or Cursor. No browser context switching, and AI agents can read the log output and suggest fixes.

    Steps
    1. 1

      Confirm CRT readiness. CRT authentication is separate from Copado CI/CD and needs a PAK, a CRT domain, and a positive organization ID.

      $ agentia auth set --crt <pak> --crt-domain <crt-domain> --crt-org <crt-org-id>
      $ agentia auth get --crt --json

      Best practiceGate automation on ready: true, not on set. set only means a credential exists; ready means the effective PAK, domain, and organization are all usable. Fix anything listed in missing or issues before continuing.

    2. 2

      Find the CRT project and the job you need.

      $ agentia testing project list --json
      $ agentia testing job list --project <your-crt-project-id> --json
      $ agentia testing job get <your-job-id> --project <your-crt-project-id> --json
    3. 3

      List the files attached to the job and download the script to an explicit directory, then open the .robot file in VS Code or Cursor.

      $ agentia testing job files <your-job-id> --project <your-crt-project-id> --json
      $ agentia testing job download <your-job-id> --project <your-crt-project-id> --output-dir ./tests

      Best practiceFor Git-backed jobs, check the reference and credential wiring with agentia testing job refs <your-job-id> --project <your-crt-project-id> --shared-credentials --json.

    4. 4

      Run the job and wait for a terminal result, capturing artifacts and xUnit for CI. For Git-backed jobs, target the branch holding the script.

      $ agentia testing build run <your-job-id> --project <your-crt-project-id> --suite Checkout --include smoke --wait-for-result --timeout 30 --save-artifacts ./artifacts/output.zip --xunit ./artifacts/xunit.xml --json
      $ agentia testing build run <your-job-id> --project <your-crt-project-id> --branch feature/fix-login-test --record failed --wait-for-result --json

      Best practice--stream-logs and --watch are for a human terminal and cannot be combined with --json. A --datatable run cannot be combined with --wait-for-result, --stream-logs, --save-artifacts, or --xunit.

    5. 5

      Inspect the result and the logs. Use latest or search when you do not have the build ID at hand.

      $ agentia testing build latest --project <your-crt-project-id> --job <your-job-id> --json
      $ agentia testing build get <your-build-id> --project <your-crt-project-id> --job <your-job-id> --full --json
      $ agentia testing build logs <your-build-id> --project <your-crt-project-id> --job <your-job-id> --tail-lines 200 --timestamps --output ./logs/run.log --json

      Best practiceLook for FAIL lines and the associated error message to pinpoint the broken keyword. Use agentia testing build search --project <your-crt-project-id> --job <your-job-id> --status failed --page-size 20 --json to review failure history, and agentia testing build abort <your-build-id> --project <your-crt-project-id> --yes to stop a run you no longer need.

    6. 6

      Reproduce the failing step interactively when the log is not enough. Live testing lets you execute one keyword at a time against the session.

      $ agentia testing live start <your-job-id> --project <your-crt-project-id> --file login.robot --section "Login" --json
      $ agentia testing live execute <your-job-id> --project <your-crt-project-id> --keyword ClickText --arg "Sign in" --json
      $ agentia testing live screenshot <your-job-id> --project <your-crt-project-id> --output ./artifacts/step.png
      $ agentia testing live stop <your-job-id> --project <your-crt-project-id> --yes

      Best practiceagentia testing live view and the long-running agentia testing live recorder are terminal-only. Common fixes are updating a locator that changed in the UI, adjusting a wait condition or timeout, and correcting a variable reference or keyword argument.

    7. 7

      Upload the corrected script and re-run to confirm the fix. Preview the file operations first with --dry-run.

      $ agentia testing job upload <your-job-id> --project <your-crt-project-id> --replace ./tests/login.robot:login.robot --message "Fix login locator" --dry-run --json
      $ agentia testing job upload <your-job-id> --project <your-crt-project-id> --replace ./tests/login.robot:login.robot --message "Fix login locator" --json
      $ agentia testing build run <your-job-id> --project <your-crt-project-id> --rerun-failed-from-latest --wait-for-result --json

      Best practiceFor Git-backed CRT jobs, commit the fixed .robot file to the feature branch and point the job at that branch instead of uploading directly: agentia testing job update <your-job-id> --project <your-crt-project-id> --git-branch feature/fix-login-test. Keep secrets out of arguments — use agentia testing variable create … --value-stdin for sensitive values. To run this suite on a cadence, add agentia testing job schedule set <your-job-id> --project <your-crt-project-id> --cron "0 6 * * 1-5" --timezone UTC --record failed --json.

    Result

    A green robot run, with the corrected script version-controlled next to the metadata it tests, without opening the CRT UI.

    Use case D · ai
    20 min

    Ask the Build Agent to investigate a failing trigger, fix it, and commit

    Instead of manually reading logs and editing code, ask the Agentia Build Agent, via Cursor or the CLI MCP server, to investigate the root cause of a failing Apex trigger, apply a fix, and commit the corrected class.

    The flagship local AI flow. The Build Agent reads live job logs, retrieves the source from the org, reasons about the failure, proposes a fix, and commits it, all without leaving the editor. Humans review before anything is pushed.

    Steps
    1. 1

      Start the MCP server from the repository root. It exposes 50+ Agentia tools to your AI client; in Cursor, reload MCP servers after the first setup so the tools appear.

      $ agentia mcp start

      Best practiceThe MCP server must be started from the root of the repository linked to your Copado pipeline. work set, work push, and related tools operate on the Git repo in the server's working directory.

    2. 2

      Find the failing job, get the step breakdown, and retrieve the execution log. In Cursor, ask the Build Agent: "Use agentia_job_list to find my latest failed job, then get the log and tell me why the trigger is failing."

      $ agentia cicd job list --status "Error" --mine --json
      $ agentia cicd job get <failing-job-id> --json
      $ agentia cicd job log get <failing-job-id> --json
    3. 3

      Retrieve the trigger and its handler class from the org. In Cursor, the agent does this with agentia_metadata_content_get.

      $ agentia cicd metadata content get --metadata-type ApexTrigger --api-name AccountTrigger --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id> --output-file ./force-app/main/default/triggers/AccountTrigger.trigger --show
      $ agentia cicd metadata content get --metadata-type ApexClass --api-name AccountTriggerHandler --pipeline-id <your-pipeline-id> --source-org-id <your-dev-org-id> --source-credential-id <your-credential-id> --output-file ./force-app/main/default/classes/AccountTriggerHandler.cls --show
    4. 4

      With the log and source in context, prompt the Build Agent: "The job log shows a System.NullPointerException on line 42 of AccountTriggerHandler. The trigger fires on before update. Analyze the handler, identify the null reference, and propose a fix that follows the bulkification pattern and uses with sharing." Review the proposed change in the editor diff view.

      $ agentia ai agent ask --agent build -p "Diagnose the AccountTriggerHandler failure and propose a fix"

      Best practiceAlways review AI-generated Apex before committing. Check that the fix handles bulk scenarios (no SOQL or DML in loops), preserves the with sharing declaration, includes a null guard for the identified field, and does not introduce recursion.

    5. 5

      Create or set the work item, then stage and commit the fixed files.

      $ agentia cicd work create --title "Fix NullPointerException in AccountTriggerHandler" --project <your-project-id> --json
      $ agentia cicd work set US-0099
      $ git add force-app/main/default/triggers/AccountTrigger.trigger
      $ git add force-app/main/default/classes/AccountTriggerHandler.cls
      $ git commit -m "fix(trigger): add null guard in AccountTriggerHandler before update [US-0099]"
    6. 6

      Run local quality gates, push, and submit for validation. work submit only validates and runs the quality gates, it does not deploy.

      $ agentia cicd work test --local
      $ agentia cicd work push
      $ agentia cicd work submit --apex-test-classes AccountTriggerTest

      Best practiceDo not skip validation for trigger fixes; a null pointer in a trigger can cascade across bulk operations.

    7. 7

      Once validation passes, mark the work item done to promote and deploy the fix, then confirm with work status, which lists the story and its latest jobs with status and error message.

      $ agentia cicd work done
      $ agentia cicd work status
    Result

    A reviewed, committed, and validated trigger fix produced from live job logs and org source, with the full audit trail registered against the user story.

    Use case E · general
    12 min

    Give your IDE agent the Agentia operating playbook

    Combine the CLI, Agent Skills, and the local MCP server so a coding agent inspects before it changes anything, keeps local and cloud paths separate, and stops for approval before destructive actions.

    An active Copado license and a local clone of the repository linked to your pipeline. Creating skills never changes Copado data.

    Steps
    1. 1

      Install the CLI beta.

      $ npm install -g @copado/agentia-cli@beta --registry https://registry.npmjs.org
    2. 2

      Authenticate and verify with placeholders.

      $ agentia setup
      $ agentia auth get --json

      Best practiceagentia auth stores CLI/API credentials; agentia cicd credential manages Copado environment credential records. Robotic Testing and AI have their own authentication contexts.

    3. 3

      Create the skill packs you need. With no pack selector, all three packs (CICD, Testing, AI) are created.

      $ agentia setup skills create --target agents
      $ agentia setup skills create --cicd --target cursor --no-prompt
      $ agentia setup skills create --testing --ai --target agents --no-prompt

      Best practice--target agents writes .agents/skills and is the portable default for headless runs; cursor writes .cursor/skills and claude writes .claude/skills. --target is repeatable when a project intentionally keeps more than one host-specific copy.

    4. 4

      Configure MCP so the agent also has native Agentia tools.

      $ agentia mcp start
      $ # Cursor: { "mcpServers": { "agentia": { "command": "agentia", "args": ["mcp", "start"] } } }

      Best practiceMCP gives the agent tools. Agentia Skills give it the operating playbook. Install both when the agent should execute Agentia workflows safely from the IDE.

    5. 5

      Ask the agent to inspect before mutating: "Use the Agentia CICD skill to inspect my assigned Story and explain the local delivery flow. Do not promote anything."

      $ agentia cicd work list --assigned-to-me --json
      $ agentia cicd work get <story-id-or-name> --json
    6. 6

      Demonstrate one CI/CD read, one Robotic Testing read, and one AI ask.

      $ agentia cicd data template list --active --json
      $ agentia testing project list --json
      $ agentia ai agent ask -p "Summarize Copado guidance for promotions" --json
    7. 7

      Refresh the skills after you upgrade the CLI.

      $ agentia setup skills update --target agents --no-prompt --json

      Best practiceupdate refreshes Agentia-managed files and restores missing managed files. A file without the Agentia managed marker is never overwritten; --force replaces a conflicting unmanaged file and should be used deliberately as recovery only.

    Result

    Your IDE agent loads the correct Agentia playbook, inspects before mutating, keeps local and cloud delivery paths separate, and asks for approval before any promote or deploy.