Developer

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.

Global behavior

  • apex is the canonical binary. drip is a compatibility alias.
  • --json is available globally and on every registered command.
  • Piped stdout automatically uses JSON mode even when --json is omitted.
  • Human progress, prompts, diagnostics, and update notices go to stderr.
  • Do not parse human tables. Use apex schema --json to discover commands and flags.

JSON output uses this stable top-level envelope:

json
{
  "ok": true,
  "version": "0.1.1",
  "command": "apex experiments list",
  "data": {}
}

Errors use the same envelope shape with ok: false and an error object:

json
{
  "ok": false,
  "version": "0.1.1",
  "command": "apex experiments apply",
  "error": {
    "message": "Applying these changes invalidates QA approval and requires confirmation.",
    "code": 4,
    "details": {
      "retry": "apex experiments apply ./my-test --force"
    }
  }
}

Headless and agent usage

bash
DRIP_API_KEY=apx_your_key_here apex schema --json
apex experiments plan ./my-test --json
apex experiments apply ./my-test --json

In headless mode:

  • Do not wait for prompts.
  • Prefer explicit --json.
  • If a command returns exit code 4, inspect error.details.retry and 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.

Exit codes

CodeMeaningTypical recovery
0Success.Continue.
1General failure.Read error.message and command-specific details.
2Auth or permission failure.Run apex login, set DRIP_API_KEY, or check API-key permissions.
3Validation failure.Fix arguments, JSON, config, or unsupported file content.
4Confirmation required.Inspect error.details.retry; rerun with the named flag only when intended.
5Conflict, including stale filesystem state where detected.Pull fresh state, reapply edits, and plan again.

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>]; override per invocation with --org/--shop or the DRIP_ORG/DRIP_SHOP environment variables. 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.

CommandPurpose
apex loginAuthenticate your account and pick an org/shop context.
apex logoutRemove stored credentials.
apex whoamiShow your identity, credential, and available org/shop context.
apex useSet the current Apex organization and shop context.
apex accountManage your Apex account.
apex account profileShow the current account profile.
apex account profile setUpdate the current account profile.
apex keysManage shop API keys with a user credential.
apex keys listList API-key metadata for a shop.
apex keys createCreate a shop API key and print its secret once.
apex keys revokeRevoke a shop API key.
apex webhooksManage shop webhooks.
apex webhooks listList webhooks.
apex webhooks createCreate a webhook.
apex webhooks updateUpdate a webhook URL, events, or active state.
apex webhooks deleteDelete a webhook.
apex webhooks deliveriesList webhook deliveries including failure and disabled state.
apex webhooks testSend a signed test event to a webhook.
apex simulateSimulate data-layer triggers without emitting events.
apex experimentsManage experiments.
apex experiments listList experiments.
apex experiments getGet experiment details by ID or slug.
apex experiments resultsRead experiment results and timeseries by ID or slug.
apex experiments createCreate a new experiment.
apex experiments pausePause a running experiment.
apex experiments completeComplete or stop an experiment.
apex experiments deleteDelete an experiment.
apex experiments pullPull an experiment as an editable filesystem.
apex experiments planPlan experiment filesystem changes.
apex experiments applyApply experiment filesystem changes to Apex.
apex experiments screenshotsForce-assign every capture, including control, to its variation server-side for deterministic screenshots.
apex experiments qaManage experiment QA runs from the CLI.
apex experiments qa statusShow or create the latest experiment QA run.
apex experiments qa checkUpdate one QA checklist item with status, notes, and evidence.
apex experiments qa notesUpdate QA run notes or acceptance criteria summary.
apex experiments qa approveMark QA done after checklist gates are ready.
apex experiments qa reopenReopen QA and clear scheduled launch state.
apex experiments qa evidenceAttach screenshot jobs or upload typed QA evidence.
apex pushPush experiment definitions from config to the API.
apex previewOpen a QA preview URL for an experiment variation.
apex roadmapWork with approved roadmap ideas and build handoffs.
apex roadmap approvedList approved roadmap ideas ready to build in Apex.
apex roadmap handoffGet the full build brief for an approved roadmap item.
apex harnessDevelop AB Test Harness projects through Apex live QA sessions.
apex harness initCreate apex.harness.json for a harness folder.
apex harness devBuild, upload, preview, and watch a harness folder.
apex harness publishVerify, build, upload, and publish a harness artifact.
apex workspaceCheck out, preview, and publish Apex draft workspace files.
apex workspace checkoutCheck out an Operator workspace for one variation.
apex workspace statusShow changed local workspace files.
apex workspace devUpload one preview version or watch workspace files.
apex workspace publishBuild and publish changed workspace files back to Apex.
apex trackingCreate tracking ingestion manifests and QA handoffs.
apex tracking inspectCreate a local tracking manifest from funnel URLs.
apex tracking planPrint the implementation plan from a tracking manifest.
apex tracking qaPrint the QA checklist for a tracking manifest.
apex tracking verifyVerify live tracking events, filter by --event-type, and preview event properties.
apex goalsManage conversion and revenue goals.
apex goals listList goals.
apex goals createCreate a goal.
apex goals updateUpdate a goal.
apex goals testDry run a goal URL pattern against traffic.
apex goals suggestSuggest goals and funnels from analytics.
apex funnelsManage analytics funnels.
apex funnels listList funnels.
apex funnels createCreate a funnel.
apex funnels updateReplace a funnel's steps.
apex funnels deleteDelete a funnel.
apex funnels runRun funnel analysis.
apex funnels validateValidate funnel steps without writing.
apex environmentsManage runtime environments and domain mappings.
apex environments listList runtime environments and mapped domains.
apex environments set-domainMap a domain to a runtime environment.
apex environments remove-domainRemove a domain mapping.
apex consentManage consent gating.
apex consent getShow consent settings.
apex consent setEnable and configure consent gating.
apex consent offDisable consent gating.
apex triggersManage data-layer triggers and temporary setup capture.
apex triggers getRead the shop's runtime triggers.
apex triggers setReplace the shop's runtime triggers from a JSON file.
apex triggers proposePropose candidate triggers from a discovery report.
apex triggers apply-recipeApply a server-owned trigger recipe.
apex triggers enable-captureEnable temporary setup capture.
apex triggers disable-captureDisable setup capture and clear its expiry.
apex domainsManage install domains.
apex domains listList install domains.
apex domains addAdd install domains.
apex domains removeRemove install domains.
apex domains setReplace install domains.
apex handoverManage cross-domain identity handover.
apex handover getShow cross-domain handover settings.
apex handover setEnable cross-domain identity handover.
apex handover offDisable cross-domain handover.
apex handover qaCheck static link/form handover parameter carriage.
apex analyticsRead shop analytics with a secret API key.
apex analytics statsShow dashboard analytics stats.
apex analytics timeseriesShow analytics timeseries.
apex analytics trafficShow traffic sources.
apex analytics pagesShow page analytics.
apex analytics geoShow geography and device analytics.
apex analytics sessionsShow session analytics.
apex analytics realtimeShow realtime analytics.
apex analytics entry-exitShow entry and exit page analytics.
apex analytics consent-rateEstimate analytics consent acceptance from visitor series.
apex analytics urlsShow storefront URL inventory from pageview analytics.
apex installCheck Apex storefront installation.
apex install checkVerify snippet, served config (including purchase triggers), and recent tracking.
apex flagsManage flags.
apex flags listList flags.
apex flags getGet a flag.
apex flags statusCheck whether a flag publication is live at the edge.
apex flags createCreate a flag.
apex flags updateUpdate a flag.
apex flags activateActivate a flag.
apex flags pausePause a flag.
apex flags archiveArchive a flag.
apex backlogManage backlog.
apex backlog listList backlog.
apex backlog getGet a backlog item.
apex backlog createCreate a backlog item.
apex backlog updateUpdate a backlog item.
apex backlog archiveArchive a backlog item with a decline reason.
apex backlog restoreRestore an archived backlog item.
apex backlog deletePermanently delete a backlog item after confirmation.
apex signalsManage signals.
apex signals listList signals; pass --include-archived to include archived signals.
apex signals getGet a signal.
apex signals createCreate a signal.
apex signals updateUpdate a signal.
apex signals deleteDelete or archive a signal.
apex personalizationsManage personalizations.
apex personalizations listList personalizations.
apex personalizations getGet a personalization.
apex personalizations createCreate a personalization.
apex personalizations updateUpdate a personalization.
apex personalizations activateActivate a personalization.
apex personalizations pausePause a personalization.
apex personalizations archiveArchive a personalization.
apex external-pixelsManage external pixel integrations.
apex external-pixels snippetGenerate an external purchase pixel snippet.
apex assetsManage assets.
apex assets listList assets.
apex assets getGet an asset.
apex assets uploadUpload an asset file.
apex assets deleteDelete an asset.
apex landing-pagesRead landing pages.
apex landing-pages listList landing pages.
apex landing-pages getGet a landing page.
apex pagesManage pages.
apex pages listList pages.
apex pages createCreate a page.
apex pages updateUpdate a page.
apex pages deleteDelete a page.
apex segmentsManage segments.
apex segments listList segments.
apex segments createCreate a segment.
apex segments updateUpdate a segment.
apex segments deleteDelete a segment.
apex exclusion-groupsManage exclusion groups.
apex exclusion-groups listList exclusion groups.
apex exclusion-groups getGet an exclusion group.
apex exclusion-groups createCreate an exclusion group.
apex exclusion-groups updateUpdate an exclusion group.
apex exclusion-groups deleteDelete an exclusion group after confirmation; use --force in non-interactive environments.
apex exclusion-groups replace-membersReplace exclusion group members.
apex brandPrint shop brand context for external agents.
apex targetingTest experiment targeting.
apex targeting testEvaluate experiment URL targeting for a page.
apex audit-logInspect sensitive audit logs.
apex audit-log listList audit logs with entity filters and offset pagination.
apex inboxRead and send inbox messages.
apex inbox listList account or experiment inbox messages.
apex inbox sendSend an account or experiment inbox message.
apex inbox mark-readMark one inbox channel, or all channels, read.
apex shopsManage organization shops.
apex shops listList organization shops.
apex shops getGet a shop.
apex shops createCreate a shop.
apex shops updateUpdate a shop.
apex shops doctorCheck shop configuration and the three-state purchase-capture battery against observed analytics.
apex shops auto-stopRead or update auto-stop defaults.
apex shops testing-defaultsRead or update testing defaults.
apex shops guardianRead or update guardian defaults.
apex shops store-profileRead and review a store profile.
apex shops store-profile getRead the store profile.
apex shops store-profile review-factReview a store-profile fact.
apex shops store-profile review-findingReview a semantic finding.
apex shops store-profile start-learning-runStart a store-profile learning run.
apex shops shopwareManage Shopware bindings.
apex shops shopware prebindBind a Shopware store URL before installation.
apex discoverRead observed tracking shapes and optionally mine a public GTM container.
apex schemaPrint the current Apex CLI command and flag schema.
apex skillsPrint or install Apex CLI agent skill files.
apex orgManage the organization bound to the user credential.
apex org getGet organization details.
apex org updateUpdate organization settings.
apex org membersList organization members.
apex org inviteInvite an organization member with organization and default shop roles.
apex org revoke-inviteRevoke an organization invitation.
apex org set-roleChange an organization member role.
apex org remove-memberRemove an organization member after confirmation.
apex teamManage shop-scoped team membership.
apex team membersList members for an explicit shop.
apex team inviteInvite a member to an explicit shop.
apex team revoke-inviteRevoke a shop invitation.
apex team set-roleChange a shop member role.
apex team removeRemove a shop member after confirmation.

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.