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
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.
- Do not parse human tables. Use
apex schema --jsonto 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 --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.
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. |
Command index
The command names in this index are checked against apex schema --json by the CLI CI lane.
| Command | Purpose |
|---|---|
apex login | Authenticate with Apex. |
apex logout | Remove stored credentials. |
apex whoami | Show current authentication status. |
apex experiments | Manage experiments. |
apex experiments list | List experiments. |
apex experiments get | Get experiment details by ID or slug. |
apex experiments results | Read experiment results and timeseries by ID or slug. |
apex experiments create | Create a new experiment. |
apex experiments start | Start an experiment. |
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 an experiment as an editable filesystem. |
apex experiments plan | Plan experiment filesystem changes. |
apex experiments apply | Apply experiment filesystem changes to Apex. |
apex experiments qa | Manage experiment QA runs from the CLI. |
apex experiments qa status | Show or create the latest experiment QA run. |
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 | Mark QA done after checklist gates are ready. |
apex experiments qa reopen | Reopen QA and clear scheduled launch state. |
apex push | Push experiment definitions from config to the API. |
apex preview | Open a QA preview URL for an experiment variation. |
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 the full build brief for an approved roadmap item. |
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. |
apex workspace publish | Build and publish changed workspace files back to Apex. |
apex tracking | Create tracking ingestion manifests and QA handoffs. |
apex tracking inspect | Create a local tracking manifest from funnel URLs. |
apex tracking plan | Print the implementation plan from a tracking manifest. |
apex tracking qa | Print the QA checklist for a tracking manifest. |
apex tracking verify | Verify live tracking events for the current shop. |
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 brand | Print shop brand context for external agents. |
apex targeting | Test experiment targeting. |
apex targeting test | Evaluate experiment URL targeting for a page. |
apex sos | Create and inspect Apex SOS tickets. |
apex sos create | Create an Apex SOS ticket. |
apex sos mine | List SOS tickets created by this API key. |
apex schema | Print the current Apex CLI command and flag schema. |
apex skills | Print or install Apex CLI agent skill files. |