@copado/agentia-cli 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +2370 -1850
- package/dist/commands/ai/agent/ask.js +4 -4
- package/dist/commands/ai/agent/chat.js +4 -4
- package/dist/commands/cicd/credential/auth/status.js +38 -0
- package/dist/commands/cicd/credential/auth/web/login.js +54 -0
- package/dist/commands/cicd/credential/list.js +13 -17
- package/dist/commands/cicd/credential/open.js +30 -0
- package/dist/commands/cicd/credential/update.js +9 -12
- package/dist/commands/cicd/environment/auth/status.js +34 -13
- package/dist/commands/cicd/environment/auth/web/login.js +20 -4
- package/dist/commands/cicd/environment/open.js +6 -22
- package/dist/commands/cicd/extension-configuration/get.js +24 -0
- package/dist/commands/cicd/extension-configuration/list.js +49 -0
- package/dist/commands/cicd/extension-configuration/open.js +38 -0
- package/dist/commands/cicd/metadata/content/get.js +1 -1
- package/dist/commands/cicd/metadata/dependency/list.js +2 -2
- package/dist/commands/cicd/metadata/explore.js +81 -0
- package/dist/commands/cicd/metadata/list.js +3 -3
- package/dist/commands/cicd/metadata/refresh/deleted.js +1 -1
- package/dist/commands/cicd/metadata/refresh/run.js +2 -2
- package/dist/commands/cicd/metadata/refresh/status.js +2 -2
- package/dist/commands/cicd/pipeline/automation/activate.js +39 -0
- package/dist/commands/cicd/pipeline/automation/create.js +33 -0
- package/dist/commands/cicd/pipeline/automation/deactivate.js +39 -0
- package/dist/commands/cicd/pipeline/automation/delete.js +45 -0
- package/dist/commands/cicd/pipeline/automation/get.js +32 -0
- package/dist/commands/cicd/pipeline/automation/list.js +38 -0
- package/dist/commands/cicd/pipeline/automation/open.js +38 -0
- package/dist/commands/cicd/pipeline/automation/update.js +38 -0
- package/dist/commands/cicd/pipeline/quality-gate/activate.js +39 -0
- package/dist/commands/cicd/pipeline/quality-gate/create.js +34 -0
- package/dist/commands/cicd/pipeline/quality-gate/deactivate.js +39 -0
- package/dist/commands/cicd/pipeline/quality-gate/delete.js +45 -0
- package/dist/commands/cicd/pipeline/quality-gate/get.js +32 -0
- package/dist/commands/cicd/pipeline/quality-gate/list.js +34 -0
- package/dist/commands/cicd/pipeline/quality-gate/open.js +38 -0
- package/dist/commands/cicd/pipeline/quality-gate/update.js +38 -0
- package/dist/commands/cicd/work/create.js +1 -0
- package/dist/commands/cicd/work/environment-sync.js +8 -7
- package/dist/commands/cicd/work/set.js +6 -4
- package/dist/commands/cicd/work/submit.js +3 -2
- package/dist/commands/cicd/work/update.js +1 -0
- package/dist/commands/plugins/install.js +2 -5
- package/dist/commands/setup/skills/create.js +28 -2
- package/dist/commands/setup/skills/list.js +55 -0
- package/dist/commands/setup/skills/update.js +36 -3
- package/dist/commands/setup.js +3 -3
- package/dist/commands/testing/data-table/create.js +1 -2
- package/dist/commands/testing/data-table/delete.js +1 -2
- package/dist/commands/testing/data-table/export.js +2 -6
- package/dist/commands/testing/data-table/get.js +2 -4
- package/dist/commands/testing/data-table/list.js +1 -2
- package/dist/commands/testing/data-table/update.js +3 -4
- package/dist/commands/testing/job/create.js +26 -22
- package/dist/commands/testing/job/delete.js +2 -2
- package/dist/commands/testing/job/files/download.js +73 -0
- package/dist/commands/testing/job/files/list.js +43 -0
- package/dist/commands/testing/job/{upload.js → files/upload.js} +13 -9
- package/dist/commands/testing/job/get.js +2 -2
- package/dist/commands/testing/job/list.js +1 -1
- package/dist/commands/testing/job/refs.js +4 -4
- package/dist/commands/testing/job/run.js +134 -1
- package/dist/commands/testing/{build → job/runs}/abort.js +10 -8
- package/dist/commands/testing/job/runs/get.js +42 -0
- package/dist/commands/testing/{build → job/runs}/list.js +19 -10
- package/dist/commands/testing/{logs.js → job/runs/logs.js} +9 -6
- package/dist/commands/testing/{build → job/runs}/search.js +9 -7
- package/dist/commands/testing/job/schedule/get.js +5 -11
- package/dist/commands/testing/job/schedule/remove.js +3 -3
- package/dist/commands/testing/job/schedule/set.js +3 -3
- package/dist/commands/testing/job/update.js +22 -65
- package/dist/commands/testing/live/continue.js +5 -10
- package/dist/commands/testing/live/execute.js +3 -3
- package/dist/commands/testing/live/history.js +7 -2
- package/dist/commands/testing/live/inspect.js +5 -4
- package/dist/commands/testing/live/interrupt.js +5 -10
- package/dist/commands/testing/live/recorder.js +23 -115
- package/dist/commands/testing/live/reports.js +3 -3
- package/dist/commands/testing/live/screenshot.js +3 -3
- package/dist/commands/testing/live/set-options.js +11 -4
- package/dist/commands/testing/live/start.js +9 -4
- package/dist/commands/testing/live/status.js +2 -5
- package/dist/commands/testing/live/stop.js +3 -5
- package/dist/commands/testing/live/view.js +2 -2
- package/dist/commands/testing/project/create.js +1 -17
- package/dist/commands/testing/project/get.js +0 -1
- package/dist/commands/testing/project/list.js +2 -2
- package/dist/commands/testing/project/permission/set.js +3 -7
- package/dist/commands/testing/project/permission/update.js +2 -2
- package/dist/commands/testing/robot/create.js +22 -25
- package/dist/commands/testing/robot/get.js +1 -1
- package/dist/commands/testing/robot/list.js +3 -3
- package/dist/commands/testing/robot/update.js +3 -3
- package/dist/commands/testing/user-parameter/create.js +3 -9
- package/dist/commands/testing/user-parameter/update.js +1 -7
- package/dist/commands/testing/variable/create.js +4 -9
- package/dist/commands/testing/variable/list.js +3 -3
- package/dist/commands/testing/variable/update.js +5 -12
- package/dist/help.js +17 -0
- package/dist/lib/ai-types.js +2 -1
- package/dist/lib/claude-mcp-config.js +15 -0
- package/dist/lib/credential-sync.js +1 -2
- package/dist/lib/defaults-store.js +4 -1
- package/dist/lib/environment-auth-status.js +2 -1
- package/dist/lib/environment-auth.js +2 -1
- package/dist/lib/environment-credential-flags.js +3 -1
- package/dist/lib/environment-credential-operations.js +8 -2
- package/dist/lib/environment-types.js +3 -1
- package/dist/lib/extension-configuration-ops.js +4 -0
- package/dist/lib/extension-configuration-sanitize.js +7 -0
- package/dist/lib/extension-configuration-types.js +8 -0
- package/dist/lib/http-proxy.js +13 -0
- package/dist/lib/mcp/ai-tools.js +3 -3
- package/dist/lib/mcp/command-id.js +2 -0
- package/dist/lib/mcp/pipeline-automation-quality-tools.js +452 -0
- package/dist/lib/mcp/server.js +70 -1
- package/dist/lib/mcp/testing-live-tools.js +24 -13
- package/dist/lib/mcp/testing-tools.js +239 -550
- package/dist/lib/mcp/tool-annotations.js +27 -18
- package/dist/lib/mcp/tools.js +117 -32
- package/dist/lib/mcp/work-tools.js +18 -4
- package/dist/lib/metadata-explore.js +8 -0
- package/dist/lib/network-error.js +8 -0
- package/dist/lib/pipeline-automation-flags.js +12 -0
- package/dist/lib/pipeline-automation-ops.js +9 -0
- package/dist/lib/pipeline-automation-types.js +18 -0
- package/dist/lib/pipeline-lifecycle-id.js +3 -0
- package/dist/lib/pipeline-quality-gate-flags.js +12 -0
- package/dist/lib/pipeline-quality-gate-ops.js +9 -0
- package/dist/lib/pipeline-quality-gate-types.js +17 -0
- package/dist/lib/plugin-host/ai.js +2 -1
- package/dist/lib/plugin-skills.js +22 -0
- package/dist/lib/plugin-trust/gate.js +1 -2
- package/dist/lib/project-root.js +3 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/salesforce-tooling-check.js +6 -0
- package/dist/lib/skill-packs.js +7 -0
- package/dist/lib/testing-archive.js +9 -0
- package/dist/lib/testing-data-table.js +39 -0
- package/dist/lib/testing-execution.js +22 -0
- package/dist/lib/testing-flags.js +6 -2
- package/dist/lib/testing-gateway.js +4 -1
- package/dist/lib/testing-live-command.js +3 -1
- package/dist/lib/testing-live-operations.js +7 -1
- package/dist/lib/testing-live-recorder.js +3 -1
- package/dist/lib/testing-live-state.js +8 -1
- package/dist/lib/testing-operations.js +6 -21
- package/dist/lib/testing-sanitization.js +2 -1
- package/dist/lib/testing-secret-input.js +2 -1
- package/dist/lib/testing-types.js +24 -3
- package/dist/lib/work-environment-sync.js +3 -1
- package/dist/lib/work-flags.js +6 -1
- package/dist/lib/work-local-development-flow.js +4 -0
- package/dist/lib/work-submit-wait.js +3 -1
- package/oclif.manifest.json +6609 -6895
- package/package.json +35 -2
- package/templates/skills/agentia-ai/SKILL.md +3 -4
- package/templates/skills/agentia-ai/references/ai-agents.md +2 -2
- package/templates/skills/agentia-cicd/SKILL.md +7 -4
- package/templates/skills/agentia-cicd/references/environments-and-credentials.md +19 -13
- package/templates/skills/agentia-cicd/references/extensions.md +3 -0
- package/templates/skills/agentia-cicd/references/pipelines.md +36 -2
- package/templates/skills/agentia-cicd/references/work.md +20 -5
- package/templates/skills/agentia-metadata/SKILL.md +140 -0
- package/templates/skills/agentia-metadata/references/metadata-explore.md +142 -0
- package/templates/skills/agentia-testing/SKILL.md +3 -3
- package/templates/skills/agentia-testing/references/tests.md +14 -14
- package/dist/commands/testing/build/get.js +0 -38
- package/dist/commands/testing/build/latest.js +0 -40
- package/dist/commands/testing/build/logs.js +0 -47
- package/dist/commands/testing/build/run.js +0 -26
- package/dist/commands/testing/create.js +0 -2
- package/dist/commands/testing/job/download.js +0 -54
- package/dist/commands/testing/job/files.js +0 -34
- package/dist/commands/testing/run.js +0 -26
- package/dist/commands/testing/status.js +0 -45
- package/dist/commands/testing/test/create.js +0 -2
- package/dist/commands/testing/test/logs.js +0 -2
- package/dist/commands/testing/test/run.js +0 -26
- package/dist/commands/testing/test/status.js +0 -2
- package/dist/commands/testing/test/update.js +0 -2
- package/dist/commands/testing/update.js +0 -65
- package/dist/lib/testing-data-command.js +0 -8
- package/dist/lib/testing-data-core.js +0 -20
- package/dist/lib/testing-data-export.js +0 -6
- package/dist/lib/testing-data-import.js +0 -6
- package/dist/lib/testing-data-io.js +0 -12
- package/dist/lib/testing-data-operations.js +0 -10
- package/dist/lib/testing-data-types.js +0 -4
- package/dist/lib/testing-live-endpoints.js +0 -6
- package/dist/lib/testing-live-history.js +0 -7
- package/dist/lib/testing-run-command.js +0 -3
- package/dist/lib/testing-schedule.js +0 -5
- package/dist/lib/testing-session.js +0 -5
- package/dist/lib/testing-watch.js +0 -4
package/package.json
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"@oclif/plugin-plugins": "^5",
|
|
13
13
|
"@xmldom/xmldom": "^0.9.12",
|
|
14
14
|
"exceljs": "^4.4.0",
|
|
15
|
+
"proxy-agent": "^8.0.2",
|
|
16
|
+
"proxy-from-env": "^2.1.0",
|
|
15
17
|
"semver": "^7.8.5",
|
|
16
18
|
"tty-table": "^7.0.1",
|
|
17
19
|
"uuid": "^14.0.1",
|
|
@@ -59,6 +61,7 @@
|
|
|
59
61
|
"bin": "agentia",
|
|
60
62
|
"dirname": "agentia-cli",
|
|
61
63
|
"commands": "./dist/commands",
|
|
64
|
+
"helpClass": "./dist/help.js",
|
|
62
65
|
"hooks": {
|
|
63
66
|
"finally": [
|
|
64
67
|
"./dist/hooks/finally/ide-command-event"
|
|
@@ -227,15 +230,45 @@
|
|
|
227
230
|
"description": "Create and update Agentia Agent Skills"
|
|
228
231
|
},
|
|
229
232
|
"testing": {
|
|
230
|
-
"description": "Manage Copado Robotic Testing projects,
|
|
233
|
+
"description": "Manage Copado Robotic Testing projects, jobs, runs, logs, and variables"
|
|
234
|
+
},
|
|
235
|
+
"testing:data-table": {
|
|
236
|
+
"description": "Manage Copado Robotic Testing data tables"
|
|
237
|
+
},
|
|
238
|
+
"testing:job": {
|
|
239
|
+
"description": "Manage Copado Robotic Testing jobs and their runs"
|
|
240
|
+
},
|
|
241
|
+
"testing:job:files": {
|
|
242
|
+
"description": "Manage files stored in a Copado Robotic Testing job"
|
|
243
|
+
},
|
|
244
|
+
"testing:job:runs": {
|
|
245
|
+
"description": "Inspect and control Copado Robotic Testing job runs"
|
|
246
|
+
},
|
|
247
|
+
"testing:job:schedule": {
|
|
248
|
+
"description": "Manage the schedule for a Copado Robotic Testing job"
|
|
231
249
|
},
|
|
232
250
|
"testing:live": {
|
|
233
251
|
"description": "Manage Copado Robotic Testing live sessions"
|
|
252
|
+
},
|
|
253
|
+
"testing:project": {
|
|
254
|
+
"description": "Manage Copado Robotic Testing projects"
|
|
255
|
+
},
|
|
256
|
+
"testing:project:permission": {
|
|
257
|
+
"description": "Manage Copado Robotic Testing project permissions"
|
|
258
|
+
},
|
|
259
|
+
"testing:robot": {
|
|
260
|
+
"description": "Manage Copado Robotic Testing robots"
|
|
261
|
+
},
|
|
262
|
+
"testing:user-parameter": {
|
|
263
|
+
"description": "Manage account-scoped Copado Robotic Testing user parameters"
|
|
264
|
+
},
|
|
265
|
+
"testing:variable": {
|
|
266
|
+
"description": "Manage Copado Robotic Testing variables and secrets"
|
|
234
267
|
}
|
|
235
268
|
}
|
|
236
269
|
},
|
|
237
270
|
"type": "module",
|
|
238
|
-
"version": "1.
|
|
271
|
+
"version": "1.2.0",
|
|
239
272
|
"x-agentia-protected-build": true,
|
|
240
273
|
"x-agentia-protected-files": [
|
|
241
274
|
"dist/lib/runtime.js"
|
|
@@ -14,10 +14,9 @@ Prefer the `agentia_ai_ask` MCP tool when it is available for single-turn prompt
|
|
|
14
14
|
## Start Here
|
|
15
15
|
|
|
16
16
|
1. Confirm AI auth with `agentia auth get --ai --json`. Configure missing credentials with `agentia auth set --ai ...` or the supported `AGENTIA_AI_*` environment variables.
|
|
17
|
-
2.
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5. Use `--json` for automation. Use `--no-stream` when the caller needs a buffered response.
|
|
17
|
+
2. Omit `--agent` by default: `ask` and `chat` use `orchestrate`, which routes work to the right specialist. Pass `--agent plan`, `build`, `test`, `release`, `operate`, or `knowledge` only to target a specialist explicitly.
|
|
18
|
+
3. Add useful context flags when available: `--workspace`, `--dialogue`, `--user-story`, `--sf-org`, and `--component`.
|
|
19
|
+
4. Use `--json` for automation. Use `--no-stream` when the caller needs a buffered response.
|
|
21
20
|
|
|
22
21
|
## Reference
|
|
23
22
|
|
|
@@ -25,9 +25,9 @@ Operational options include `--workspace` and `--timeout`; authentication is res
|
|
|
25
25
|
| `release` | Release, promotion, packaging, and deployment questions. |
|
|
26
26
|
| `operate` | Operational diagnostics, monitoring, and runbook style questions. |
|
|
27
27
|
| `knowledge` | Copado AI Knowledge grounding, product documentation, personas, and troubleshooting. |
|
|
28
|
-
| `orchestrate` |
|
|
28
|
+
| `orchestrate` | Default. Routes the request to the right specialist automatically. |
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
`--agent` is optional and defaults to `orchestrate` for `ask`, `chat`, and the `agentia_ai_ask` MCP tool. Pass a specialist only to target it explicitly. `ask` requires a prompt with `-p` or `--prompt`; `chat` is TTY-only and prompts interactively.
|
|
31
31
|
|
|
32
32
|
## Single-Turn Ask
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentia-cicd
|
|
3
|
-
description: Use this skill when managing Copado CICD work with the Agentia CLI or Agentia MCP tools
|
|
3
|
+
description: Use this skill when managing Copado CICD work with the Agentia CLI or Agentia MCP tools, including user stories (including current/active story context), cloud commit/promote, work publish/submit/done, promotion runs and conflicts, job executions, Copado Functions, Job Templates, git-hosted CICD extensions, environments, credentials, pipelines, stages, Slack pipeline notification subscriptions, and release data templates. Use it whenever the user asks an agent to operate Copado CICD from a terminal, IDE, or headless workflow.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- Agentia managed skill file: agentia setup skills -->
|
|
@@ -27,13 +27,16 @@ Prefer Agentia MCP tools when they are available and match the task. Use CLI exa
|
|
|
27
27
|
- Git-hosted Copado CICD extensions (`cicd extension`, experimental): [references/extensions.md](references/extensions.md)
|
|
28
28
|
- Copado Job Templates (`cicd template`, not data templates): [references/templates.md](references/templates.md)
|
|
29
29
|
- Copado environments, environment credentials, and browser authentication: [references/environments-and-credentials.md](references/environments-and-credentials.md)
|
|
30
|
-
- Pipelines, environment connections, stages, and stage connections: [references/pipelines.md](references/pipelines.md)
|
|
30
|
+
- Pipelines, automations, quality gates, extension configurations, environment connections, stages, and stage connections: [references/pipelines.md](references/pipelines.md)
|
|
31
31
|
- Slack notification subscriptions on a pipeline (`agentia_notification_configure` / CLI): [references/notifications.md](references/notifications.md)
|
|
32
32
|
- Release data templates, records, matching, sync, dataset files, and data commits: [references/data.md](references/data.md)
|
|
33
33
|
|
|
34
|
+
For **Org Intelligence** (read Salesforce metadata against a sandbox/developer org credential; prefer local files first, then the org; metadata only—not data, not edits), use the separate skill `agentia-metadata/SKILL.md` (`cicd metadata explore` / MCP `agentia_metadata_explore`).
|
|
35
|
+
|
|
34
36
|
## General Rules
|
|
35
37
|
|
|
36
|
-
- When the user means the **current story**, **current user story**, **active story**, **story context**, or similar without giving an ID, resolve context first with `agentia cicd work get --json` (no positional story ID). Use the returned user story (`result`) for follow-up work—any fields the task needs (for example `id`, `name`, `title`, `status`, specs, pipeline or environment IDs), not only identifiers. If the command fails (for example no active work item from `work set`), report the CLI error to the user and stop; do not guess, list stories, or pick a substitute unless the user asks you to.
|
|
38
|
+
- When the user means the **current story**, **current user story**, **active story**, **story context**, or similar without giving an ID, resolve context first with `agentia cicd work get --json` (no positional story ID). Use the returned user story (`result`) for follow-up work—any fields the task needs (for example `id`, `name`, `title`, `status`, specs, pipeline or environment IDs, subscriber `customFields`), not only identifiers. If the command fails (for example no active work item from `work set`), report the CLI error to the user and stop; do not guess, list stories, or pick a substitute unless the user asks you to.
|
|
39
|
+
- User Story subscriber custom fields: read `result.customFields` from `work get` / MCP `agentia_work_get`. Write with CLI `--custom-field ApiName=value` (repeatable) or MCP `customFields: [{ apiName, value }]` on create/update. See [references/work.md](references/work.md#subscriber-custom-fields).
|
|
37
40
|
- Use Salesforce record IDs or generated names read from Copado. Do not invent story names, promotion IDs, job IDs, credential IDs, or pipeline IDs.
|
|
38
41
|
- Keep human output off stdout in JSON workflows. Prefer `--json`, then parse the result object.
|
|
39
42
|
- For local project work, keep the tracked working tree clean before commands that require it: `work set`, `work publish`, and `work submit`. If `work set` returns `status: "warning"`, show the message and do not assume a feature branch was created; branch keys are cleared and the work item id/name/title are still recorded in config.user.json.
|
|
@@ -41,7 +44,7 @@ Prefer Agentia MCP tools when they are available and match the task. Use CLI exa
|
|
|
41
44
|
- Treat `cicd function` as Copado Function definitions and runs. It is different from JobExecution (`cicd job`) and Job Templates (`cicd template`).
|
|
42
45
|
- Treat `cicd extension` as experimental git-hosted packaging of Functions/Templates (plus optional `force-app`). It is different from per-asset `cicd function` / `cicd template` upserts.
|
|
43
46
|
- Treat `cicd template` as Copado Job Templates via `/release/jobs/templates`. It is different from Release Data Templates (`cicd data template`).
|
|
44
|
-
- Treat `cicd work test` as local quality gates (`--local` is the default). It is different from CRT `testing
|
|
47
|
+
- Treat `cicd work test` as local quality gates (`--local` is the default). It is different from CRT `testing job run`.
|
|
45
48
|
- Treat `cicd work test apex` as the Apex test runner that local quality gates (`.agentia_quality_gates.*`) usually call. An empty `--apex-test-classes` list skips Salesforce CLI. It can also be invoked directly. It is different from CRT.
|
|
46
49
|
- Treat `auth` credentials as keychain/API credentials and `cicd credential` records as Copado environment credentials.
|
|
47
50
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Use this reference for `agentia cicd environment ...`, `agentia cicd environment auth ...`, and `agentia cicd credential ...`.
|
|
6
6
|
|
|
7
|
-
`auth set --cicd` stores the API key used by the CLI. `cicd credential` lists, creates, or
|
|
7
|
+
`auth set --cicd` stores the API key used by the CLI. `cicd credential` lists, creates, updates, opens, or authenticates Copado environment credential records. They are different credential types.
|
|
8
8
|
|
|
9
9
|
## Environment Commands
|
|
10
10
|
|
|
@@ -14,9 +14,9 @@ Use this reference for `agentia cicd environment ...`, `agentia cicd environment
|
|
|
14
14
|
| `environment get ID` | Inspect one environment | Read before updates, credential changes, or auth checks. |
|
|
15
15
|
| `environment create NAME` | Create an environment | Set `--type`; platform defaults to SFDX. |
|
|
16
16
|
| `environment update ID` | Sparse environment changes | Use only the fields the user wants changed. |
|
|
17
|
-
| `environment open [ID]` | Open environment
|
|
18
|
-
| `environment auth status ID` | Validate
|
|
19
|
-
| `environment auth web login ID` | Complete browser OAuth
|
|
17
|
+
| `environment open [ID]` | Open an environment | Uses the project default environment when ID is omitted. CLI-only navigation helper. |
|
|
18
|
+
| `environment auth status ID` | Validate auth for an environment credential | Auto-selects when possible; use `--credentialid` to disambiguate. |
|
|
19
|
+
| `environment auth web login ID` | Complete browser OAuth for an environment credential | CLI-only interactive browser flow. Supports bounded port and timeout flags. |
|
|
20
20
|
|
|
21
21
|
Examples:
|
|
22
22
|
|
|
@@ -26,33 +26,39 @@ agentia cicd environment get <environment-id> --json
|
|
|
26
26
|
agentia cicd environment auth status <environment-id> --credentialid <credential-id> --json
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Credential Commands
|
|
30
30
|
|
|
31
31
|
| Command | Use For | Notes |
|
|
32
32
|
| --- | --- | --- |
|
|
33
|
-
| `credential list` | Find credentials
|
|
33
|
+
| `credential list` | Find credentials across environments | Optional `--name`, `--page-size`, and `--cursor`. OAuth signatures are never returned. |
|
|
34
34
|
| `credential create` | Create a Copado environment credential | Requires `--environmentid` and `--name`; `--default` marks it default. |
|
|
35
|
-
| `credential update ID` | Update a Copado
|
|
35
|
+
| `credential update ID` | Update a Copado credential by ID | No environment flag; resolves environment/orgType from the credential. |
|
|
36
|
+
| `credential open ID` | Open a credential in the browser | CLI-only navigation helper. |
|
|
37
|
+
| `credential auth status ID` | Validate a specific credential | Derives the environment from GET `/corpus/credentials/{id}`. |
|
|
38
|
+
| `credential auth web login ID` | Browser OAuth for a specific credential | CLI-only; derives the environment from the credential. |
|
|
36
39
|
|
|
37
40
|
Examples:
|
|
38
41
|
|
|
39
42
|
```sh
|
|
40
|
-
agentia cicd credential list --
|
|
43
|
+
agentia cicd credential list --name CI --json
|
|
41
44
|
agentia cicd credential create --environmentid <environment-id> --name "CI User" --default --json
|
|
42
|
-
agentia cicd credential update <credential-id> --
|
|
45
|
+
agentia cicd credential update <credential-id> --no-default --json
|
|
46
|
+
agentia cicd credential open <credential-id>
|
|
47
|
+
agentia cicd credential auth status <credential-id> --json
|
|
48
|
+
agentia cicd credential auth web login <credential-id>
|
|
43
49
|
```
|
|
44
50
|
|
|
45
51
|
## When To Use Which Credential
|
|
46
52
|
|
|
47
53
|
- Use `agentia auth set --cicd` when the CLI cannot authenticate to the Copado CICD API.
|
|
48
|
-
- Use `agentia cicd credential list` to
|
|
54
|
+
- Use `agentia cicd credential list` to discover credentials without first knowing an environment ID.
|
|
49
55
|
- Use `agentia cicd credential create/update` when a Copado environment needs a Salesforce org credential record.
|
|
50
|
-
- Use `agentia cicd
|
|
56
|
+
- Use `agentia cicd credential auth web login` when you already know the credential ID; use `agentia cicd environment auth web login` when you want automatic/default selection within an environment.
|
|
51
57
|
- Use `agentia auth get --cicd --json` to inspect local CLI auth status without exposing the raw API key.
|
|
52
58
|
|
|
53
59
|
## Gotchas
|
|
54
60
|
|
|
55
61
|
- Custom Domain environments are not supported by the credential create/update helpers.
|
|
56
|
-
-
|
|
62
|
+
- Create still reads the environment first and copies its org type into the credential payload; update and credential-targeted auth derive environment/orgType from the global credential record.
|
|
57
63
|
- Environment authentication can auto-select only when there is a single obvious credential. Pass `--credentialid` if multiple credentials exist.
|
|
58
|
-
- Browser login
|
|
64
|
+
- Browser login and open are intentionally CLI-only; MCP exposes `agentia_credential_auth_status` for non-interactive validation.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# CICD Pipelines Reference
|
|
4
4
|
|
|
5
|
-
Use this reference for `agentia cicd pipeline ...`, `agentia cicd pipeline connection ...`, `agentia cicd pipeline stage-connection ...`, and `agentia cicd
|
|
5
|
+
Use this reference for `agentia cicd pipeline ...`, `agentia cicd pipeline automation ...`, `agentia cicd pipeline quality-gate ...`, `agentia cicd pipeline connection ...`, `agentia cicd pipeline stage-connection ...`, `agentia cicd stage ...`, and `agentia cicd extension-configuration ...`.
|
|
6
6
|
|
|
7
|
-
Pipeline connections, stage connections, and
|
|
7
|
+
Pipeline connections, stage connections, stages, automation rules, quality gates, and extension configurations are related but distinct. Read the target object before mutating it. These pipeline quality gates are not local `cicd work test` quality gates.
|
|
8
8
|
|
|
9
9
|
## Pipeline Commands
|
|
10
10
|
|
|
@@ -23,6 +23,38 @@ agentia cicd pipeline list --platform SFDX --active --json
|
|
|
23
23
|
agentia cicd pipeline get <pipeline-id> --json
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
## Automation Rules
|
|
27
|
+
|
|
28
|
+
| Command | Use For | Notes |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `pipeline automation list --pipeline-id <id>` | List automation rules | Filters: `--active`, `--name`, `--source-action`, `--execution-time`, `--include-system-generated`. |
|
|
31
|
+
| `pipeline automation get ID --pipeline-id <id>` | Inspect one rule | Accepts Id or name. |
|
|
32
|
+
| `pipeline automation create --pipeline-id <id> ...` | Create an inactive rule | Scopes: `promotion`, `backPromotion`, `environmentSyncBackPromotion`, `advanced`. Requires stage/environment targets; Scheduled needs `--cron-expression`. Optional `--filter-criteria` is a user-story filter: builder `{mode,logic,conditions[]}` or custom `{mode:"custom",whereCondition}`. |
|
|
33
|
+
| `pipeline automation update ID --pipeline-id <id> ...` | Sparse update | Scope is immutable after create. |
|
|
34
|
+
| `pipeline automation activate\|deactivate ID --pipeline-id <id>` | Lifecycle | Salesforce Id only (not name). Requires Copado Deployer ≥ 27.46. |
|
|
35
|
+
| `pipeline automation delete ID --pipeline-id <id> --yes` | Delete | Confirmation required for headless/JSON. |
|
|
36
|
+
| `pipeline automation open ID` | Open in browser | Salesforce Id only. |
|
|
37
|
+
|
|
38
|
+
## Quality Gates
|
|
39
|
+
|
|
40
|
+
| Command | Use For | Notes |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `pipeline quality-gate list --pipeline-id <id>` | List quality gates | Filters: `--name`, `--tool`. |
|
|
43
|
+
| `pipeline quality-gate get ID --pipeline-id <id>` | Inspect one gate | Aggregate may include multiple conditions. |
|
|
44
|
+
| `pipeline quality-gate create --pipeline-id <id> ...` | Create inactive gates | Requires an active `--extension-configuration-id` and targeting (`--entire-pipeline` or stage/environment Ids). Optional `--filter-criteria` is a metadata-change filter (`Name`/`Type`/`Directory` conditions + numbered `logic`). Create may return an array. |
|
|
45
|
+
| `pipeline quality-gate update ID --pipeline-id <id> ...` | Sparse update | Gate must be inactive; update uses singular `--stage-id` / `--environment-id`. |
|
|
46
|
+
| `pipeline quality-gate activate\|deactivate ID --pipeline-id <id>` | Lifecycle | Salesforce Id only. |
|
|
47
|
+
| `pipeline quality-gate delete ID --pipeline-id <id> --yes` | Delete inactive gate | Confirmation required for headless/JSON. |
|
|
48
|
+
| `pipeline quality-gate open ID` | Open in browser | Salesforce Id only. |
|
|
49
|
+
|
|
50
|
+
## Extension Configurations
|
|
51
|
+
|
|
52
|
+
| Command | Use For | Notes |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| `extension-configuration list` | Discover configs | Filters: `--name`, `--tool`, `--test-type`, `--active`. |
|
|
55
|
+
| `extension-configuration get ID` | Inspect one config | Accepts Id or name. |
|
|
56
|
+
| `extension-configuration open ID` | Open in browser | Salesforce Id only. Create/update/activate are not exposed (gateway lifecycle currently unavailable). |
|
|
57
|
+
|
|
26
58
|
## Environment Connections
|
|
27
59
|
|
|
28
60
|
Pipeline connections define source-to-destination environment promotion edges.
|
|
@@ -59,5 +91,7 @@ Stages are reusable stage records. Stage connections order those stages inside a
|
|
|
59
91
|
- `pipeline connection` is an environment promotion edge.
|
|
60
92
|
- `pipeline stage-connection` is the ordered stage chain inside a pipeline.
|
|
61
93
|
- `cicd stage` manages stage records that can be referenced by stage connections.
|
|
94
|
+
- Pipeline `quality-gate` commands manage Copado pipeline quality gates. Local script gates remain under `cicd work test`.
|
|
95
|
+
- Activate/deactivate and open require Salesforce Ids, not names.
|
|
62
96
|
- Delete commands prompt in interactive mode. Use `--yes` only when the user already confirmed the destructive action.
|
|
63
97
|
- Repository setup is a neighboring domain: pipelines can reference `--git-repository-id`, but repository lifecycle commands are under `agentia cicd repository`.
|
|
@@ -21,7 +21,7 @@ agentia cicd work get --json
|
|
|
21
21
|
|
|
22
22
|
Omit the positional story ID only; keep `--json` so agents parse the `result` object. With MCP, call `agentia_work_get` without an `id` when available.
|
|
23
23
|
|
|
24
|
-
**On success:** treat the JSON `result` user story as the story context for the rest of the task. Reuse any returned fields later commands or flags need (identifiers, names, status, acceptance criteria, functional or technical specs, pipeline or environment references, and similar)—not only `id` and `name`.
|
|
24
|
+
**On success:** treat the JSON `result` user story as the story context for the rest of the task. Reuse any returned fields later commands or flags need (identifiers, names, status, acceptance criteria, functional or technical specs, pipeline or environment references, subscriber `customFields`, and similar)—not only `id` and `name`.
|
|
25
25
|
|
|
26
26
|
**On failure:** the CLI exits when no active work item is recorded (typical message: no active work item; suggestion to run `agentia cicd work set <id>`). Tell the user that no current story is set, include the sanitized error text, and stop. Do not invent an ID, run `work list` to pick one, or continue the original request until the user sets context or provides an explicit story ID.
|
|
27
27
|
|
|
@@ -61,9 +61,9 @@ Cloud commit checks Story readiness and source credentials before submission. Av
|
|
|
61
61
|
| Command | Use For | Notes |
|
|
62
62
|
| ------------------ | ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
63
|
| `work list` | Find candidate stories | Use `--assigned-to-me`, `--status`, `--project-name`, `--name`, pagination flags. |
|
|
64
|
-
| `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields. `--committed-metadata` also includes the Story committed metadata list as `committedMetadata` in the result.
|
|
65
|
-
| `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. `--source-credential` sends `sourceEnvironment` as null so Salesforce assigns the environment.
|
|
66
|
-
| `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. `--source-credential` sends `sourceEnvironment` as null.
|
|
64
|
+
| `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields including subscriber `customFields` (`apiName`, `label`, `type`, `value`, `displayValue`, `updateable`, optional `options`). `--committed-metadata` also includes the Story committed metadata list as `committedMetadata` in the result. |
|
|
65
|
+
| `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. Write subscriber fields with repeatable `--custom-field ApiName=value` (MCP: `customFields: [{ apiName, value }]`). `--source-credential` sends `sourceEnvironment` as null so Salesforce assigns the environment. |
|
|
66
|
+
| `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. Same `--custom-field` / MCP `customFields` write shape as create; update-only custom fields is allowed. `--source-credential` sends `sourceEnvironment` as null. |
|
|
67
67
|
| `work set ID` | Mark active and prepare branch | Fetches the base branch and, when present, the remote feature branch; creates/checks out `feature/<story-name>` from `origin/feature` when that ref exists, otherwise from the base; stores local context. A gateway warning prints the message, skips git, clears branch keys, and records work-item id/name/title. Warns without PATCHing when the Story credential differs from the project default; use `work update --source-credential` to change it. `--none` clears every `last*` key and checks out `lastBaseBranch`, else `main`, else `master`. |
|
|
68
68
|
| `cloud commit` | Copado cloud metadata commit | Prefer `agentia cicd cloud commit`. Requires `--metadata-category` (or `c`/`category` per `--file` change); use `SFDX` for Salesforce metadata. For local Git work, use `git commit` then `work publish`. `cicd work commit` remains a hidden compatibility alias. |
|
|
69
69
|
| `work publish` | Publish local commits and register with Copado | Requires active story context and clean tree. Accepts `--permissions` and `--full-metadata` when nested detection is not enough. `work push` is a compatibility alias. |
|
|
@@ -72,7 +72,7 @@ Cloud commit checks Story readiness and source credentials before submission. Av
|
|
|
72
72
|
| `work submit` | Submit for review/validation or promote | Runs local gates unless `--skip-local-tests`; can push ahead commits. Waits up to 5 minutes when the last pending related job template contains `Commit`. `--skip-pull-request` skips opening the MR URL. `--done` and `--deploy` match Copado UI Submit when promoting. |
|
|
73
73
|
| `work done` | Compatibility alias | Prefer `work submit --done`; both promote and deploy rather than validate-only. |
|
|
74
74
|
| `work promote` | Experimental local promotion | Skips Quality Gates. Requires `enableLocalPromote: true` in `.agentia/config.json`. Merges `feature/<name>` into `promotion/<promotionName>`. Use `--backpromote --destination-branch` for back promotions; `--continue` after conflict resolution. |
|
|
75
|
-
| `work environment-sync` | Sync next-env commits onto dest/dev | Back-promotes every story behind the destination environment. Use `--destination-environment` or `--dev-org-branch
|
|
75
|
+
| `work environment-sync` | Sync next-env commits onto dest/dev | Back-promotes every story behind the destination environment. Use `--destination-environment` or `--dev-org-branch`. On conflict, stores `lastEnvironmentSyncName` so `--continue` / `--abort` can omit `--promotion` (cleared on success, abort, and `work set`). |
|
|
76
76
|
| `cloud promote` | Story-centric cloud promotion run | Use `--deploy` for merge and deploy. Prefer this over local `work promote` unless you explicitly enabled local promote. |
|
|
77
77
|
| `work status [ID]` | Check story and related executions | Useful after submit, promote, or commit jobs. |
|
|
78
78
|
| `work open [ID]` | Open story in browser | CLI-only browser helper. |
|
|
@@ -118,6 +118,21 @@ agentia cicd cloud promote <story-id> --deploy --json
|
|
|
118
118
|
|
|
119
119
|
Cloud commit and promotion wait for Job Executions by default and return nonzero on failed or timed-out jobs while preserving diagnostic IDs. If a Promotion reaches Merge Conflict, resolve it and resume the original execution; do not start a replacement run.
|
|
120
120
|
|
|
121
|
+
## Subscriber Custom Fields
|
|
122
|
+
|
|
123
|
+
Org-defined User Story fields (API names ending in `__c`, excluding packaged `copado__*`) are exposed as `customFields` on `work get` / create / update responses.
|
|
124
|
+
|
|
125
|
+
- **Read:** prefer `agentia cicd work get [id] --json` (or MCP `agentia_work_get`) and use `result.customFields`. Prefer `displayValue` when presenting values; use `apiName` when writing. Human output lists them under `Custom Fields:` after `Components:`.
|
|
126
|
+
- **Write (CLI):** repeatable `--custom-field ApiName=value` (string values; first `=` splits key/value). Duplicate `apiName` values are rejected.
|
|
127
|
+
- **Write (MCP):** `customFields: [{ "apiName": "JIRA_Key__c", "value": "CICD-1" }]` on `agentia_work_create` / `agentia_work_update` (values may be string, number, boolean, or null).
|
|
128
|
+
- Omit custom-field flags/args for packaged-only mutations. Unknown or non-updateable names fail with gateway `PLA-US-009`.
|
|
129
|
+
|
|
130
|
+
```sh
|
|
131
|
+
agentia cicd work create --title "Story" --custom-field JIRA_Key__c=CICD-1 --json
|
|
132
|
+
agentia cicd work update --custom-field Priority_Pick__c=P1 --json
|
|
133
|
+
agentia cicd work get --json
|
|
134
|
+
```
|
|
135
|
+
|
|
121
136
|
## Deployment Steps
|
|
122
137
|
|
|
123
138
|
Deployment steps are attached to a user story and run during promotion.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agentia-metadata
|
|
3
|
+
description: Org Intelligence — read Salesforce metadata in a sandbox or developer org through Agentia `cicd metadata explore` (and MCP `agentia_metadata_explore`). Use when listing or searching metadata names, reading items by API name, finding where a class/field/etc is referenced, describing types, reading type documentation, or running specified Apex tests. Prefer local project files first, then the org. Reads metadata only (not org data); does not edit or deploy metadata.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Agentia managed skill file: agentia setup skills -->
|
|
7
|
+
|
|
8
|
+
# Org Intelligence (Agentia Metadata Exploration)
|
|
9
|
+
|
|
10
|
+
**Org Intelligence** lets you inspect Salesforce **metadata** in the user's
|
|
11
|
+
connected sandbox / developer org via `cicd metadata explore` (MCP
|
|
12
|
+
`agentia_metadata_explore`). Prefer MCP when available; otherwise use the CLI
|
|
13
|
+
with `--json` when results will be parsed.
|
|
14
|
+
|
|
15
|
+
Covers Apex classes, triggers, objects, fields, Flows, and other Metadata API
|
|
16
|
+
types. First release is **read-oriented** only—do not invent validate, deploy,
|
|
17
|
+
create, update, or `check_async_id`.
|
|
18
|
+
|
|
19
|
+
## Capabilities And Limits
|
|
20
|
+
|
|
21
|
+
| Can | Cannot |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Read / list / search / describe **metadata** | Read or query **org data** (records, SOQL results, reports as data) |
|
|
24
|
+
| Find metadata references (`find_references`) | **Edit**, create, update, validate, or deploy metadata |
|
|
25
|
+
| Run specified Apex test classes (when asked) | Mass-scan or compare entire orgs |
|
|
26
|
+
|
|
27
|
+
If the user asks to change metadata or fetch record data, say Org Intelligence
|
|
28
|
+
cannot do that and point them at the appropriate Copado/Agentia workflow or
|
|
29
|
+
local editing instead.
|
|
30
|
+
|
|
31
|
+
## Source Priority
|
|
32
|
+
|
|
33
|
+
1. **Local project files first** (workspace / git / force-app / retrieved source)
|
|
34
|
+
when they exist and answer the question.
|
|
35
|
+
2. **Then the connected org** via Org Intelligence (`cicd metadata explore`)
|
|
36
|
+
for names, bodies, docs, and references that are missing or unclear locally.
|
|
37
|
+
|
|
38
|
+
Do not call the org when local files already provide a clear answer. Prefer
|
|
39
|
+
local when reconciling differences unless the user asks for the org version.
|
|
40
|
+
|
|
41
|
+
## What You Can Do
|
|
42
|
+
|
|
43
|
+
| Goal | Action |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| List metadata names that match a pattern | `list` |
|
|
46
|
+
| Search source (Apex Page/Class/Trigger/Component only) | `search` |
|
|
47
|
+
| Retrieve one item by API name | `read` |
|
|
48
|
+
| Find where a class/field/etc is used or called | `find_references` |
|
|
49
|
+
| Describe a metadata type shape | `describe_type` |
|
|
50
|
+
| Get type documentation from the tool | `read_documentation` |
|
|
51
|
+
| Run specific Apex test classes | `run_apex_tests` |
|
|
52
|
+
|
|
53
|
+
Use `list` / `search` to discover exact names before `read` or
|
|
54
|
+
`find_references`. Pass type + name for references. Confirm with the user
|
|
55
|
+
before `run_apex_tests`.
|
|
56
|
+
|
|
57
|
+
## Org And Scope
|
|
58
|
+
|
|
59
|
+
- Target is the CICD project default credential when `--credential-id` /
|
|
60
|
+
`credentialId` is omitted. Pass `--credential-id` only to override. Do not
|
|
61
|
+
mix credential auth with `--session-id` + `--endpoint`.
|
|
62
|
+
- The user may call this **Org Intelligence**, or the connected org **Org**,
|
|
63
|
+
**Sandbox**, **Integration**, **Dev Org**, or similar—treat those as the
|
|
64
|
+
same target unless they ask for a different credential.
|
|
65
|
+
- You can access selected metadata. You **cannot** compare orgs or run mass
|
|
66
|
+
analysis / full-org scans—that hits limits and takes too long. If a list is
|
|
67
|
+
truncated or incomplete, say you cannot finish that breadth of scan and ask
|
|
68
|
+
the user to narrow the request.
|
|
69
|
+
|
|
70
|
+
## Pattern And Type Rules
|
|
71
|
+
|
|
72
|
+
- **Always quote CLI wildcards** (`--pattern 'Account*'`). Unquoted `*` is
|
|
73
|
+
expanded by the shell. MCP `pattern` does not need shell quotes.
|
|
74
|
+
- **`search`** only covers `ApexPage`, `ApexClass`, `ApexTrigger`, and
|
|
75
|
+
`ApexComponent`. Pattern ≥ 2 characters, at most one `*`.
|
|
76
|
+
- **`list` for CustomField / FieldSet / DuplicateRule / ListView** — pattern
|
|
77
|
+
must start with the SObject name and a dot (e.g. `Account.Name`,
|
|
78
|
+
`Account.namespace__Name__c`). You cannot list every item of every object.
|
|
79
|
+
- **`list` for Flow** — `--pattern` matches API name, Flow label, and
|
|
80
|
+
triggering object API name.
|
|
81
|
+
- **Profiles** — reading Profile details is not supported. Tell the user you
|
|
82
|
+
cannot answer questions about Profile contents. Listing Profile names may
|
|
83
|
+
still be attempted if useful, but do not claim you can read their body.
|
|
84
|
+
- **Reports, Dashboards, and Folders** — listing is not supported; say so.
|
|
85
|
+
|
|
86
|
+
## Apex Tests
|
|
87
|
+
|
|
88
|
+
- You cannot run all tests or local tests.
|
|
89
|
+
- Ask the user which test class names to run, then pass them via
|
|
90
|
+
`--apex-unit-tests` / `apexUnitTests` (comma-separated).
|
|
91
|
+
|
|
92
|
+
## How To Call
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
agentia cicd metadata explore --action describe_type --object-type ApexClass --json
|
|
96
|
+
agentia cicd metadata explore --action list --object-type ApexClass --pattern 'Account*' --json
|
|
97
|
+
agentia cicd metadata explore --action search --pattern 'Cont*' --json
|
|
98
|
+
agentia cicd metadata explore --action read --object-type ApexClass --full-name MyClass --json
|
|
99
|
+
agentia cicd metadata explore --action find_references --object-type ApexClass --full-name MyClass --json
|
|
100
|
+
agentia cicd metadata explore --action run_apex_tests --apex-unit-tests MyClassTest --json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Surface | Name |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| CLI | `agentia cicd metadata explore` |
|
|
106
|
+
| MCP | `agentia_metadata_explore` |
|
|
107
|
+
|
|
108
|
+
Tool/CLI output is YAML inside `output` (human mode prints YAML; `--json` /
|
|
109
|
+
MCP return `{ output, credentialId? }`). **When talking to the user, respond in
|
|
110
|
+
XML—not YAML.** Summarize findings; do not dump full tool YAML unless asked.
|
|
111
|
+
Never echo session Ids, API keys, or other secrets.
|
|
112
|
+
|
|
113
|
+
## Gathering Context For Generated Code
|
|
114
|
+
|
|
115
|
+
When helping the user design or draft Salesforce metadata (local edits only):
|
|
116
|
+
|
|
117
|
+
- Prefer **local files**, then Org Intelligence `list` / `search` / `read` /
|
|
118
|
+
`describe_type` / `find_references` for accurate names and patterns.
|
|
119
|
+
- When drafting new Apex tests, search local code or ask about existing
|
|
120
|
+
conventions (data factories, test setup) before querying the org.
|
|
121
|
+
- Present draft code with the client's normal artifact / code-block features.
|
|
122
|
+
Org Intelligence does not write metadata to the org.
|
|
123
|
+
|
|
124
|
+
## Safety
|
|
125
|
+
|
|
126
|
+
- Stay on the supported read actions above—no metadata edits, no org data.
|
|
127
|
+
- Prefer sandbox/dev credentials; treat production as explicit and high-risk.
|
|
128
|
+
- Narrow `--pattern` when lists are large or truncated.
|
|
129
|
+
- Experimental command: expect a warning in human/JSON output.
|
|
130
|
+
|
|
131
|
+
## Reference
|
|
132
|
+
|
|
133
|
+
Flags, MCP args, examples, and gotchas:
|
|
134
|
+
[references/metadata-explore.md](references/metadata-explore.md)
|
|
135
|
+
|
|
136
|
+
## Report Back
|
|
137
|
+
|
|
138
|
+
Report actions run, object type / fullName / pattern, credential Id (never
|
|
139
|
+
session Id), and outcome (names found, test result summary, or error). Do not
|
|
140
|
+
include secrets. Use XML in the user-facing reply.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<!-- Agentia managed skill file: agentia setup skills -->
|
|
2
|
+
|
|
3
|
+
# Org Intelligence — Metadata Explore Reference
|
|
4
|
+
|
|
5
|
+
**Org Intelligence** is Agentia’s read-only Salesforce metadata inspection
|
|
6
|
+
feature: `agentia cicd metadata explore` and MCP `agentia_metadata_explore`
|
|
7
|
+
call `POST /agentia/headless/ai_metadata_tool` against the user's connected
|
|
8
|
+
sandbox/developer org (Copado credential or Salesforce session).
|
|
9
|
+
|
|
10
|
+
This is **org Metadata API exploration**, not Copado’s metadata index
|
|
11
|
+
(`cicd metadata list`) or content compare helpers.
|
|
12
|
+
|
|
13
|
+
**Source priority:** local project files first (when present), then the org.
|
|
14
|
+
|
|
15
|
+
**Can:** read / list / search / describe metadata; `find_references`; run
|
|
16
|
+
specified Apex tests when asked.
|
|
17
|
+
|
|
18
|
+
**Cannot:** read org **data** (records); **edit**, create, update, validate, or
|
|
19
|
+
deploy metadata. Do not invent validate/deploy/create/update, `check_async_id`,
|
|
20
|
+
or flags such as `--metadata-files`, `--async-id`, `--test-level`,
|
|
21
|
+
`--validate-only`, or `--organization-name`.
|
|
22
|
+
|
|
23
|
+
## Prerequisites
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
agentia auth get --cicd --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Omitting `--credential-id` / `credentialId` uses the CICD project default
|
|
30
|
+
credential automatically. Override only when the user needs a different org.
|
|
31
|
+
Credential auth and `--session-id` + `--endpoint` are mutually exclusive.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
agentia cicd project default set --credential <credential-id>
|
|
35
|
+
agentia cicd environment list --type Sandbox --json
|
|
36
|
+
agentia cicd credential list --environmentid <environment-id> --json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Shell Quoting
|
|
40
|
+
|
|
41
|
+
Always quote CLI wildcards:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
agentia cicd metadata explore --action list --object-type ApexClass --pattern 'Account*' --json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
MCP `pattern` does not need shell quotes.
|
|
48
|
+
|
|
49
|
+
## CLI Flags / MCP Args
|
|
50
|
+
|
|
51
|
+
| CLI | MCP | Notes |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `--action` | `action` | Required. `list`, `search`, `read_documentation`, `describe_type`, `read`, `find_references`, `run_apex_tests` |
|
|
54
|
+
| `--object-type` | `objectType` | e.g. `ApexClass`, `CustomObject`, `Flow` |
|
|
55
|
+
| `--full-name` | `fullName` | Required for `read` |
|
|
56
|
+
| `--pattern` | `pattern` | Default `*`; quote wildcards on CLI |
|
|
57
|
+
| `--apex-unit-tests` | `apexUnitTests` | Required for `run_apex_tests` |
|
|
58
|
+
| `--credential-id` | `credentialId` | Overrides project default |
|
|
59
|
+
| `--session-id` | `sessionId` | With `--endpoint` only; never log |
|
|
60
|
+
| `--endpoint` | `endpoint` | Salesforce instance URL with session |
|
|
61
|
+
| `--json` | — | `{ output, credentialId? }` plus experimental warning |
|
|
62
|
+
|
|
63
|
+
## Actions
|
|
64
|
+
|
|
65
|
+
### `list`
|
|
66
|
+
|
|
67
|
+
List names for one metadata type. Use returned `fullName` values with `read`.
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
agentia cicd metadata explore --action list --object-type CustomObject --pattern 'Account*' --json
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Special pattern rules:
|
|
74
|
+
|
|
75
|
+
- **CustomField / FieldSet / DuplicateRule / ListView** — pattern must start with
|
|
76
|
+
SObject + `.` (e.g. `Account.Name`, `Account.namespace__Name__c`).
|
|
77
|
+
- **Flow** — pattern matches API name, label, and triggering object API name.
|
|
78
|
+
|
|
79
|
+
Unsupported listings: **Reports**, **Dashboards**, **Folders** — tell the user.
|
|
80
|
+
|
|
81
|
+
### `search`
|
|
82
|
+
|
|
83
|
+
Text search across **ApexPage, ApexClass, ApexTrigger, ApexComponent** only.
|
|
84
|
+
Pattern ≥ 2 characters; at most one `*`.
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
agentia cicd metadata explore --action search --pattern 'MyCtrl*' --json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### `describe_type` / `read_documentation`
|
|
91
|
+
|
|
92
|
+
Type shape vs tool-provided docs. Prefer `describe_type` for compact structure.
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
agentia cicd metadata explore --action describe_type --object-type Flow --json
|
|
96
|
+
agentia cicd metadata explore --action read_documentation --object-type ApexClass --json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### `read`
|
|
100
|
+
|
|
101
|
+
Retrieve one component. **Profile contents are not supported**—inform the user
|
|
102
|
+
you cannot answer questions about Profile body/details.
|
|
103
|
+
|
|
104
|
+
```sh
|
|
105
|
+
agentia cicd metadata explore --action read --object-type ApexClass --full-name ns__MyClass --json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `find_references`
|
|
109
|
+
|
|
110
|
+
Partial reference/dependency lookup: metadata that uses or calls a given item.
|
|
111
|
+
Requires `--object-type` and `--full-name` (type + name of the referenced
|
|
112
|
+
component). Coverage may be incomplete—treat results as a starting point.
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
agentia cicd metadata explore --action find_references --object-type ApexClass --full-name MyClass --json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `run_apex_tests`
|
|
119
|
+
|
|
120
|
+
Requires explicit test class names. Cannot run all tests or local tests—ask the
|
|
121
|
+
user which classes to run.
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
agentia cicd metadata explore --action run_apex_tests --apex-unit-tests MyClassTest --json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Limits And Behavior
|
|
128
|
+
|
|
129
|
+
- Selected metadata access only—no org compare, no mass structure scan.
|
|
130
|
+
- Truncated/incomplete lists → narrow pattern or tell the user the scan is too broad.
|
|
131
|
+
- Tool returns YAML in `output`; **user-facing replies should be XML**, not YAML.
|
|
132
|
+
- Never echo `--session-id` or other secrets.
|
|
133
|
+
|
|
134
|
+
## Related Commands
|
|
135
|
+
|
|
136
|
+
| Need | Command |
|
|
137
|
+
| --- | --- |
|
|
138
|
+
| Org Metadata API explore (read-oriented) | `cicd metadata explore` |
|
|
139
|
+
| Copado metadata index search | `cicd metadata list` |
|
|
140
|
+
| Indexed/Git content blobs | `cicd metadata content get` |
|
|
141
|
+
| Org/Git content diff | `cicd metadata content compare` |
|
|
142
|
+
| Copado dependency graph | `cicd metadata dependency list` |
|