@copado/agentia-cli
Command-line interface for Agentia headless Copado workflows (auth, environments, jobs, pipelines, metadata, and local MCP).
Usage
$ npm install -g @copado/agentia-cli@latest --registry https://registry.npmjs.org --@copado:registry=https://registry.npmjs.org
$ agentia COMMAND
running command...
$ agentia (--version)
@copado/agentia-cli/1.6.0 linux-x64 node-v22.23.4
$ agentia --help [COMMAND]
USAGE
$ agentia COMMAND
...
Agentia checks npm rc and latest in the background and warns when a newer release is available for the installed version. Auto-selection uses an optional updateChannel preference in ~/.config/agentia-cli/config.json (rc keeps dual-channel compare and still installs a SemVer-greater stable; latest is stable-only). With no preference, prerelease installs compare both tags and pick the highest newer SemVer, while stable installs compare only latest. Run agentia update to install the selected release (an interactive RC-to-stable crossing can prompt once to save a preference; after a successful install it warns to run setup skills update in each project that uses Agentia-managed skills), agentia update --check to check without changing the installation or preference, or agentia update --channel rc|latest to force a channel and save that preference on install. RC is the supported prerelease channel; stable publications use npm's latest dist-tag.
Store gateway credentials before calling gateway-backed commands:
$ agentia auth set --cicd <api-key> --region na
$ agentia auth get
Using Agentia behind a proxy
Agentia honors the standard proxy environment variables on every outbound HTTP(S) request and on CRT browser WebSocket connections, similar to Salesforce CLI:
HTTPS_PROXY/https_proxyfor TLS traffic (recommended)HTTP_PROXY/http_proxyfor plain HTTPNO_PROXY/no_proxyfor hosts that must connect directly (comma-separated; supports*suffix wildcards)- npm-style
npm_config_https_proxy,npm_config_proxy, andnpm_config_no_proxywhen the CLI runs under npm
Loopback targets (localhost, 127.0.0.1, ::1) always bypass the proxy so local gateway development and IDE listeners stay direct.
$ export HTTPS_PROXY=http://proxy.example.com:3128
$ export NO_PROXY=localhost,127.0.0.1,.mycompany.com
$ agentia cicd project list
Corporate TLS inspection may require trusting your organization CA. Set NODE_EXTRA_CA_CERTS=/path/to/corp-ca.pem, or use NODE_USE_SYSTEM_CA=1 on supported Node versions.
For Cursor or Claude Code MCP, pass the same variables in the MCP server env block so gateway tools inherit them.
NTLM or Kerberos proxy authentication is not built in; use a local forwarding proxy such as px or cntlm that presents a plain HTTP proxy to Agentia.
Read a user story
agentia cicd work get <id> --json returns the complete user-story record supplied by the CICD gateway in the result property. The JSON response preserves nested related epic and feature records; human output presents the same field groups while redacting oauthSignature. Pass --user-stories-ahead-behind to also compare how many user stories are ahead of and behind the next pipeline environment when the story has a pipeline and source environment.
$ agentia cicd work get US-0001 --json
$ agentia cicd work get US-0001 --user-stories-ahead-behind
{
"result": {
"id": "a1Y000000000001EAA",
"name": "US-0001",
"title": "Improve deployment validation",
"status": "Development In Progress",
"project": "a0w000000000001AAA",
"projectName": "Example Project",
"pipelineId": "a0M000000000001EAA",
"sourceEnvironment": "a0S000000000001EAA",
"baseBranch": "main",
"epic": {"id": "a0E000000000001EAA", "name": "EPIC-1", "title": "Example epic"},
"feature": {"id": "aDs000000000001EAA", "title": "Example feature"}
},
"status": 0,
"transactionId": "..."
}
cicd work create and cicd work update validate --acceptance-criteria locally: it must contain fewer than 255 characters.
For Copado AI agents, store the AI PAT and organization context once, then use ask for scripts or chat for an interactive session:
$ agentia auth set --ai <pat-token> --ai-domain robotic.copado.com --ai-org 42888
$ agentia ai agent ask --agent plan -p "Break this requirement into implementation steps"
$ agentia ai agent ask --agent knowledge -p "Summarize the available workspace guidance"
$ agentia ai agent chat --agent build --sf-org test14 --user-story US-1042
Interactive Help and Command History
Users can open an experimental, multi-turn Copado support conversation directly in an interactive terminal without an eager CICD credential check:
$ agentia help-agent
$ agentia support
$ agentia help --agent
Inside the chat, Enter submits the prompt and Shift+Enter inserts a new line.
Help Agent requests fresh short-lived access through the CICD gateway for every turn, so an invalid or missing CICD credential fails the question rather than preventing the chat from opening. Every request adds a CLI system message that identifies the assistant as a concise Copado expert on Agentia Headless and Copado tools for developers working locally. Response tokens are written as they arrive. On every turn the CLI refreshes version, platform, architecture, workspace basename, normalized current origin, dominant CLI/IDE/MCP usage counts, and the three newest sanitized command summaries. When tooling or a local-versus-cloud operations flow cannot be determined, the system prompt asks one brief clarifying question. Each command summary can contain command ID, normalized origin, parameters, timestamp, duration, status, exit code, CLI version, workspace basename, redacted structured result, and only the final 20 combined output lines. Follow-up turns also include a deterministic redacted digest of at most six successful prior messages, with fixed per-message and total byte limits instead of resending unbounded chat history. It never sends full 20 KiB logs, raw User-Agent headers, full paths, credentials, tokens, session IDs, request bodies, or arbitrary unredacted errors.
Agentia keeps at most 100 sanitized execution summaries in owner-private temporary storage. New records
identify their source as cli, ide, or mcp; legacy records can omit it. CLI and IDE records can
include redacted parameters, structured result data, and one ordered stream-tagged log that retains the
last 20 KiB independently for stdout and stderr. MCP records contain only command ID, timing, outcome,
CLI version, workspace basename, and origin—never arguments, output, results, or errors.
Successful Help Agent turn pairs are also stored, after redaction and 4 KiB per-message truncation, in owner-private temporary JSONL. This storage is not restored into later conversations, retains at most 100 pairs, and applies a rolling 24-hour expiry on access. Inspect command summaries or clear both stores with:
$ agentia history list --limit 10
$ agentia history list --limit 10 --json
$ agentia history clear --yes
Inside Help Agent, /clear resets only the in-memory conversation. agentia history clear --yes deletes
both temporary history files. Runtime/history commands, interactive AI chat commands, and Help Agent
entry points remain excluded from command-execution history; MCP calls add metadata-only usage entries.
No MCP Help Agent or history-reading tool is provided.
See Interactive AI Help Agent for prerequisites, privacy details, limitations, and troubleshooting.
Agent Skills Setup
agentia setup skills create installs portable Markdown-only Agent Skills that teach compatible agents how to use Agentia CICD (including metadata exploration), CRT Testing, AI, and Pipelines Advanced commands correctly, plus target-specific routing artifacts (.agents/skills/agentia/SKILL.md, .cursor/rules/agentia.mdc, or .claude/skills/agentia/SKILL.md). Use --target agents for .agents/skills (portable default), --target cursor for .cursor/skills, or --target claude for .claude/skills. Setup does not modify customer root AGENTS.md.
$ agentia setup skills create --target agents
$ agentia setup skills create --cicd --target cursor --no-prompt
$ agentia setup skills update --ai --target agents --no-prompt
Use update to refresh Agentia-managed skill files. Unrelated files are preserved, and existing files without the Agentia managed marker are not overwritten unless --force is explicit.
Plugin skills
An installed plugin can contribute skills through an agentia:contribute hook (see plugin-sdk/README.md). They are third-party prompts, so none are installed by default and the hook runs only when you ask for plugin skills: interactive setup skills create, --plugin, setup skills list, or setup skills update when plugin skills are already installed. Interactive setup skills create lists what plugins contribute (nothing ticked) and installs only the ones you select; headless runs and --json install them only with --plugin:
$ agentia setup skills list
$ agentia setup skills create # pick plugin skills in the prompt
$ agentia setup skills create --plugin @acme/agentia-plugin-release --target cursor --no-prompt
$ agentia setup skills update
A contributed skill with id release installs as agentia-release. setup skills list shows installable skills and why an invalid one is skipped; one failing or slow plugin never blocks the others, and a plugin without the hook is ignored. With --plugin and no pack flag only plugin skills are written; otherwise the generated Agentia rules file gets a "Plugin skills" line for each installed plugin skill. Plugin skills carry a per-plugin managed marker; files that are unmanaged or owned by another plugin are never replaced without --force. setup skills update with no flags also refreshes plugin skills already in the project, and warns when their plugin is uninstalled or no longer contributes them. Nothing is deleted unless you run agentia setup skills update --prune, which removes only the files that carry that plugin's managed marker (never unmarked files, symlinks, or other plugins' files), drops their line from the rules file, and is skipped for any plugin whose hook failed or timed out. Contributions are rejected if they list non-Markdown files, symbolic links, paths outside the plugin, allowed-tools, a reserved or duplicate id, an unsupported apiVersion, or exceed 50 files, 256 KiB per file, or 1 MiB per skill.
Contributor setup, local gateway mode, and integration testing are documented in DEVELOPMENT.md.
Local MCP Server
Agentia can run as a local Model Context Protocol (MCP) server over stdio. MCP-compatible clients such as Cursor can then call Agentia tools without using the terminal.
Prerequisites
- Install the CLI so
agentiais available:
$ npm install -g @copado/agentia-cli@rc --registry https://registry.npmjs.org --@copado:registry=https://registry.npmjs.org
- Store credentials. The MCP server reuses the same keychain-backed auth as the CLI:
$ agentia auth set --cicd <api-key> --region na
$ agentia auth set --ai <pat-token> --ai-domain robotic.copado.com --ai-org 42888
$ agentia auth get
- Confirm the MCP command is available:
$ agentia mcp --help
$ agentia mcp start --help
Start the server
$ agentia mcp start
This command is long-running. It speaks MCP over stdio and waits for a client connection. Do not expect interactive terminal output after start.
Configure Cursor
Add an MCP server entry that launches Agentia:
{
"mcpServers": {
"agentia": {
"type": "stdio",
"command": "agentia",
"args": ["mcp", "start"],
"env": {
"AGENTIA_PROJECT_ROOT": "${workspaceFolder}"
}
}
}
}
This works in either .cursor/mcp.json or global ~/.cursor/mcp.json: Cursor expands ${workspaceFolder} for the active workspace, so Agentia loads that repository's .agentia defaults, project auth, and .env. After saving the config, reload MCP servers in Cursor.
Configure Claude Code
agentia setup can write the project .mcp.json entry for Claude Code and pre-approve the agentia server in .claude/settings.local.json. The recommended entry passes Claude's project directory through to Agentia:
{
"mcpServers": {
"agentia": {
"type": "stdio",
"command": "agentia",
"args": ["mcp", "start"],
"env": {
"AGENTIA_PROJECT_ROOT": "${CLAUDE_PROJECT_DIR:-}"
}
}
}
}
Claude Code expands CLAUDE_PROJECT_DIR for local stdio servers. If AGENTIA_PROJECT_ROOT or CLAUDE_PROJECT_DIR is empty or still an unexpanded placeholder (for example ${CLAUDE_PROJECT_DIR:-}), Agentia ignores it and falls back to the MCP client's reported folder, then walks upward for project markers.
You can also add Agentia manually with claude mcp add or an mcpServers entry in ~/.claude.json.
For other local MCP clients, set AGENTIA_PROJECT_ROOT to an absolute project directory. When no explicit root exists, Agentia uses one local MCP root when available, otherwise searches upward from its startup directory. Multiple local roots require AGENTIA_PROJECT_ROOT to avoid selecting the wrong project.
Optional definitive override: set AGENTIA_MCP_PROJECT_ROOT to an absolute project directory in the MCP server env. When set, Agentia uses that path as the project root for defaults, auth profiles, and .env loading, and does not use the client's roots/list result for project selection.
Request identity
Gateway requests identify what ran in Referer and how it ran in User-Agent and event-source.
- Shell CLI:
Refereris the oclif command id (for examplecicd:environment:list).User-Agentisagentia-cli/<version>andevent-sourceisagentia-cli. - MCP: tools that wrap a CLI command send that same command id as
Referer.User-Agentisagentia-mcp/<version>andevent-sourceisagentia-mcp. MCP-only helpers keep their MCP tool id asReferer. - IDE: set
AGENTIA_CLIENT_ORIGIN=idewhen the IDE extension spawns Agentia, includingagentia mcp start, and pass the extension version asAGENTIA_IDE_VERSION. A valid IDE version producesUser-Agent: agentia-ide/<ide-version> (agentia-cli/<cli-version>); missing or invalid values fall back toagentia-ide/<cli-version>.event-sourceremainsagentia-ide. Unsupported origin values and IDE versions are ignored.
Available tools
Tools are JSON-safe and return structured results. Sensitive fields are redacted.
| Topic | Tools |
|---|---|
| AI | agentia_ai_ask |
| Auth | agentia_auth_get, agentia_auth_set |
| ADV | agentia_adv_auth_status, agentia_adv_organization_list, agentia_adv_organization_get, agentia_adv_organization_validate, agentia_adv_deployment_list, agentia_adv_deployment_get, agentia_adv_deployment_create, agentia_adv_deployment_options, agentia_adv_deployment_validate, agentia_adv_deployment_deploy, agentia_adv_deployment_quick_deploy, agentia_adv_deployment_cancel, agentia_adv_component_types, agentia_adv_component_list, agentia_adv_component_refresh, agentia_adv_component_selected, agentia_adv_component_add, agentia_adv_component_remove, agentia_adv_job_get, agentia_adv_job_list, agentia_adv_job_wait |
| Credential | agentia_credential_list, agentia_credential_create, agentia_credential_update, agentia_credential_auth_status |
| Data | agentia_data_template_list, agentia_data_template_get, agentia_data_template_get_detail, agentia_data_template_create, agentia_data_template_save_detail, agentia_data_template_delete, agentia_data_template_convert_old, agentia_data_records_search, agentia_data_records_match, agentia_data_commit_create, agentia_data_commit_list, agentia_data_dataset_file_list, agentia_data_dataset_file_content, agentia_data_filter_list, agentia_data_filter_add, agentia_data_filter_update, agentia_data_filter_delete, agentia_data_formula_list, agentia_data_formula_create, agentia_data_formula_update, agentia_data_sobject_fields, agentia_data_sobject_relationships, agentia_data_sync_apply, agentia_data_sync_preview_updates |
| Environment | agentia_environment_list, agentia_environment_get, agentia_environment_create, agentia_environment_update, agentia_environment_auth_status |
| Function | agentia_function_list, agentia_function_get, agentia_function_defaults, agentia_function_upsert, agentia_function_delete, agentia_function_run, agentia_function_run_local, agentia_function_result_get, agentia_function_result_log_get |
| Job Template | agentia_template_list, agentia_template_get, agentia_template_defaults, agentia_template_upsert, agentia_template_delete |
| Governance | agentia_health_check |
| Job | agentia_job_list, agentia_job_get, agentia_job_log_get, agentia_job_run, agentia_job_resume, agentia_job_kill, agentia_job_pause |
| Pipeline | agentia_pipeline_list, agentia_pipeline_get, agentia_pipeline_create, agentia_pipeline_update, agentia_pipeline_connection_list, agentia_pipeline_connection_create, agentia_pipeline_connection_update, agentia_pipeline_connection_delete, agentia_pipeline_stage_connection_list, agentia_pipeline_stage_connection_create, agentia_pipeline_stage_connection_update, agentia_pipeline_stage_connection_delete, agentia_pipeline_automation_list, agentia_pipeline_automation_get, agentia_pipeline_automation_create, agentia_pipeline_automation_update, agentia_pipeline_automation_delete, agentia_pipeline_automation_activate, agentia_pipeline_automation_deactivate, agentia_pipeline_quality_gate_list, agentia_pipeline_quality_gate_get, agentia_pipeline_quality_gate_create, agentia_pipeline_quality_gate_update, agentia_pipeline_quality_gate_delete, agentia_pipeline_quality_gate_activate, agentia_pipeline_quality_gate_deactivate, agentia_extension_configuration_list, agentia_extension_configuration_get |
| Stage | agentia_stage_list, agentia_stage_get, agentia_stage_create, agentia_stage_update, agentia_stage_delete |
| Project | agentia_project_list, agentia_project_get, agentia_project_create, agentia_project_update, agentia_project_delete, agentia_project_default_get, agentia_project_default_set, agentia_project_default_unset |
| Repository | agentia_repository_list, agentia_repository_get, agentia_repository_create, agentia_repository_update, agentia_repository_delete, agentia_repository_reset, agentia_repository_validate |
| Promotion | agentia_promotion_list, agentia_promotion_get, agentia_promotion_run, agentia_promotion_job_step_update, agentia_promotion_queue_list, agentia_promotion_queue_remove, agentia_promotion_conflict_list, agentia_promotion_conflict_get, agentia_promotion_conflict_resolve, agentia_promotion_conflict_unresolve |
| User | agentia_user_get |
| Work | agentia_work_list, agentia_work_get, agentia_work_create, agentia_work_update, agentia_work_delete, agentia_work_deployment_step_types, agentia_work_deployment_step_salesforce_flows, agentia_work_deployment_step_list, agentia_work_deployment_step_create, agentia_work_deployment_step_update, agentia_work_deployment_step_reorder, agentia_work_deployment_step_delete, agentia_work_set, agentia_work_status, agentia_work_publish, agentia_work_push, agentia_work_test, agentia_work_test_apex, agentia_work_submit, agentia_work_done |
| Cloud | agentia_cloud_commit, agentia_cloud_promote (agentia_work_commit remains a compatibility alias of agentia_cloud_commit) |
| Metadata | agentia_metadata_list, agentia_metadata_explore, agentia_metadata_content_get, agentia_metadata_content_compare, agentia_metadata_index_compare, agentia_metadata_dependency_list, agentia_metadata_refresh_run, agentia_metadata_refresh_status, agentia_metadata_refresh_deleted |
| Notification | agentia_notification_configure, agentia_notification_get |
| Testing | agentia_testing_project_list, agentia_testing_project_get, agentia_testing_project_create, agentia_testing_project_update, agentia_testing_project_delete, agentia_testing_project_permission_list, agentia_testing_project_permission_get, agentia_testing_project_permission_set, agentia_testing_project_permission_update, agentia_testing_robot_list, agentia_testing_robot_get, agentia_testing_robot_create, agentia_testing_robot_update, agentia_testing_robot_delete, agentia_testing_job_list, agentia_testing_job_get, agentia_testing_job_create, agentia_testing_job_run, agentia_testing_job_update, agentia_testing_job_delete, agentia_testing_job_refs, agentia_testing_job_files_list, agentia_testing_job_files_upload, agentia_testing_job_files_download, agentia_testing_job_runs_list, agentia_testing_job_runs_get, agentia_testing_job_runs_search, agentia_testing_job_runs_logs, agentia_testing_job_runs_abort, agentia_testing_job_schedule_get, agentia_testing_job_schedule_set, agentia_testing_job_schedule_remove, agentia_testing_data_table_list, agentia_testing_data_table_get, agentia_testing_data_table_create, agentia_testing_data_table_update, agentia_testing_data_table_delete, agentia_testing_variable_list, agentia_testing_variable_get, agentia_testing_variable_create, agentia_testing_variable_update, agentia_testing_variable_delete, agentia_testing_user_parameter_list, agentia_testing_user_parameter_get, agentia_testing_user_parameter_create, agentia_testing_user_parameter_update, agentia_testing_user_parameter_delete, agentia_testing_browser_start, agentia_testing_browser_stop, agentia_testing_browser_status, agentia_testing_browser_execute, agentia_testing_browser_inspect, agentia_testing_browser_screenshot, agentia_testing_browser_set_options, agentia_testing_browser_history |
Notes for common tools
agentia_work_set,agentia_work_publish, andagentia_work_submitoperate on the Git repository in the MCP server process's current working directory. They can check out a branch, fetch from, and push toorigin; start the server from the intended repository. Ifagentia_work_setreturnsstatus: "warning", it printed the gateway message and did not run git or update local work context. Work set fetches the base branch and, when that ref exists, the remote feature branch, then creates or checks outfeature/<user-story-name>from the remote feature when present, otherwise from the base. Work set also compares the Copado Story source credential with the CICD project default after the work/set response: it warns when the Story credential is missing, skips comparison when a bound Story has no project default, and warns without changing the Story when they differ (current credential and environment are shown; useagentia_work_update/cicd work update --source-credentialto change it).agentia_ai_askmirrorsagentia ai agent ask --json: it buffers the agent response, returns structured warnings/followups/links, and never returns hidden reasoning chunks. Plan, Build, and Test requests acceptcredentialId,forceCredentialSync, andnoCredentialSyncto control project-default Copado credential synchronization, plussfOrgonly as prompt context.- Browser-based
cicd environment auth web loginremains a CLI-only command. - Pipeline and job tools require
userIdandorganizationIdfor the gatewayx-user-idandx-organization-idheaders. - Job list accepts optional filters such as
status,name,type,parent,context, andlimit. - Metadata tools require the same gateway identifiers as the CLI flags, for example
pipelineId,sourceOrgId, andsourceCredentialIdwhere applicable. - Project list accepts optional
mineto restrict results to projects owned by or related to the current user. - Project default tools read and write local or global defaults managed by
agentia cicd project default *. - User get defaults
idtomefor the authenticated user. - Environment create/update tools mirror the corresponding CLI commands and only send fields you provide.
- Work set/publish/submit/done tools mirror the CLI workflow:
setpreparesfeature/<user-story-name>, thenpublish/submit/doneoperate on the current feature branch with the same clean-tree and base-branch requirements.agentia_work_pushremains a compatibility alias ofagentia_work_publish. agentia_cloud_commitrequiresmetadataCategoryfor simple input, and eachchangesentry requiresc(orcategory). For Salesforce metadata setSFDX. Copado SFDX deploy classifies changeset rows by that field; omitting it logs "Salesforce changes not found." and skips the deploy.- Work deployment-step tools mirror
cicd work deployment-step *; create accepts either the resolved innerconfigJsonor the same type-specific guided fields as the CLI, update usesnullto clear nullable fields, and reorder requires completebeforeandafterID arrays. - Promotion list accepts the same filters as
agentia cicd promotion list; promotion get takes a Promotion ID.agentia_promotion_job_step_updatemirrorscicd promotion job-step update, validates sparse manual-task updates, and trims assignee values.agentia_promotion_runandagentia_cloud_promotereuse the CLI preflight, run/resume, ordered deployment-step, and bounded polling behavior.agentia_cloud_promotealso auto-creates a forward Draft promotion when none contains the User Story and returns optionalcreatedPromotionin the result. agentia_notification_configuremirrorsagentia cicd notification configure: Slack-only subscriptions on a pipeline for the current user. Resolve the pipeline Id withagentia_pipeline_getfirst. All fields are required (pipelineId,event,destinationType,destinationId,subscription). Event names with spaces use the same underscore tokens as the CLI (for exampleTest_Not Started).agentia_notification_getmirrorsagentia cicd notification get: requirespipelineIdand returns sanitized{ pipelineId, subscriptions }for the authenticated user (no raw system-property metadata).
CRT Git-backed jobs
Use Git storage when CRT should fetch Robot Framework files from a repository branch instead of uploading local files into a snapshot job.
agentia testing job create \
--project 112901 \
--robot 123456 \
--name "Login smoke from Git" \
--git-url https://github.com/acme/crt-tests.git \
--git-branch feature/login-smoke
For private repositories, prefer a CRT domain credential:
agentia testing job create \
--project 112901 \
--robot 123456 \
--name "Login smoke from Git" \
--git-url http