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.

User-scoped login

Use apex login --user to approve an expiring, organization-bound user key in the browser. Shop and user credentials can coexist. apex whoami verifies and shows both credentials, including the user key's organization and live role. 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 with Apex.
apex logoutRemove stored credentials.
apex whoamiShow current authentication status.
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 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 startStart an 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 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 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 for the current shop.
apex goalsManage conversion and revenue goals.
apex goals listList goals.
apex goals createCreate a goal.
apex goals updateUpdate a goal.
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 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 web-vitalsShow web vitals analytics.
apex analytics realtimeShow realtime analytics.
apex analytics entry-exitShow entry and exit page analytics.
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 sosCreate and inspect Apex SOS tickets.
apex sos createCreate an Apex SOS ticket.
apex sos mineList SOS tickets created by this API key.
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 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 schemaPrint the current Apex CLI command and flag schema.
apex skillsPrint or install Apex CLI agent skill files.
apex adminOperate allowlisted platform controls.
apex admin settingsShow platform operator settings.
apex admin settings setSet platform kill switches; requires the explicit --confirm flag.
apex admin quarantineList tracking quarantine events.
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.