@drip-apex/apex-cli 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS.md ADDED
@@ -0,0 +1,48 @@
1
+ # Apex CLI Agent Contract
2
+
3
+ Use `apex` as the canonical command name. `drip` is a compatibility alias.
4
+
5
+ ## Canonical Loop
6
+
7
+ 1. `apex experiments pull <id-or-slug> --dir <folder>`
8
+ 2. Edit only supported files in the pulled folder.
9
+ 3. `apex experiments plan <folder> --json`
10
+ 4. `apex experiments apply <folder> --json`
11
+ 5. `apex experiments qa status <folder> --json`
12
+ 6. Update QA with `apex experiments qa check`, `notes`, and `approve`.
13
+ 7. Publish or launch only through the dashboard approval surface.
14
+
15
+ ## Invariants
16
+
17
+ - Never hand-edit `qa.json` or `launch.json`.
18
+ - Launch is dashboard-only. The API and CLI do not start traffic.
19
+ - Prefer `--json`; piped stdout defaults to JSON automatically.
20
+ - JSON output is a stable contract: top level is `{ ok, version, command, data | error }`.
21
+ - Diagnostics, prompts, progress, and update notices go to stderr.
22
+ - Do not parse human tables. Use `apex schema --json` first if you need flags.
23
+ - Keep command names exact. Do not infer fuzzy suggestions.
24
+
25
+ ## Exit Codes
26
+
27
+ - `0`: success
28
+ - `1`: general failure
29
+ - `2`: auth or permission failure
30
+ - `3`: validation failure
31
+ - `4`: confirmation required; inspect `error.details.retry`
32
+ - `5`: conflict, including stale filesystem state where detected
33
+
34
+ ## Recovery
35
+
36
+ - Missing auth: run `apex login` interactively, or set `DRIP_API_KEY`.
37
+ - Headless login: pass `--api-key` or set `DRIP_API_KEY`; do not wait for prompts.
38
+ - Do not wait for prompts in CI or agent runs. If a command returns exit `4`, rerun with the exact flag named in the JSON error details only after checking the plan or destructive action.
39
+ - Apply invalidates QA: inspect `apex experiments plan`, then rerun apply with `--force` if intended.
40
+ - Stale workspace or filesystem: pull fresh files, reapply your edits, and plan again.
41
+ - Server limit errors: read the JSON error details; Apex includes server-owned limits when available.
42
+
43
+ ## Filesystem Rules
44
+
45
+ - Treat `.apex/` as CLI-owned metadata.
46
+ - Edit experiment files, variation code, metrics, and targeting only through supported paths.
47
+ - Do not bypass the variation artifact persistence path with direct API writes.
48
+ - Keep generated evidence outside `qa.json`; attach it through QA commands.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Drip Trading GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Apex CLI
2
2
 
3
- Command-line tools for Apex experiments, approved roadmap ideas, and draft workspaces.
3
+ Command-line tools for Apex experiments, draft workspaces, GitOps pushes, QA
4
+ evidence, tracking checks, and agent handoffs.
4
5
 
5
6
  ## Install
6
7
 
@@ -8,45 +9,45 @@ Command-line tools for Apex experiments, approved roadmap ideas, and draft works
8
9
  npm install -g @drip-apex/apex-cli
9
10
  ```
10
11
 
11
- ## Login
12
+ ## Authenticate
12
13
 
13
- Create an Apex API key at:
14
-
15
- ```text
16
- https://app.drip-apex.com/api-keys
14
+ ```bash
15
+ apex login
16
+ apex whoami
17
17
  ```
18
18
 
19
- Then run:
19
+ `apex login` opens the default browser OAuth flow at Apex `/cli/login`. For
20
+ headless environments, use an existing API key:
20
21
 
21
22
  ```bash
22
- apex login
23
+ apex login --api-key apx_your_key_here
24
+ DRIP_API_KEY=apx_your_key_here apex experiments list --json
23
25
  ```
24
26
 
25
- Check auth:
27
+ ## Common usage
26
28
 
27
29
  ```bash
28
- apex whoami
29
30
  apex experiments list
30
- ```
31
+ apex experiments pull <id-or-slug> --dir ./my-test
32
+ apex experiments plan ./my-test --json
33
+ apex experiments apply ./my-test --json
34
+ apex experiments qa status ./my-test --json
31
35
 
32
- ## Approved Roadmap Ideas
36
+ apex workspace checkout <experimentId> --variation <variationId> --dir ./workspace
37
+ apex workspace dev ./workspace --no-open
38
+ apex workspace publish ./workspace
33
39
 
34
- ```bash
35
- apex roadmap approved --unbuilt
36
- apex roadmap handoff <roadmapItemId> --instructions
40
+ apex push --dry-run
41
+ apex schema --json
37
42
  ```
38
43
 
39
- ## Draft Workspace Preview
44
+ Use `apex` as the canonical command name. `drip` is a compatibility alias.
40
45
 
41
- ```bash
42
- apex workspace checkout <experimentId> --variation <variationId> --dir ./my-test
43
- apex workspace dev ./my-test
44
- ```
46
+ ## Full documentation
45
47
 
46
- Publish back to Apex after QA:
48
+ Read the CLI reference on the docs site:
47
49
 
48
- ```bash
49
- apex workspace publish ./my-test
50
- ```
50
+ - https://docs.drip-apex.com/cli/install-auth
51
+ - https://docs.drip-apex.com/cli/commands-output
51
52
 
52
- The preview URL includes a short-lived `drip_harness=apx_hs_...` token. Treat it like a secret.
53
+ Maintainers: see the [CLI release runbook](../../docs/cli-releases.md).