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.

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 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 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 schemaPrint the current Apex CLI command and flag schema.
apex skillsPrint or install Apex CLI agent skill files.