CLI commands, JSON, and exit codes
Every registered Apex CLI command, the stable JSON envelope, exit-code meanings, and headless agent usage rules.
Use this page as the command map before scripting the CLI. The source of truth is the live apex schema --json command.
Run apex schema targeting --json offline to read the exact targeting.json and segment create/update shapes generated from the server validators. Segment write help includes an example, unknown-key rejections list accepted keys, and apex workspace checkout <experiment> --variation <variation-slug> adds a commented targeting.example.jsonc reference that status and publish ignore.
Global behavior
apexis the canonical binary.dripis a compatibility alias.--jsonis available globally and on every registered command.- Piped stdout automatically uses JSON mode even when
--jsonis omitted. - Human progress, prompts, diagnostics, and update notices go to stderr.
CLI version floor
Every v1 API response includes X-Apex-Cli-Minimum and, when known at build time,
X-Apex-Cli-Latest. The minimum is advisory until server-side enforcement is enabled.
When enforcement is enabled, a write from an older Apex CLI returns HTTP 426 with code
cli_upgrade_required and the exact upgrade command. Read commands continue to work so
agents can inspect state and recover safely.
apex pushandapex experiments applywrite one hosted asset upload line to stderr for each inline image above 4,096 characters and each referenced local image file. A successful save can also report a warning when variation JavaScript redirects the page at load in a normal test. Pass--no-asset-uploadto keep inline and local image references unchanged.- Do not parse human tables. Use
apex schema --jsonto discover commands and flags. apex --version --jsonreturns the standard envelope with the package name and version indata;apex --versionremains a bare version string for compatibility, including in pipes.
JSON output uses this stable top-level envelope:
{
"ok": true,
"version": "0.1.1",
"command": "apex experiments list",
"data": {}
}Errors use the same envelope shape with ok: false and an error object:
{
"ok": false,
"version": "0.1.1",
"command": "apex experiments apply",
"error": {
"message": "Applying these changes revokes the QA approval from 2026-10-01T12:00:00.000Z; pass --accept-qa-invalidation to confirm.",
"code": 4,
"details": {
"reason": "qa_approval_present",
"qa_approved_at": "2026-10-01T12:00:00.000Z",
"required_acknowledgment": "accept-qa-invalidation",
"retry": "apex experiments apply ./my-test --accept-qa-invalidation"
}
}
}When filesystem apply would replace authored URL rules with a Page attachment, it returns exit 4; review the change and retry with --confirm-targeting-replace.
With --json, stdout carries exactly one JSON document and nothing else.
For
commands backed by one API request, data is the API response body exactly as
the API returned it: lists keep { "data": [...], "pagination": {...} }, so rows
are at .data.data[], and single resources are at .data. apex experiments get
adds only dashboard_url. Commands that combine several requests or local files,
such as experiments create, pull, plan and apply, print a documented
CLI-composed object. When an API response caused a failure, error.api carries
{ "status", "body" } with the API error body verbatim; error.code stays the
CLI exit code. CLI 0.13.0 introduced this mirroring; earlier releases nested
bodies under keys such as .data.experiment.
Headless and agent usage
DRIP_API_KEY=apx_your_key_here apex schema --json
apex experiments plan ./my-test --json
apex experiments apply ./my-test --jsonIn headless mode:
-
Do not wait for prompts.
-
Prefer explicit
--json. -
If a command returns exit code
4, inspecterror.details.retryand rerun with the exact flag only after checking the planned destructive or QA-invalidating action. -
Never commit
~/.drip/credentials.json, API keys, or preview tokens. -
Note: CLI experiment readback for the v1 experiment format now guarantees the presence of lifecycle timestamp fields (
started_at,scheduled_start_at, andqa_approved_at) inapex experiments get/apex experiments list --full --jsonoutputs when those fields are applicable. Integrations should read those fields from the JSON envelope to determine scheduling and QA state.
Exit codes
| Code | Meaning | Typical recovery |
|---|---|---|
0 | Success. | Continue. |
1 | General failure. | Read error.message and command-specific details. |
2 | Auth or permission failure. | Run apex login, set DRIP_API_KEY, or check API-key permissions. |
3 | Validation failure. | Fix arguments, JSON, config, or unsupported file content. |
4 | Confirmation required. | Inspect error.details.retry; rerun with the named flag only when intended. |
5 | Conflict, including stale filesystem state where detected. | Pull fresh state, reapply edits, and plan again. |
6 | A check command reported a failing verdict (apex install check, apex install steps, apex shops doctor). | Read error.details.failed_checks (install check), error.details.steps (install steps) or the FAIL checks; fix the storefront or configuration, then rerun. |
Login and context
apex login authenticates your account once: the browser flow mints an
expiring, account-scoped user key that covers every organization and shop
your account can access, then lets you pick an org/shop context. Inspect the
credential and everything it can reach with apex whoami; switch the stored
context with apex use <org>[/<shop>] or apex use --org <org> --shop <shop>;
override per invocation with --org/--shop or the DRIP_ORG/DRIP_SHOP
environment variables. An environment-key run cannot persist apex use; it returns
context_not_persistable with the exact DRIP_ORG/DRIP_SHOP values to export. Every
JSON envelope echoes the effective context (org, shop, credential kind).
Automation keeps injecting a narrow shop key per process with DRIP_API_KEY;
shop and user credentials can coexist. apex login --user is a deprecated
alias. Use apex logout --user to remove only the user credential; plain
apex logout removes both.
Command index
The command names in this index are checked against apex schema --json by the CLI CI lane.
| Command | Purpose |
|---|---|
apex login | Authenticate your account and pick an org/shop context. |
apex logout | Remove stored credentials. |
apex whoami | Show your identity, credential, and available org/shop context. |
apex use | Set the current Apex organization and shop context. |
apex account | Manage your Apex account. |
apex account profile | Show the current account profile. |
apex account profile set | Update the current account profile. |
apex keys | Manage shop API keys with a user credential. |
apex keys list | List API-key metadata for a shop. |
apex keys create | Create a shop API key and print its secret once. |
apex keys revoke | Revoke a shop API key. |
apex webhooks | Manage shop webhooks. |
apex webhooks list | List webhooks. |
apex webhooks create | Create a webhook. |
apex webhooks update | Update a webhook URL, events, or active state. |
apex webhooks delete | Delete a webhook. |
apex webhooks deliveries | List webhook deliveries including failure and disabled state. |
apex webhooks test | Send a signed test event to a webhook. |
apex simulate | Simulate data-layer triggers without emitting events. |
apex forms | Form and checkout analytics: tracked forms, field drop-off, errors and sessions. Needs the shop's form analytics switch. |
apex forms list | List tracked forms with status and coverage; the Shopify checkout is listed first and tracked automatically. |
apex forms add | Track a storefront form: <key> --url <page> --selector <css> and exactly one of --complete-on-goal, --complete-on-page or --complete-on-call. |
apex forms remove | Stop tracking a storefront form; its history stays readable for 30 days. The checkout cannot be removed. |
apex forms summary | Views, starters, completions, abandons, checkout steps and lost revenue with its basis; filter with --range, --split, --device, --country. |
apex forms fields | Per-field time, returns, error share and drop-off; --format takes csv, json or table. |
apex forms errors | Validation errors by field and type with sessions and the share abandoned after; text shows only once seen in 20 sessions. |
apex forms sessions | Recent form sessions as field paths (never typed values); filter with --outcome, --with-replay, page with --cursor. |
apex forms field | One field's daily trend, time histogram, devices and errors. |
apex forms label | Give a field identity a readable label, or --clear it. |
apex forms merge | Report a retired field identity under the field that replaced it. |
apex forms unmerge | Undo a field merge. |
apex forms detect | Find the forms on one of the shop's pages (field metadata only) to pick a selector for apex forms add. |
apex surveys | Manage surveys. |
apex surveys list | List surveys; filter with --status <s>. |
apex surveys get | Get a survey by ID. |
apex surveys create | Create a survey from inline JSON, @file, a file path, or --file <path>; use one input form. See the survey body example below. |
apex surveys update | Update a survey by ID from inline JSON, @file, a file path, or --file <path>; use one input form. See the survey body example below. |
apex surveys start | Start a survey; publication warnings print to stderr. |
apex surveys pause | Pause a survey. |
apex surveys complete | Complete a survey. |
apex surveys duplicate | Duplicate a survey. |
apex surveys delete | Delete a draft or completed survey; live and paused surveys return conflict exit code 5. |
apex experiments | Manage experiments. |
apex experiments list | List code-free summaries by default; filter effective targeting server-side with --url <absolute-url>, use --fields <list> for selected columns, or --full for full details. |
apex experiments get | Get experiment details by ID or slug. JSON readback always carries started_at, scheduled_start_at and qa_approved_at as ISO-8601 UTC timestamps or null (all null on a fresh draft). |
apex experiments results | Read experiment results and timeseries by ID or slug. |
apex experiments errors | Read live variant JavaScript errors per arm, page, device and message. |
apex experiments update | Rename a draft with --name, replace its targeting with --targeting <json-or-@file> (or null to clear it), or update classification and the results window. Omitted fields stay unchanged; --confirm-targeting-replace acknowledges replacing authored URL rules with Page targeting. |
apex experiments goal-outlier | Set a revenue or value goal's outlier rule on a test, at any status. |
apex experiments create | Create a complete experiment with page targeting, audiences, goals, and an optional QA preview URL. JSON readback always carries started_at, scheduled_start_at and qa_approved_at as ISO-8601 UTC timestamps or null (all null on a fresh draft). |
apex experiments attach-idea | Attach an experiment to an idea. |
apex experiments detach-idea | Detach an experiment from its idea. |
apex experiments pause | Pause a running experiment. |
apex experiments complete | Complete or stop an experiment. |
apex experiments delete | Delete an experiment. |
apex experiments pull | Pull the complete versioned experiment filesystem and its local receipt. |
apex experiments status | Read context, versions, QA, and handover next steps without writing. |
apex experiments plan | Plan experiment filesystem changes without saving. Offer drafts check live discount clashes as warnings; missing, failed or incomplete reads remain unchecked, and launch checks again. |
apex experiments apply | Apply experiment filesystem changes to Apex; receipt files include submitted and stored digests and the named normalisation list. A normal test with a load-time redirect in variation code saves with a warning. |
apex experiments screenshots | Force-assign every capture, including control, to its variation server-side, attach before/after QA evidence, and download files with before- / after- prefixes. Use --no-label-pairs for legacy filenames. |
apex experiments qa | Manage experiment QA runs from the CLI. |
apex experiments qa status | Show the latest experiment QA run (creates one only when none exists; reads never change updatedAt). |
apex experiments qa probe | Run saved commerce QA probes, or read evidence with --saved. |
apex experiments qa events | List QA-tagged goal and custom events for a QA session. |
apex experiments qa check | Update one QA checklist item with status, notes, and evidence. |
apex experiments qa notes | Update QA run notes or acceptance criteria summary. |
apex experiments qa approve | Refuses with exit 2 and approval_needs_person: a signed-in person approves QA in the Apex dashboard (link in details.dashboard_url). |
apex experiments qa reopen | Reopen QA and clear scheduled launch state. |
apex experiments qa evidence | Attach screenshot jobs or upload typed QA evidence. |
apex experiments qa request | Request an internal version-bound agent check with config version, brief and retry key. |
apex experiments qa requests | Read and manage internal agent checks on a selected shop Drip manages. |
apex experiments qa requests list | List selected-shop requests, optionally by experiment and state. |
apex experiments qa requests show | Show the immutable request snapshot, result and current freshness. |
apex experiments qa requests status | Read the latest agent check status; human QA still decides. |
apex experiments qa requests claim | Claim or renew a 15-minute lease using the current revision; structured output includes the token. |
apex experiments qa requests complete | Submit a result JSON file with token, revision, outcome and exact record references; never approves QA. |
apex experiments qa spec | Import, explicitly initialize, bind and inspect immutable QA intent versions |
apex experiments qa spec import | Import a validated QA spec as a new immutable version; research_hub needs native_v8. |
apex experiments qa spec init | Start an explicitly incomplete apex_authored spec with open questions. |
apex experiments qa spec bind | Bind spec references to same-shop ids as version N+1; needs the current version and digest. |
apex experiments qa spec show | Show a spec version; --item lists declared cells, observation fields and environment needs. |
apex experiments qa spec diff | Compare two spec versions by item, field, binding and digest. |
apex experiments qa questions | Read questions or report answers; closure requires a signed-in person |
apex experiments qa questions list | List a spec version's intent questions and reported answers. |
apex experiments qa questions answer | Report an answer; the question stays open until a signed-in person closes it. |
apex experiments qa pages | Alias of apex qa pages under the experiment QA commands. |
apex experiments build | Hand in a draft experiment build request (from scratch or mid-flight continue); runs automatic QA by default. |
apex experiments build request | Queue a draft build request with optional --brief/--brief-file; chains QA automatically on completion unless --no-qa is passed. |
apex experiments build requests | Read and manage draft build requests on a selected shop Drip manages. |
apex experiments build requests list | List selected-shop build requests, optionally by experiment and state. |
apex experiments build requests show | Show the immutable build snapshot, completion result, and linked qa_request_id. |
apex experiments build requests status | Read the latest draft build request status and linked QA request id. |
apex experiments build requests claim | Claim or renew a 15-minute build lease using the current revision; structured output includes the token. |
apex experiments build requests complete | Submit a build completion JSON file with token, revision, outcome and changed files; auto-queues QA when include_qa is true. |
apex programs | Create and run multi-shop programs with a user credential. |
apex programs list | List programs; filter with --brand or --shop. |
apex programs show | Show a program and its deployments; --shop reads one store. |
apex programs readout | Read pooled and per-store results; --shop pools only that store. |
apex programs create | Create from --source with --name and child --shops. |
apex programs add-shop | Copy a source to --shop as a draft; --preflight checks without writing, --localization loads a JSON file. |
apex programs start | Start the program, or one child with --shop. |
apex programs pause | Pause the program, or one child with --shop. |
apex programs complete | Complete the program, or one child with --shop. |
apex programs reopen | Reopen the program, or one child with --shop. |
apex programs mark_ready | Mark QA ready using the existing person-approval rules. |
apex programs retry | Retry lifecycle receipts, or a failed copy with --materialization --shop. |
apex programs pause_started | Pause stores started by the program using its recorded receipts. |
apex programs undo-completion | Preview with --store and --preview; apply the reviewed --preview-version with --reason and --yes. Optional --targets-file supplies the exact target array. |
apex qa | QA observations; apex qa --help and apex schema qa start with a preview link in your browser, instruments script, local session (check lane_availability.local in apex schema qa), then runner opt-in. Output is {ok, data: <API body>}; lint and goals check findings are at .data.data. Approval needs a person. |
apex qa instruments | Tools for measuring the page already open in a browser agent. |
apex qa instruments script | Print a self-contained script; run twice to install and collect local, reported observations; collect ends the installation. --phase snapshot reads observations and keeps the installation; --phase preload --out <file> writes a document-start script for ab exec <session> -- open --init-script <file> <url> (wrap ignored). File output reports path, bytes, digest and next step; existing files refuse. After reload or same-origin navigation, collect/snapshot reports lost_on_navigation; fresh documents report no_install_in_this_document. At most 100 selectors; explicit selectors over the cap refuse with too_many_selectors; extra experiment-derived selectors are left out and reported as selectors_truncated. |
apex qa fingerprint | Diff local page fingerprints (reported). |
apex qa fingerprint diff | Show exact changes inside and outside the planned selectors; no QA verdict. |
apex qa pages | Read bounded page targeting observations: reached URLs with their source (sitemap or same-store link), rule matches, locale groups and missing required page types. Audience, segment and market report unverifiable in the data; exit 7 when a reached page or required page type is unverifiable. |
apex qa catalog-sample | Sample up to six representative products from the first 50 public Shopify catalog entries. Prints JSONL by default on a terminal. With --json or piped stdout, the standard envelope carries the rows in data. Unknown facts are null. Unavailable catalogs exit non-zero. |
apex qa tasks | Manage optional checklist tasks; only a signed-in person ticks them. |
apex qa tasks list | List resolved tasks for an experiment, or the shop QA list with --qa-list. |
apex qa tasks add | Add a task with --title or restore a removed experiment task with --restore; --qa-list adds to the shop QA list, with repeatable --page-type, --test-type and --tag. |
apex qa tasks edit | Edit title, hint or position; --qa-list <task> edits the shop QA list and --clear-applies-to clears page and test filters. |
apex qa tasks remove | Remove an experiment task, or permanently remove a shop QA task with --qa-list <task>. |
apex qa page | Read SDK decisions in your QA preview tab. |
apex qa page script | Print the one-line script that returns Drip.qa.state() from the QA build: requested and applied arm, targeting gates with expected and observed values, goals with counts, device and tracking. With the default --include state,changes it also returns Drip.qa.changes(), what each change did per application generation (applied, missed with match count, error, pending custom JS); --include state returns the readout alone. --wrap function for tools that need a function, --json adds sha256 and browser recipes. A live build or an older SDK answers unavailable with reason sdk_qa_readout_missing; a QA build without the ledger answers changes with sdk_qa_changes_missing. Example: pipe apex qa page script to pbcopy, then run it in the open QA preview tab. Use --include media,cart,forms in an open storefront tab for playback and geometry, visible cart badges and Shopify cart lines, and product form values. Await the result when including cart. |
apex qa receipt | Read immutable server-signed QA receipts. |
apex qa receipt show | Read one receipt by ev_ id, or the original operation by --idempotency-key (with --experiment); --fields narrows sections, --cursor pages; a pending operation exits 9 with its job id. Never captures or approves. |
apex qa evidence | List evidence by class and label, or add an upload as reported evidence |
apex qa evidence list | List evidence with its class (receipt, attested, reported) and current labels. |
apex qa evidence add | Record an existing upload (--reference-id) for one item and cell; agent uploads stay reported. |
apex qa evidence tested | Build-bound tested image drafts and publication history; publication does not approve QA. |
apex qa evidence tested show | Read the current-build draft, the published set, older-build drafts and sets, missing items and cells as information, and history; each image names its recorded cell and engine (or why one is unrecorded); with an approval, build_match says whether the approved snapshot named one build (exact) or several (ambiguous, newest shown, candidate_builds lists all); --cursor pages. |
apex qa evidence tested publish | Publish the current-build draft with --draft-id, --build, --expected-revision and --idempotency-key; an older build exits 3 with build_mismatch. Never approves QA. |
apex qa findings | Neutral per-finding ledger with immutable outcome history; no blame |
apex qa findings record | Record a finding: expected, observed, severity, arm, cell, evidence and fix hint. |
apex qa findings verify | Record an outcome with new evidence and the checked build; needs --expected-revision. --replay control replays the recorded steps on control (B) in a fresh session and never judges the outcome; needs --idempotency-key. |
apex qa findings list | List findings with history and current labels; --shop <id> --page <pattern> --label control_issue reads every experiment of that shop. |
apex qa verdict | Record the agent's verdict per item and cell; only a signed-in person waives |
apex qa verdict set | Record pass, fail, unverifiable or not_tested with evidence; a pass on non-eligible evidence stays open. |
apex qa verdict list | List recorded verdicts with their current evidence labels. |
apex qa session | Local browser sessions by default; check apex schema qa for lane_availability.local. --lane runner opts into server-bound receipts and spends the QA budget. There is no automatic fallback. |
apex qa session start | --experiment, optional --url, --lane, --arm; --idempotency-key is generated once when absent and printed before transport. --dry-run reports held cost. Idle 60 seconds, maximum 240 seconds by default (server-configured); pending exits 9. An unavailable lane is refused with the lanes that can run. |
apex qa session open | --experiment --session --url; enqueue same-store navigation for both arms, or --arm; optional --watch, --watch-ms. Reuse --idempotency-key after a lost response; --dry-run does not allocate. |
apex qa session act | --experiment --session; fixed --verb, per-arm action/event observations; --watch <anchor-ids> with --watch-ms (default 10000, cap 30000) returns anchor intervals and settle; --idempotency-key, --dry-run, --arm supported. |
apex qa session inspect | --experiment --session; paged visible DOM with unique selectors; --idempotency-key, --dry-run, --arm supported. |
apex qa session measure | --experiment --session; U23 boxes/count/styles and declarative --observe; --idempotency-key, --dry-run, --arm supported. |
apex qa session console | --experiment --session; redacted errors since --cursor; --idempotency-key, --dry-run, --arm supported. |
apex qa session wait | --experiment --session; bounded --until selector/network-idle/app/hydrated (DOM markers and two quiet frames, else not_hydrated); --watch, --watch-ms; --idempotency-key, --dry-run, --arm supported. |
apex qa session shot | --experiment --session; --images none, thumb or full, stored references/hashes; no receipt; --idempotency-key, --dry-run, --arm supported. |
apex qa session cart | --experiment --session; GET-only cart read on both arms or --arm; --diff <action-or-ev_> compares persisted action snapshots or a receipt with the current read, --compare-arms compares arms, --section, --timeout-ms; --idempotency-key, --dry-run. Never adds, changes or clears a cart. |
apex qa session close | --experiment --session; idempotently release providers and return the sanitized final script/hash. --idempotency-key and --dry-run supported. Release failures remain unknown. |
apex qa session show | --experiment --session; read persisted lifecycle, release states and final script. Polling does not extend idle time or allocate browsers. |
apex qa session hits | --experiment --session; read-only sanitized network hits and untrusted page claims, summary first; --detail, --cursor, --limit 1-40, --arm, --action, --after-ms, --before-ms. Never allocates or proves a goal fired; unavailable exits 7, incomplete exits 9. |
apex qa design | Compare a saved Figma design with what your own browser renders. |
apex qa design script | Print a design-fidelity script for your own browser: compares a saved Figma JSON export (--figma-json) with computed font styles and icons and reports raw differences, no page text, no network. rendered_font is always not_observable_in_page. Optional --platform-fonts <file> (a file path, or - for stdin) with required --platform-fonts-browser <label> adds browser-labelled CDP rendered-family checks. --node, --selectors, --experiment, --wrap. --figma alone refuses figma_token_not_configured (live Figma access is not configured yet). |
apex qa states | Changed control states on an allocated held session; you choose each action. |
apex qa states script | Print a page finder for your own browser; bounded same-origin GETs, reported local observations and coverage. --experiment, --kinds, --selectors, --max-products (1–2500), --max-pages (1–40), --wrap (expression or function). |
apex qa states controls | --experiment --session; list changed controls (stable id, selector, anchor, supported actions) on both arms or --arm, without interacting; --cursor, --limit 1–40, --idempotency-key, --dry-run. Choose each qa session act yourself; act results carry a paired state_diff. |
apex qa probe | Run saved commerce QA probes, or read evidence with --saved. |
apex qa goals | Inspect goal configuration for QA. |
apex qa goals check | Read static goal configuration and variant artifact observations for every active bound goal (exit 7 when something is unverifiable); does not test goal firing. |
apex qa goals fired | <experiment-id> --session <qs_>; persisted per-arm goal windows and signed goal-fire receipts with supersession, filters --action, --arm, --goal, paged --cursor/--limit, --detail. Open windows exit 9, missing bounds 7, a superseded receipt is ineligible, never not_fired. |
apex qa events | Read raw events for one canonical qs_ QA session with an opaque --after cursor and a bounded --wait-for/--timeout poll (exit 7 while action attribution is unavailable, 9 while pending); --follow is for a person at a terminal. |
apex qa lint | Raw lint observations per arm of the stored artifact (publish first) with file, field and line; exit 7 when an observation is unverifiable; --copy is not available yet. Use an explicit path such as apex qa lint ./draft --json to read pulled sources offline and report five advisory warnings in .data.warnings. |
apex qa store | Read cached storefront observations. |
apex qa store script | Print a read-only, network-free expression for store structure, named values, selectors and dispatched event names in your own tab. |
apex qa store profile | Read cached Store Profile page facts with source, freshness and evidence ids, without refreshing the page; runtime facts stay unavailable. |
apex qa store probe | Observe bounded runtime store facts in a guarded session; supports experiment/session scope, idempotency and dry-run. |
apex qa capture | Server-bound receipts for cloud runs and pages a local browser cannot reach; to look at a variant, open apex preview <experiment> --no-open in your own browser. Capture lane (no --from-matrix): --dry-run plans live arms × widths (default 390,768) plus --devices without writes (cells with arm, width or device, and URL; null means the server default page; breakpoints stays symbolic). Without --dry-run it queues both arms at --widths (breakpoints adds store profile edges), optionally on an approved --url. Follow with apex qa job wait <job> --out <dir>. Exit 9 pending; finished jobs exit 7 because this lane cannot independently confirm which arm was applied. Runner capture needs a qa matrix plan (U12, #14032), unavailable in production. |
apex qa job | Read capture jobs or cancel runner jobs. |
apex qa job show | Show capture-lane labels by job id; --out <dir> saves both arms' PNGs for a terminal job. With --experiment, read a runner job's cells and receipt ids; --out is refused. |
apex qa job wait | Without --experiment, poll a capture-lane job for --timeout seconds (default 300, max 1800); --out <dir> saves both arms' PNGs. Exit 9 pending, 7 finished with unverifiable cells, 6 failed. With --experiment, wait up to 20 s on a runner job; --out is refused. Never starts browser work. |
apex qa job cancel | Cancel a runner job (--experiment): future captures stop, completed receipts stay, uncertain work is never repeated. |
apex qa diff | Compare two local receipt files (or two ev_ ids with --experiment) and report changed values, anchor match counts and a differs summary. |
apex qa report | Read QA coverage per item and cell with evidence labels; read-only, never blocks launch. Exit 8 stale, 7 unverifiable or open. --pack exports the internal proof pack (--format json or markdown, --out <new file>); each recorded verdict names its receipt-linked cell, or null. |
apex qa approval | Record approval requests; a signed-in person approves in the dashboard |
apex qa approval request | Record a version-bound approval request (--config-version, --idempotency-key), open items included; returns the dashboard link. Sends nothing, never approves or launches. |
apex qa tools | Offline Unix QA tools (check, bp-seam, text-sentinel, dupid, goal-overlap, money-fuzz, catalog-sample, handle-resolve); zero browser required. |
apex qa tools check | Offline static variation lint covering 10 corpus-proven bug predictors (fixed-delay-timeout, hashed-selector, deep-selector, native-bind, nodelist-guard, malformed-cookie, datalayer-index, cdn-lib-collision, missing-pageshow-bfcache, unscoped-important); exits 1 when errors are reported. |
apex qa tools bp-seam | Extract CSS @media and JS innerWidth/matchMedia breakpoints, JS/CSS mismatches, init-only width reads, and seam sweep widths (N-1, N, N+1); exits 1 when JS/CSS mismatches are found. |
apex qa tools text-sentinel | Scan rendered HTML or stdin (-) for visible undefined, NaN, null, or [object Object] leaks in text nodes and href attributes; exits 1 when leaks are found. |
apex qa tools dupid | Detect duplicate HTML id attributes, orphaned label[for] references, and radio-group name counts across cloned DOM nodes; exits 1 when duplicates or orphans are found. |
apex qa tools goal-overlap | Check closest() goal selector overlaps, HTML co-presence, and stopPropagation() shadowing of body-delegated goals; exits 1 when overlaps or duplicate-listener risks are found. |
apex qa tools money-fuzz | Property-test a price parser module across DE/AT/CH/FR/US/JP locales and currencies (EUR, CHF, USD, JPY, apostrophe separators, negatives, >=1000); exits 1 when any case fails. |
apex qa tools catalog-sample | Sample up to 6 representative storefront products (default_in_stock, on_sale, multi_option, partial_sold_out, sold_out, highest_price) from /products.json or --file as JSONL. |
apex qa tools handle-resolve | Normalize Shopify CDN/product URLs (cdnkey) and optionally verify --live HTTP status and redirect hops; exits 1 in --live mode when any URL fails or redirects. |
apex qa link | Mint fresh internal person-lane QA links and server-encoded QR images for every active arm, including control. |
apex qa spec | Import, explicitly initialize, bind and inspect immutable QA intent versions |
apex qa spec import | Import a validated QA spec as a new immutable version; research_hub needs native_v8. |
apex qa spec init | Start an explicitly incomplete apex_authored spec with open questions. |
apex qa spec bind | Bind spec references to same-shop ids as version N+1; needs the current version and digest. |
apex qa spec show | Show a spec version; --item lists declared cells, observation fields and environment needs. |
apex qa spec diff | Compare two spec versions by item, field, binding and digest. |
apex qa questions | Read questions or report answers; closure requires a signed-in person |
apex qa questions list | List a spec version's intent questions and reported answers. |
apex qa questions answer | Report an answer; the question stays open until a signed-in person closes it. |
apex results | Import and read past test results. |
apex results import | Inspect, preview, and import CSV or JSON result files. |
apex results list | List imported and native past results, with source filters and pagination. |
apex results get | Read one past result by legacy ID or UUID. |
apex results delete | Permanently remove one imported past result after confirmation. |
apex commerce | Commerce status, catalog and price tools. |
apex commerce status | Read the pinned shop's plan, commerce planes, companion, Functions and live discounts. |
apex commerce catalog | Look up products for commerce drafts. |
apex commerce catalog search | Search the commerce product catalog. |
apex commerce catalog get | Get one product and its variants. |
apex commerce shipping-services | List the store's delivery services for shipping tests. |
apex commerce price | Read and bulk-edit selection prices. |
apex commerce price export | Export effective prices as CSV. |
apex commerce price import | Import price overrides with revision checks. |
apex commerce definition | Read and save the canonical commerce definition. |
apex commerce definition get | Read a commerce.json definition envelope. |
apex commerce definition put | Save a commerce.json definition with revision checking. |
apex push | Push experiment definitions from config to the API. |
apex preview | Return a storefront QA link when the live snippet runs, or a proxy link when it does not; link_kind and link_reason explain the choice. --proxy always creates a proxy and skips the snippet check. |
apex roadmap | Work with approved roadmap ideas and build handoffs. |
apex roadmap approved | List approved roadmap ideas ready to build in Apex. |
apex roadmap handoff | Get apex.roadmap_handoff.v1 JSON: contract, schema_version, item, experiment, instructions, goals, mockups, acceptance_criteria, harness, scoring, source, metadata. |
apex harness | Develop AB Test Harness projects through Apex live QA sessions. |
apex harness init | Create apex.harness.json for a harness folder. |
apex harness dev | Build, upload, preview, and watch a harness folder. |
apex harness publish | Verify, build, upload, and publish a harness artifact. |
apex workspace | Check out, preview, and publish Apex draft workspace files. |
apex workspace checkout | Check out an Operator workspace for one variation. |
apex workspace status | Show changed local workspace files. |
apex workspace dev | Upload one preview version or watch workspace files, for one checkout or a folder of per-arm checkouts (one session per arm). With --json, stdout is the start envelope and each save is one JSON line on stderr. |
apex workspace publish | Build and publish changed workspace files back to Apex. |
apex tracking | Create tracking ingestion manifests and QA handoffs. |
apex tracking health | Read the shop's tracking-health checks (install, events, orders linked, currency, exposure, SRM by device, selectors, snippet size, settings changes); exits 0 for pass, 1 for warn or fail, 3 for unknown. |
apex tracking inspect | Create a local tracking manifest from funnel URLs; its output path is relative to the current directory. |
apex tracking plan | Print the implementation plan from a tracking manifest path relative to the current directory. |
apex tracking qa | Print the QA checklist for a tracking manifest path relative to the current directory. |
apex tracking verify | Verify live tracking events, filter by --event-type, and preview event properties. |
apex tracking latency | Compare forced-preview and natural page-load decision latency before launch (init events only, excluding route changes); accepts an experiment ID or key, --days (1–30), and --qa-session. |
apex tracking manifest | Print the shop's tracking manifest, including its tracked forms (key, type, selector, completion rule). |
apex events | Export raw tracking events. |
apex events export | Export every raw event in a window of at most 31 days that does not end in the future, with automatic pagination. |
apex goals | Manage conversion and revenue goals. |
apex goals list | List goals. |
apex goals create | Create a goal. |
apex goals update | Update a goal. |
apex goals test | Dry run a goal URL pattern against traffic. |
apex goals suggest | Suggest goals and funnels from analytics. |
apex funnels | Manage analytics funnels. |
apex funnels list | List funnels. |
apex funnels create | Create a funnel. |
apex funnels update | Replace a funnel's steps. |
apex funnels delete | Delete a funnel. |
apex funnels run | Run funnel analysis. |
apex funnels validate | Validate funnel steps without writing. |
apex environments | Manage runtime environments and domain mappings. |
apex environments list | List runtime environments and mapped domains. |
apex environments set-domain | Map a domain to a runtime environment. |
apex environments remove-domain | Remove a domain mapping. |
apex consent | Manage consent gating. |
apex consent get | Show consent settings. |
apex consent set | Enable and configure consent gating. |
apex consent off | Disable consent gating. |
apex triggers | Manage data-layer triggers and temporary setup capture. |
apex triggers get | Read the shop's runtime triggers. |
apex triggers set | Replace the shop's runtime triggers from a JSON file. |
apex triggers propose | Propose candidate triggers from a discovery report. |
apex triggers apply-recipe | Apply a server-owned trigger recipe. |
apex triggers enable-capture | Enable temporary setup capture. |
apex triggers disable-capture | Disable setup capture and clear its expiry. |
apex project-code | Inspect and safely change shop project code. |
apex project-code get | Read complete code and its opaque version. |
apex project-code diff | Preview a partial JSON change without writing. |
apex project-code set | Create a backup before a version-checked write. |
apex domains | Manage install domains and landing-page domains. |
apex domains list | List install domains. |
apex domains add | Add install domains. |
apex domains remove | Remove install domains. |
apex domains set | Replace install domains. |
apex domains claim | Claim a client hostname for landing pages; prints the CNAME to the Apex edge (--wait checks for up to two minutes). |
apex domains register | Register a new domain on the Drip Cloudflare account after a price confirmation (--confirm-price without a terminal). |
apex domains status | List landing-page domains, or check one hostname now. |
apex domains unclaim | Remove a landing-page domain from Apex; a registered domain stays on the Drip account. |
apex handover | Manage cross-domain identity handover. |
apex handover get | Show cross-domain handover settings. |
apex handover set | Enable cross-domain identity handover. |
apex handover off | Disable cross-domain handover. |
apex handover qa | Check static link/form handover parameter carriage. |
apex analytics | Read shop analytics with a secret API key. |
apex analytics order-journey | Inspect bounded, read-only order evidence and attributed-goal eligibility. |
apex analytics stats | Show dashboard analytics stats. |
apex analytics timeseries | Show analytics timeseries. |
apex analytics traffic | Show traffic sources. |
apex analytics pages | Show page analytics. |
apex analytics geo | Show geography and device analytics. |
apex analytics sessions | Show session analytics. |
apex analytics realtime | Show realtime analytics. |
apex analytics entry-exit | Show entry and exit page analytics. |
apex analytics consent-rate | Estimate analytics consent acceptance from visitor series. |
apex analytics urls | Show storefront URL inventory from pageview analytics. |
apex install | Check Apex storefront installation. |
apex install assess | Assess a public storefront URL and draft an installation assessment and client guide. --shop <id> fills the snippet shop ID; --format selects text, Markdown or JSON. |
apex install kit | Generate a ready-to-send installation guide as Markdown or JSON. |
apex install check | Verify snippet, served config (including purchase triggers), and recent tracking. --shop-id also selects the shop for API requests; otherwise the selected shop or DRIP_SHOP_ID is used. |
apex install steps | Show each installation step (script, consent, test environments, orders, firewall access) with when Apex first and last saw it; exits 6 while a step is waiting. --live also checks the storefront page and firewall access. |
apex flags | Manage flags. |
apex flags list | List flags. |
apex flags get | Get a flag. |
apex flags status | Check whether a flag publication is live at the edge. |
apex flags unarchive | Restore an archived flag Off. |
apex flags history | Read paginated flag history. |
apex flags create | Create a flag. |
apex flags update | Update a flag. |
apex flags update-code | Edit On variant JS/CSS from files with an optimistic version check. |
apex flags rules | Replace or reorder audiences. |
apex flags rules set | Replace the live audience list and archive omissions. |
apex flags rules reorder | Reorder all live audiences with a parent version check. |
apex flags experiences | Manage rule experiences. |
apex flags experiences create | Create a rule experience from JSON. |
apex flags experiences update | Update a rule experience from JSON. |
apex flags experiences delete | Delete an experience when no active or historical rule references it. |
apex flags activate | Activate a flag. |
apex flags pause | Pause a flag. |
apex flags archive | Archive a flag. |
apex backlog | Manage backlog. |
apex backlog list | List backlog items identified as apex.backlog_item.v1. |
apex backlog get | Get a backlog item identified as apex.backlog_item.v1. |
apex backlog create | Create a backlog item. |
apex backlog update | Update a backlog item. |
apex backlog archive | Archive a backlog item with a decline reason. |
apex backlog restore | Restore an archived backlog item. |
apex backlog delete | Permanently delete a backlog item after confirmation. |
apex backlog fields | Manage the shop's own idea fields. |
apex backlog fields list | List the shop's idea fields. |
apex backlog fields create | Add an idea field. |
apex backlog fields update | Update an idea field. |
apex backlog fields archive | Archive an idea field; values already on ideas are kept. |
apex signals | Manage signals. |
apex signals list | List signals; pass --include-archived to include archived signals. |
apex signals get | Get a signal. |
apex signals create | Create a signal. |
apex signals update | Update a signal. |
apex signals delete | Delete or archive a signal. |
apex personalizations | Manage personalizations. |
apex personalizations list | List personalizations. |
apex personalizations get | Get a personalization. |
apex personalizations create | Create a personalization. |
apex personalizations update | Update a personalization. |
apex personalizations activate | Activate a personalization. |
apex personalizations pause | Pause a personalization. |
apex personalizations archive | Archive a personalization. |
apex personalizations unarchive | Unarchive a personalization. It comes back Off. |
apex external-pixels | Manage external pixel integrations. |
apex external-pixels snippet | Generate an external purchase pixel snippet. |
apex assets | Manage assets. |
apex assets list | List assets. |
apex assets get | Get an asset. Add --experiment <exp> to read whether its authored code references the asset. |
apex assets upload | Upload an asset file or map filenames to delivery URLs for a batch of images. |
apex assets delete | Delete an asset. |
apex landing-pages | Build landing pages with your own tools, then deploy, track and test them with Apex. |
apex landing-pages list | List landing pages. |
apex landing-pages get | Get a landing page. |
apex landing-pages create | Create a landing page to build outside Apex. |
apex landing-pages pull | Pull a landing page into a checkout folder. |
apex landing-pages plan | Show what applying a checkout would change. |
apex landing-pages apply | Apply a checkout as a new version. |
apex landing-pages preview | Print a signed preview link (valid 24 hours). |
apex landing-pages deploy | Deploy a version to the shop's apex-page.com address or a domain it holds. |
apex landing-pages versions | List versions. |
apex landing-pages rollback | Deploy an earlier version to the page's current address. |
apex landing-pages experiment | Create a draft experiment that splits the live page between two versions. |
apex landing-pages open | Print the page's dashboard URL. |
apex pages | Manage targeting pages; pages urls lists every URL of the store. |
apex pages list | List targeting pages (ls is its alias). |
apex pages create | Create a page; --help lists body keys, pattern shapes contradicting match_type fail with match_type_mismatch unless --literal is passed, and apex schema --json carries the body schema. |
apex pages update | Update a page; --help lists body keys, pattern shapes contradicting match_type fail with match_type_mismatch unless --literal is passed, and apex schema --json carries the body schema. |
apex pages delete | Delete a page. |
apex pages urls | Stream the store URL inventory from sitemaps, products.json and the Apex catalogue to --out <file> or --out -; the final JSONL summary records completeness, source counts, errors and freshness. |
apex segments | Manage segments. |
apex segments list | List segments. |
apex segments create | Create a segment. |
apex segments update | Update a segment. |
apex segments delete | Delete a segment. |
apex exclusion-groups | Manage exclusion groups. |
apex exclusion-groups list | List exclusion groups. |
apex exclusion-groups get | Get an exclusion group. |
apex exclusion-groups create | Create an exclusion group; --help shows the request body and apex schema --json exposes it under the command's body key. |
apex exclusion-groups update | Update an exclusion group with the same documented body shapes. |
apex exclusion-groups delete | Delete an exclusion group after confirmation; use --force in non-interactive environments. |
apex exclusion-groups replace-members | Replace exclusion group members. |
apex brand | Print shop brand context for external agents. |
apex targeting | Test experiment targeting. |
apex targeting test | Evaluate experiment URL targeting for a page. |
apex audit-log | Inspect sensitive audit logs. |
apex audit-log list | List audit logs with entity filters and offset pagination. |
apex inbox | Read and send inbox messages. |
apex inbox list | List account or experiment inbox messages. |
apex inbox send | Send an account or experiment inbox message. |
apex inbox mark-read | Mark one inbox channel, or all channels, read. |
apex shops | Manage organization shops. |
apex shops list | List organization shops. |
apex shops get | Get a shop. |
apex shops create | Create a shop. |
apex shops update | Update a shop. |
apex shops doctor | Check shop configuration and the three-state purchase-capture battery against observed analytics. |
apex shops auto-stop | Read or update auto-stop defaults. |
apex shops testing-defaults | Read or update testing defaults. |
apex shops guardian | Read or update guardian defaults. |
apex shops store-profile | Read and review a store profile. |
apex shops store-profile get | Read the store profile. |
apex shops store-profile review-fact | Review a store-profile fact. |
apex shops store-profile review-finding | Review a semantic finding. |
apex shops store-profile start-learning-run | Start a store-profile learning run. |
apex shops shopware | Manage Shopware bindings. |
apex shops shopware prebind | Bind a Shopware store URL before installation and print the ownership proof when issued. Use --reissue-proof to replace a live proof for an unverified binding. |
apex discover | Read observed tracking shapes and optionally mine a public GTM container. |
apex schema | Print the CLI command, flag, and mandatory-option schema and the bundled experiment filesystem file contract. |
apex schema commerce | Print the canonical commerce.json v2 schema and examples offline. |
apex schema qa | Print a compact QA summary with availability, common flows and exit codes (7 unverifiable, 8 stale, 9 pending). Use --full for the complete shared contract or name a verb, such as apex schema qa capture or apex schema qa goals check, for matching entries and schemas. Tools report observations; only a signed-in person approves. |
apex schema targeting | Print targeting.json and segment create/update shapes from the server validators, plus the targeting filesystem entry. |
apex skills | Print or install Apex CLI agent skill files. |
apex org | Manage the organization bound to the user credential (apex orgs is an alias). |
apex org get | Get organization details. |
apex org update | Update organization settings. |
apex org members | List organization members. |
apex org invite | Invite an organization member; the default shop role is editor (workspace defaults are internal roles). |
apex org revoke-invite | Revoke an organization invitation. |
apex org set-role | Change an organization member role. |
apex org suspend-member | Suspend an organization member immediately; accepts --reason and requires confirmation unless --force is passed. |
apex org reinstate-member | Reinstate a suspended organization member; requires confirmation unless --force is passed. |
apex org remove-member | Remove an organization member after confirmation. |
apex team | Manage shop-scoped team membership (apex teams is an alias). |
apex team members | List members for --shop or the selected shop. |
apex team invite | Invite a member to --shop or the selected shop as editor or client_viewer (Viewer). --design-approver also lets them sign off designs once they accept (a Viewer with it is a Client approver); it needs store owner or admin rights. |
apex team revoke-invite | Revoke a shop invitation. |
apex team set-role | Change a shop member role to editor or client_viewer (Viewer). |
apex team remove | Remove a shop member after confirmation. |
apex notifications | Manage notification settings. |
apex notifications ready | Configure Ready to launch email recipients and the existing Slack event switch. |
apex notifications ready get | Read email and Slack settings for --shop or the selected shop. |
apex notifications ready email | Choose current shop members to receive ready emails. |
apex notifications ready email set | Replace recipients using --recipients a@example.com,b@example.com. |
apex notifications ready email add | Add current shop members by email. |
apex notifications ready email remove | Remove current shop members by email. |
apex notifications ready email off | Clear the email recipient list. |
apex notifications ready slack | Select the ready event on an existing Slack destination. |
apex notifications ready slack on | Enable the ready event; preserve other events and the destination pause state. |
apex notifications ready slack off | Disable only the ready event. |
apex upgrade | Install the latest Apex CLI (--dry-run prints the command). |
apex docs | Offline reference docs shipped with the CLI. |
apex docs sdk | List SDK topics or print a page with apex docs sdk <topic>. |
Survey body example
Save this body as survey.json, then use apex surveys create --file survey.json
or apex surveys update <id> --file survey.json. Both commands also accept the
body as inline JSON, @survey.json, or a positional file path. Providing a
positional body together with --file is an error.
{
"name": "Product feedback",
"questions": [{
"type": "single_choice",
"prompt": "What would help you decide?",
"options": [{"label": "More details"}, {"label": "Reviews"}, {"label": "Delivery info"}]
}],
"targeting": {"url": [{"type": "simple", "pattern": "/products/", "matchType": "contains"}]},
"sampling_rate": 0.5,
"frequency_cap": "once_per_visitor",
"card_style": "quiet",
"answer_goal": 100
}On create, name is required. Server defaults: questions: [] (each question's
required: true), targeting: null (all pages/visitors), sampling_rate: 1,
frequency_cap: "once_per_visitor", card_style: "quiet", answer_goal: null,
environment_key: "production", placement: "sdk_page", active_from: null,
and active_to: null. Update accepts a partial body and keeps omitted fields
unchanged. Run apex surveys create --help or apex surveys update --help for
field limits and supported values.
Platform administrator commands
These commands require a platform user API key and are intentionally excluded from the public command index.
Support access grants require a signed-in Apex platform admin with a verified second factor through the dashboard session endpoint.
| Command | Purpose |
|---|---|
apex admin support-access list --shop <uuid> | List valid support seats with grantee, reason, expiry and last use. |
apex admin support-access revoke --shop <uuid> [--seat <uuid>] | Revoke a seat; without --seat, finds your own active seat. Use --force in non-TTY mode. |
apex admin shops archive <shopId> | Archive a shop and disable Apex delivery; use --force in non-interactive environments. |
apex admin shops restore <shopId> | Restore an archived shop while leaving its runtime kill switch unchanged. |
apex admin shops settings list --shop <uuid-or-domain> | Read every registered per-shop setting, value, override and group with a platform user API key. |
apex admin shops settings get --shop <uuid-or-domain> --key <key> | Read one setting; unknown keys list the available registry keys. |
apex admin shops settings set --shop <uuid-or-domain> --key <key> --value <value> | Resolve and pin the shop, then make an audited write. Booleans accept on/off/true/false; numbers must be finite; null clears nullable settings. Sensitive writes require --confirm; optional --reason and --expected-version preserve audit context and concurrency. |
Analytics reads
apex analytics requires a secret API key with analytics:read (or analytics:*). Publishable keys cannot access shop analytics. Windowed commands accept --days; pages also accepts --limit. All commands support the standard --json envelope.
Related pages
- Install and authenticate the Apex CLI
- Experiment lifecycle commands
- Agent tools: SOS, brand, schema, and skills
Project code
apex project-code get --shop example.com --json
apex project-code diff --file project-code.json --shop example.com --json
apex project-code set --file project-code.json --shop example.com --backup previous-code.json --jsonThe input is a partial projectCode object, for example { "css": "body { color: red; }" }.
Supported fields are enabled (boolean) and css, helperJs, and js (strings or null).
Each code field permits at most 20,000 characters. Omitted fields remain unchanged.
Null or blank code clears that field. Unknown fields and empty objects are rejected.
GET returns complete code, shop identity, and an opaque version. DIFF returns effective
before/after values and changed fields without writing. SET creates a new backup file
with complete previous code, identity, capture time, and the exact version before PATCH.
It never replaces an existing backup. Backup failures prevent the write. An effective
no-op returns unchanged, without a PATCH or backup file.
The backed-up version becomes expectedVersion unchanged. A conflict returns exit 5,
keeps the backup, and does not retry. Read the latest state and preview it before a new
attempt with a new backup path. Authentication uses exit 2; invalid input uses exit 3.
A successful write returns saved, its diff, backup path, current version, writtenVersion,
and precompile result. A failed precompile is a saved-write warning. All warnings remain
in JSON and are also written to stderr. User keys resolve domains or pin UUID context;
shop keys must match the requested identity before any backup or write.
Shopware ownership proof
Run apex shops shopware prebind <id> --shop-url <url> to pre-bind a storefront. Use --environment <key> to select an environment other than production. The CLI displays each new proof once, with the exact file content and the alternative DNS TXT record. With --json, the API body is available in the CLI envelope's data field.
Publish either proof and call POST /api/v1/shops/{id}/shopware/prebind/verify. Include environmentKey in the request body for a non-production environment. If you lost a live proof for an unverified binding, run pre-bind again with --reissue-proof. The new proof invalidates the earlier one.
Order journey diagnostics
apex analytics order-journey --platform shopware --order-id <id> --environment production --from <iso> --to <iso> requires a secret or authorized user key with analytics:read. Use --order-number instead of --order-id, never both. The interval is at most 31 days. --include-qa includes QA in eligibility; bots remain excluded.
--json retains the sanitized report, every represented assignment, source availability, coverage and the integration verdict. Exit 0 means the diagnostic was fetched, even when its verdict is fail or inconclusive. Eligibility means only eligible_for_attributed_goal_read, with basis attributed_goal_counts. Final statistical contribution is not_evaluated. Unknown consent, freshness, missing evidence and failed reads never mean zero or healthy. No proof file is saved.
Order journey diagnostics report current, stale, or unknown freshness for each retained receipt and assignment. Present attributed-goal reads identify their evaluated snapshot; they do not establish historical contribution or repair missing producer evidence.
Error recovery and update notices
JSON errors keep the numeric error.code exit code and add error.reason,
error.next_steps (an array of { command, why }), and optional error.request_id.
The request ID comes from x-request-id, falling back to x-vercel-id (the Apex app) and then cf-ray; include it
when reporting an API failure. API-provided reason codes are preserved verbatim.
Otherwise reasons are auth_required, auth_forbidden, shop_context_required, shop_context_mismatch, install_check_failed,
validation_failed, feature_disabled, confirmation_required, conflict, not_found,
rate_limited, network_timeout, network_connect_timeout, network_dns,
network_refused, network_reset, network_tls, network_unknown,
local_file_error, or internal_error.
Inspect next_steps for login, key permissions, shop selection, network settings,
folder validation, disabled-feature contacts, request-field issues, or rate-limit recovery.
Body validation failures carry per-field issues in error.details.issues; disabled
features name their shop setting. Steps are suggestions, never automatic
approval to retry a write. Confirmation errors retain error.details.retry.
Human output prints recovery steps as Next: lines on stderr and request IDs
on the error line. Trigger commands now follow the same exit codes as every other
command: authentication failures exit 2 (previously 4), invalid local input exits
3 (previously 2), and other API failures follow their HTTP status (validation
3, conflict 5, anything else 1). The TRIGGERS_AUTH, TRIGGERS_CONFIG_ABSENT and TRIGGERS_NO_DATA
verdict prefixes are unchanged, so scripts can key on them instead of exit codes.
Every JSON envelope may carry update and warnings. The update object includes
current, latest, optional minimum, required, breaking, command, and
notes_url; update warnings use { code, message, required }, with required: false
for cli_update_available and required: true for cli_upgrade_required. The exact install command is
npm install -g @drip-apex/apex-cli@latest, and apex upgrade runs it (--dry-run
only prints it). Set APEX_NPM_BIN to choose the npm binary.
The npm latest version is cached for 24 hours (failed lookups for one hour). Server
latest/minimum policy is cached for seven days, so offline commands still enforce a
known floor. APEX_NO_UPDATE_CHECK=1 disables the npm lookup and optional update
notice, but never hides a required server-floor upgrade.
Tracking verification limits
apex tracking verify reads at most 200 of the newest events from a window of at most 7 days. When the limit is reached, truncated is true and totals describe that sample only. The response includes the exact from, to, minutes, and limit window.
Commerce catalog
apex commerce catalog search [query] [--cursor <cursor>] [--limit <1-10>]apex commerce catalog get <handle> [--cursor <cursor>]apex commerce catalog get --product-id <id> [--cursor <cursor>]
Use --json for the complete API envelope. Human output lists variant GID, title, SKU, price, cost (unknown when absent), and price-test exclusion.
Commerce results output
Human-readable experiment results show a Profit per visitor (CM1) section
for commerce tests and checkout-owned tests with attributed orders. Null money prints as -; degraded reads
print their reason and never imply measured zeroes. JSON output preserves the
API's commerce_results field unchanged, including pending_days, plane,
decision_grade, and confidence_visible.
Checkout-owned tests measure orders from visitors who saw the checkout message and receive the supplementary CM1 section when they have attributed orders. Other non-commerce tests return commerce_results: null. An unavailable supplementary section on a checkout-owned test does not mark the analytics as degraded.
Import past test results
apex results import --file <path> uploads one or more CSV or JSON files, inspects their columns, and prints a deterministic preview before confirmation. Use --dry-run to stop after preview and --yes for non-interactive confirmation. --json preserves full learning text and returns the preview envelope for dry runs or merged { imported, skipped, test_results } totals after import.
Read past test results
apex results list [--source import|native|all] [--limit <n>] [--all] [--json] lists past results for the selected shop (default source all, page size 50, maximum 200). Use --all to follow every page. The table shows legacy ID (or UUID), title, outcome, metric, lift, sample size, dates, and source. Empty lists print No test results.
apex results get <legacy-id-or-id> [--json] opens a result by legacy ID, test key, or UUID, including its full learning, confidence, dates, page, and device. Missing results exit with code 1 through the existing API failure path. Both commands use shop or user keys with experiments:read and verify each row belongs to the selected shop. Imports show their source name and original date range, falling back to import time; native results show source apex and creation time.
apex results delete <legacy-id-or-id> [--yes] [--json] permanently removes one imported result with experiments:write. It first reads and previews the title, outcome, dates, source, and legacy ID. Native results are refused locally (exit 3). Confirm the prompt or pass --yes; non-TTY callers without --yes receive exit 4 with the exact rerun hint. Removed results cannot be restored in Apex; the full record remains in the audit log. JSON output wraps the API { data } response and verifies the echoed shop.
JSON uses the standard CLI envelope: its data contains { data, pagination } for lists (merged rows and final pagination with --all) or { data: result } for a single result. Invalid --source or --limit exits 3 before an HTTP request.
Asset delivery URLs
Run apex assets upload ./images or apex assets upload hero.png logo.svg to map each basename to its permanent delivery URL. A directory includes only its immediate regular PNG, JPG/JPEG, WebP and SVG files. Pass 1 to 12 images of at most 10 MB each with unique basenames. With --json or piped stdout, the standard CLI envelope contains the map in data. An interactive terminal prints the map directly by default. An empty batch exits with validation code 3. Failures exit nonzero.
apex assets upload <file> returns delivery_url; embed that permanent URL in variation code. The public_url is a signed read URL for the API caller and expires after 300 seconds. Never embed it. Delivery is anonymous once the referencing experiment or snippet is published, and resolves through the owning shop's dashboard session or a QA preview before that. Only the absolute https form is recognized as an owned reference; protocol-relative or http forms are not granted at publication.
apex assets get <asset-id> --experiment <experiment-id> --json adds
referenced_in_authored_code: whether that experiment's stored CSS, JavaScript,
reset JavaScript, active variation mutations (including HTML), or URL blocks
contain an absolute https reference to this asset. The experiment may be selected
by ID, public ID or test key in the same shop. Without --experiment, the field
is omitted. --experiment reads that experiment's authored code; publication may
minify it or strip comments.
See Commerce prices for CSV export, import, and revision semantics.
Store URL inventory
apex pages urls --shop <id> --out pages.jsonl --jsonThis read-only command fetches the public storefront from the CLI machine and
reads catalogue rows with a user key for the shop or the shop's own key. It does not open a browser.
apex pages list and apex pages ls still list targeting resources.
| JSONL row | Contents |
|---|---|
url | URL (including null for a missing catalogue URL; catalogue rows are always kind product), kind, market, source, and available last modification time, sitemap provenance, catalogue status and external ID. A URL may have one row in each source; sitemap duplicates emit once. |
error | Request URL, source, reason, attempt count, and available HTTP status, Retry-After or API error code. final_url names where a redirected request ended, for example a store password page. |
Error row reason is one of: rate_limited, forbidden, not_found, http_error, timeout, network_error, malformed_sitemap, malformed_json, off_store_host, api_error. A catalogue API refusal also carries the API code.
| summary | Always last: complete or truncated, reasons, the truncated sources, row and unique URL counts, counts by source/kind/market, source freshness and request counts, and the selected limits. |
The defaults read all sitemaps, all catalogue cursor pages, and (on Shopify)
products.json until an empty page, with no URL cap. Use
--sources sitemap,products,catalog to choose sources explicitly; naming products
also enables it on other platforms. --origin https://store.example overrides the
storefront origin. --concurrency defaults to 4 (maximum 16), --timeout is seconds
per request (default 30), and --retries defaults to 0 (maximum 5). Retries keep the
same request identity, wait for Retry-After (up to 60 seconds) or exponential backoff,
and apply only to 429, server errors, timeouts and network failures. A 403 or 429 is
recorded without any identity or access workaround.
--limit N stops after N URL rows and records limit_reached. Errors record
errors; both reasons can appear. Truncated inventories still exit 0 when a summary
was produced. Authentication and local validation keep the existing nonzero exit
codes; an existing output file is refused with exit 3 and output_exists before
any API or storefront call. File mode writes <out>.partial and renames it only
after the final summary, including on truncated runs. With --json, stdout is the
normal envelope with the summary and output path. With --out -, stdout is only
JSONL, ending in the summary.