@agentpulselabs/cli
v0.18.3
Published
AgentPulse developer CLI — connect to dev-orgs, scaffold + deploy apps (plugin-based, oclif).
Readme
agentpulse CLI
The AgentPulse developer CLI — connect to your dev-orgs, scaffold apps, and deploy code/schema/seed
into a dev-org's own instance. Published on public npm as @agentpulselabs/cli; the command you
type is agentpulse (short alias: ap).
Install
npm install -g @agentpulselabs/cli
agentpulse --versionUpdate later with npm install -g @agentpulselabs/cli@latest.
Prerequisites
- Node 18+.
- git — required for
app publishandapp deploy --code(packaging archives a git ref). - Atlas is NOT required — the CLI downloads a pinned Atlas binary on first
app deployof objects (schema) and caches it under~/.cache/agentpulse/. Code- and seed-only deploys need nothing extra.
First run
agentpulse login --url https://<your-platform-url> # browser OAuth (PKCE); connects the CLI to your team
agentpulse whoami # confirm identity + connected platform + default dev-orgCredentials are stored per-profile in ~/.config/agentpulse/config.json (mode 0600) — same model as the
gh/sf CLIs. agentpulse logout removes them.
Commands
Auth
| Command | What it does |
|---|---|
| agentpulse login --url <platform> | Browser OAuth login; connects the CLI to your platform + team. |
| agentpulse logout | Remove the stored credentials for a profile. |
| agentpulse whoami | Show who you're logged in as + the connected platform + default dev-org. |
Dev-orgs
| Command | What it does |
|---|---|
| agentpulse org list | List your team's dev-orgs. |
| agentpulse org use <slug> | Set + connect the default dev-org (mints a dev-org-scoped token). |
| agentpulse org open | Open the target dev-org in your browser (authenticated Cloud Run proxy). The local proxy only serves its own tab on localhost:<port>: other sites, other ports and rebound hosts get 403, as do writes (POST/PUT/PATCH/DELETE) that carry neither Origin nor Sec-Fetch-Site. |
| agentpulse org status | Show a dev-org's status, reach details, and connection state (the sf org display analog). |
Schema (read-only inspection)
| Command | What it does |
|---|---|
| agentpulse schema describe | Describe a dev-org's live table schema — columns, types, PK/FK, uniques, indexes, enums (the sf sobject describe analog). |
| agentpulse schema diff | Show the pending schema delta (local objects/ vs the dev-org's live schema) without applying — read-only. |
| agentpulse schema pull | Reconstruct local objects/ JSON from a dev-org's live schema — the read-only inverse of app deploy. |
| agentpulse schema export | Export the live schema as a Markdown data dictionary (stdout or --out file). |
| agentpulse schema graph | Render the live schema as a Mermaid ERD (stdout or --out file). |
Apps
| Command | What it does |
|---|---|
| agentpulse app new | Scaffold a new app project (or register an existing folder). |
| agentpulse app validate | Run the platform gates against your app (the --check-only analog). |
| agentpulse app deploy | Push objects / seed / code into your dev-org — the inner loop. |
| agentpulse app publish | Build + publish a versioned package → install URL. |
| agentpulse app install | Install a published app into your team. |
| agentpulse app versions | List an app's published versions + statuses. |
Tests (Agentforce)
| Command | What it does |
|---|---|
| agentpulse test run "<collection>" | Run a test collection against an environment — print the run link, wait for the verdict, write JUnit, exit 0 only on Pass. See Run tests from CI. |
| agentpulse test wait <runId> | Wait for a run started earlier, write JUnit, exit by its verdict. See Long suites. |
| agentpulse test results <runId> | Read a run's verdict now; --junit <file> writes the report, --format json prints the run summary. |
| agentpulse test collections --agent <apiName> | List the agent's rows and its test collections. See Collection files. |
| agentpulse test export "<collection>" --agent <apiName> | Write a collection as a collection file (agentpulse.test/v1 YAML). |
| agentpulse test import <file> --agent <apiName> | Preview what a collection file changes (the platform's own diff); --apply imports it. |
Diagnostics
| Command | What it does |
|---|---|
| agentpulse doctor | Diagnose your environment and readiness — Node, Atlas, login, target dev-org, app project (the sf doctor analog). |
Plugins
The CLI is extensible via oclif plugins — opt-in commands you install into agentpulse.
| Command | What it does |
|---|---|
| agentpulse plugins | List installed plugins. |
| agentpulse plugins install <pkg> | Install a plugin (adds its commands). |
| agentpulse plugins uninstall <pkg> | Remove a plugin. |
The pulse build-discipline plugin (contract-enforced Discovery → Stories → Architecture → Build → Deliver):
# Public npm package under the @agentpulselabs org — no extra auth.
agentpulse plugins install @agentpulselabs/cli-plugin-pulse
agentpulse pulse --help # start · next · submit · gate · verify · statusPrefer an interactive/agent runtime (Cursor/Codex/Claude)? The same discipline ships as the pulse-mcp
MCP server in the @agentpulselabs/pulse package — point your agent's MCP config at it instead of the CLI.
Pulse is developed in its own repo — github.com/ashishcloud/agentpulse-pulse
(both @agentpulselabs/pulse and @agentpulselabs/cli-plugin-pulse).
Run agentpulse <command> --help for flags on any command.
The inner loop (app deploy)
From inside an app project (after agentpulse org use <slug>):
agentpulse app deploy --metadata object:agents --dry-run # preview the schema delta for one object
agentpulse app deploy --source seed # push just the seed manifests
agentpulse app deploy --source code # push app code → hot-reloads the dev-org (~seconds)
agentpulse app deploy --all # objects + seed + code- objects → the CLI compiles a scoped schema delta locally (Atlas, auto-downloaded) and the dev-org
applies it — one
ALTER TABLEfor one added field, never a whole-schema diff. - code → bundled + hot-reloaded into the dev-org behind a process boundary (a bad build can't take the dev-org down; it keeps serving the previous version).
--dry-runpreviews without applying;--forceallows a destructive schema change.
deploy (my dev-org, instant, unversioned) is distinct from publish (a versioned package for other
tenants) — deploy is the iterate loop, publish is the release.
Run tests from CI (test run)
agentpulse test run starts a run of one Agentforce test collection on one environment, the same run the console's
Run from CI… command describes:
agentpulse test run "Order & support regression" --agent Lorelle --env UAT --wait --junit results.xmlTarget: https://<platform> (--url, client credentials)
Run started: https://<platform>/agentforce/testing?run=<id>
0/4
2/4 · 1 passed · 1 running
4/4 · 3 passed · 1 skipped
JUnit: results.xml
Verdict: Incomplete · 1 skipped
https://<platform>/agentforce/testing?run=<id>| Flag | Meaning |
|---|---|
| "<collection>" | The collection's exact name (any case). Quote it. |
| --agent <apiName> | The agent's API name. Required. |
| --env <environment> | A pipeline stage label (UAT) or a connection name. Required. |
| --version active\|<n> | The agent version to test. Default active. |
| --mode auto\|agentdx\|miaw | How the conversations run. preview = agentdx, live-chat = miaw. Default auto. |
| --wait | Wait for the verdict and exit by it. Without it the command exits 0 once the run has started. |
| --junit <file> | Write the JUnit XML report (rendered by the server, written byte for byte). Needs --wait. |
| --timeout <minutes> | How long --wait waits. Default 60. A run still going then exits 1 (it keeps running on the platform). |
| --url <platform> / --org <slug> | Where to run — see below. One or the other. |
Exit codes
| Code | When |
|---|---|
| 0 | Pass — every scenario ran and passed (or, without --wait, the run started). |
| 1 | Fail, Didn't finish, Cancelled, still running at --timeout, or the run couldn't be read after it started. |
| 2 | Needs review or Incomplete — nothing failed, but a scenario needs a person to look at it, or didn't run. |
| 3 | The run didn't start: bad flags, credentials, the platform unreachable, or a refusal such as ENVIRONMENT_NOT_FOUND or NOT_DEPLOYED (the server's message is printed). |
Credentials, first match wins:
AGENTPULSE_CLIENT_ID+AGENTPULSE_CLIENT_SECRET— a connected app (Team Setup › Connected apps, client credentials) with the scopesagentforce:test-suites:execute agentforce:test-suites:read. The CLI requests a token from<platform>/api/oauth/tokenand renews it before it expires. Setting only one of the two is an error.- Otherwise your
agentpulse loginprofile. Its token is only ever sent to the platform you logged in to.
Where it runs, first match wins: --url / AGENTPULSE_URL → the dev-org from --org or org use → the
platform of your login. A dev-org sits behind Cloud Run's identity gate, and that identity token comes through your
agentpulse login session — so CI without a login runs against --url / AGENTPULSE_URL only, never a dev-org.
--org together with --url or AGENTPULSE_URL is refused.
GitHub Actions:
- run: npm install -g @agentpulselabs/cli
- run: agentpulse test run "Order & support regression" --agent Lorelle --env UAT --wait --junit results.xml
env:
AGENTPULSE_URL: https://<platform>
AGENTPULSE_CLIENT_ID: ${{ secrets.AGENTPULSE_CLIENT_ID }}
AGENTPULSE_CLIENT_SECRET: ${{ secrets.AGENTPULSE_CLIENT_SECRET }}The run records the CI build number and commit when the CI sets them (GITHUB_RUN_NUMBER/GITHUB_SHA, GitLab
CI_PIPELINE_IID/CI_COMMIT_SHA, Jenkins BUILD_NUMBER/GIT_COMMIT, CircleCI, Azure Pipelines). --json prints one
envelope with runId, link, verdict, counts, junit and exitCode, with the same exit codes.
While it waits, the CLI reads the run after 1, 2, 3, 5, 10 and 20 seconds, then every 30 seconds.
Long suites (test wait and test results)
Start the run in one step and collect it in a later one — the run id is in the start line's link (?run=<id>) and in
--json's runId:
RUN_ID=$(agentpulse test run "Nightly regression" --agent Lorelle --env UAT --json | jq -r .result.runId)
# … other CI work …
agentpulse test wait "$RUN_ID" --timeout 120 --junit results.xml
agentpulse test results "$RUN_ID" --format json > results.jsontest wait <runId> reads the run until its verdict (same back-off), writes the JUnit report with --junit, and exits
like test run --wait. test results <runId> reads it once: the verdict, the JUnit report with --junit, and with
--format json the run summary (agentpulse.test-result/v1) on stdout and nothing else. A run still going exits 1
and writes nothing. Both take --url / --org and the credentials above; a connected app needs only
agentforce:test-suites:read. Exit code 3 here means the run couldn't be read at all: a malformed id, credentials,
or a run that isn't there.
Collection files (test collections, export, import)
Since 0.12.0 the CLI moves a collection between the platform and a file in git — the collection file format
agentpulse.test/v1 (Testing Center's TestSpec plus what Testing Center can't check). The platform does the work
(validation, the diff, key matching, values per environment); the CLI finds the agent and collection by name and
passes the platform's answers through.
agentpulse test collections --agent Liora_Service_Agent
agentpulse test export "Reservations regression" --agent Liora_Service_Agent -o tests/reservations.test.yaml
agentpulse test import tests/reservations.test.yaml --agent Liora_Service_Agent # dry run: what would change
agentpulse test import tests/reservations.test.yaml --agent Liora_Service_Agent --apply # preview, then apply that planTarget: https://<platform> (--url, client credentials)
Agent: Liora Service Agent (Liora_Service_Agent) · row a0000000-0000-4000-8000-000000000001
Collection: Reservations regression (changes)
same res-cancel · Cancel a reservation and get a number
change res-other-guest · Refuse another guest's booking (checks)
Warning: line 52:5 testCases[1].approvedHash — the customer or its expectations changed since …
Dry run — nothing changed. Apply this plan: --apply --plan-hash 3d74f666…test collections --agent <apiName> reads the agent's workspace. --json result:
{ "agent": { "apiName": "Liora_Service_Agent", "displayName": "Liora Service Agent",
"rows": [ { "agentId": "uuid", "connectionId": "uuid", "environment": null, "active": true } ] },
"collections": [ { "id": "uuid", "name": "Reservations regression" } ] }A row is the agent on one org. Exit 0 listed, 3 the workspace couldn't be read (flags, credentials, the platform
unreachable, AGENT_NOT_FOUND).
test export "<collection>" --agent <apiName> finds the collection by name (any case; two of the same name are
refused) and writes its enabled, kept scenarios in run order.
| Flag | Meaning |
|---|---|
| -o <file> | Where to write. Default: the platform's file name (<collection-slug>.test.yaml) in the working directory. |
| --force | Replace the file if it exists. Without it an existing file is refused and left as it is. |
| --values <env>[,<env>]\|none | Write variable values for these environments (stage labels or connection names). Default none. Secrets never travel. |
The file is written whole (a temp file renamed over it) or not at all. Exporting gives every scenario without a key one
(written back on the platform), so the next import matches it. --json result:
{ collection: {id, name}, path, bytes, counts: {cases, variables}, report: [{reason, detail}] }; with --json and no
-o nothing is written: path is null and file carries the YAML text. The report says what stayed out
(excluded-draft, excluded-disabled, chained, not-exportable) and what the file says about values
(secret-omitted, no-value). Exit 0 written · 1 refused (COLLECTION_NOT_FOUND, COLLECTION_AMBIGUOUS,
NOTHING_TO_EXPORT, VALUES_INVALID, AGENT_NOT_FOUND, FILE_EXISTS) · 3 not started (flags, credentials, the
platform unreachable).
test import <file> --agent <apiName> is a dry run unless you pass --apply: the platform parses and validates the
file and answers its own diff — the collection (new, changes, no change), every case (add, change with what
changes, same, stays — in the collection but not in the file, never deleted — and skip with why), the variables it
writes, warnings with their line, and a report. Cases match by their id (key) across every row of the agent; a blank
in the file never overwrites a stored value. The file can be a v1 file, a plain TestSpec, or AgentPulse Script's
scenario JSON (the platform migrates it and reports what changed).
| Flag | Meaning |
|---|---|
| --apply | Preview, then apply exactly that plan (its planHash). |
| --apply --plan-hash <h> | Apply a plan previewed earlier (one call, no new preview). PLAN_STALE if anything moved since. |
| --allow-lossy | Go ahead even when the dry run says something would be left out. |
| --collection-id <id> | Import into this collection. Default: the agent's collection named like the file, else a new one. |
| --as-drafts | Add new cases as drafts, in no collection; existing keys are skipped. |
| --env <name> | Import on the agent row of this environment. Default: the active row, else the first. The row only decides who owns what the import adds. |
--json result: { file, agent: {apiName, agentId, environment}, applied, plan, apply, lossy, exitCode } — plan is
the platform's dry-run answer as received ({dryRun, kind, planHash, collection, cases, variables, warnings, report},
null with --plan-hash), apply its apply answer ({applied, suiteId, counts: {added, changed, unchanged, left,
skipped}, variables: {created, updated}}, null on a dry run), lossy the report rows for something left out
(not-migrated, named-verifier, not-imported).
| Code | When |
|---|---|
| 0 | Previewed, or applied. |
| 1 | Refused: FILE_INVALID (each problem printed with its line; in --json, error.errors: [{path, code, rule, message, line?, column?}]), PLAN_STALE (run the same command again — without --plan-hash if you gave one — to preview the new plan), KEY_CONFLICT, SUBJECT_MISMATCH (the file's subjectName isn't --agent), CONTENT_TOO_LARGE (over 1 MB, checked before sending), AGENT_NOT_FOUND, SUITE_NOT_FOUND, ENVIRONMENT_NOT_FOUND. Or the apply call failed; when the platform gave no answer (unreachable, a server error) the apply may have gone through — run the dry run again to see. |
| 2 | A check or field would be left out (the dry run's not-migrated / named-verifier / not-imported rows) — nothing applied. --allow-lossy imports anyway (exit 0). |
| 3 | Not started: flags, an unreadable file, credentials, the platform unreachable or failing on the preview, ENVIRONMENT_UNKNOWN. |
Credentials and scopes are as for test run: --url / AGENTPULSE_URL / --org, then a connected app
(AGENTPULSE_CLIENT_ID + AGENTPULSE_CLIENT_SECRET) or your login. A connected app needs:
| Command | Scopes |
|---|---|
| test collections | agentforce:workspace:read |
| test export | agentforce:workspace:read agentforce:test-suites:export |
| test import | agentforce:workspace:read agentforce:test-suites:import |
A connected app made for test run has only agentforce:test-suites:execute agentforce:test-suites:read: add these in
Team Setup › Connected apps. A missing scope is named in the refusal.
Known limits
- The workspace read doesn't name each agent row's environment yet (
environmentisnull), sotest import --envrefuses withENVIRONMENT_UNKNOWNuntil the platform adds it; leave--envout to import on the active row. --plan-hashapplies without a new preview, so the left-out check (exit 2) only runs on a preview.
Notes
- Using
app deploy/orgrequires a dev-org, which requires your team to be entitled to dev-orgs on the platform. Iforg listis empty, ask your platform admin for a dev-org. - The typed command (
agentpulse) is independent of the package name (@agentpulselabs/cli).
