@revturbine/cli 0.19.5 → 0.21.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/README.md +77 -5
- package/dist/cli.js +17437 -8889
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ Requires Node ≥ 22.13. Source builds use the npm 11.18.0 version declared in
|
|
|
37
37
|
## Quick start
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
revturbine signup # create an
|
|
40
|
+
revturbine signup # create an operator login (email + password + emailed code)
|
|
41
41
|
revturbine login # authorize this machine (device flow)
|
|
42
42
|
revturbine download --live --save ./revturbine.playbook.json
|
|
43
43
|
# …edit ./revturbine.playbook.json…
|
|
@@ -48,6 +48,48 @@ revturbine launch ./revturbine.playbook.json # upload, gate, and g
|
|
|
48
48
|
|
|
49
49
|
`revturbine <command> --help` documents every flag.
|
|
50
50
|
|
|
51
|
+
## Customer application provisioning with Clerk Billing
|
|
52
|
+
|
|
53
|
+
`signup` creates a RevTurbine operator login. `customer-accounts` and
|
|
54
|
+
`customer-users` create records for **your application's customers**. They never
|
|
55
|
+
create operator logins. A customer account can represent a Clerk organization or
|
|
56
|
+
a personal Clerk user; a customer user represents an application user.
|
|
57
|
+
|
|
58
|
+
The `customer-accounts`, `customer-users`, `plans`, and `plan-variations` groups
|
|
59
|
+
each provide `create <file>`, `list`, `get <key>`, `link <key> <file>`, and
|
|
60
|
+
`links <key>`. Use `--json` for automation and `list --all` to follow all pages
|
|
61
|
+
(`--page`, `--per-page`, maximum 100). Every command accepts `--url` and
|
|
62
|
+
`--tenant-id` using the existing operator credentials.
|
|
63
|
+
|
|
64
|
+
Catalog commands require `--environment <handle>` (for example `production`, never the environment database row ID) and exactly one of `--draft`,
|
|
65
|
+
`--live`, or `--release <id>`. Creates accept only `--draft` and do not launch.
|
|
66
|
+
Links additionally require `--provider-instance <Clerk-instance-id>`; identity
|
|
67
|
+
links have no Playbook selector. Keys are your application IDs or stable catalog
|
|
68
|
+
handles, never version-row IDs. Catalog reads use the selected environment's
|
|
69
|
+
draft or frozen release and return 404 if that version is absent.
|
|
70
|
+
Operators can disable this endpoint family with the `customer-provisioning`
|
|
71
|
+
feature flag in the admin UI; disabled endpoints return 503. It defaults to enabled.
|
|
72
|
+
|
|
73
|
+
Clerk Billing manages its plans, prices, and subscriptions; these are not Stripe
|
|
74
|
+
Billing catalog records. Use Clerk's CLI/API or dashboard to provision those
|
|
75
|
+
entities, then record their IDs in RevTurbine. Stripe CLI is optional for payment
|
|
76
|
+
inspection. RevTurbine stores manually authored price snapshots with
|
|
77
|
+
`price_source: "clerk"`, monthly/annual billing, and no `stripe_price_id`.
|
|
78
|
+
See [Clerk Billing overview](https://clerk.com/docs/guides/billing/overview),
|
|
79
|
+
[Clerk CLI](https://clerk.com/docs/cli), and the
|
|
80
|
+
[PowerShell walkthrough](docs/clerk-customer-provisioning.md).
|
|
81
|
+
|
|
82
|
+
Links are scoped to tenant, environment, and Clerk instance and are always
|
|
83
|
+
`unverified`. Recording an ID does not contact Clerk, create a subscription,
|
|
84
|
+
prove payment, or grant entitlements. Exact account/user/link retries return
|
|
85
|
+
the existing record; conflicting associations return 409. Existing user context
|
|
86
|
+
fields are preserved. Rebinding and unlinking are not supported.
|
|
87
|
+
|
|
88
|
+
Catalog creates can mint handles. If a response is lost, the CLI does not retry:
|
|
89
|
+
list the selected draft and reconcile the returned handles before another
|
|
90
|
+
create. Links survive catalog version changes, but reads revalidate the selected
|
|
91
|
+
target: missing/discarded targets return 404 and incompatible prices return 409.
|
|
92
|
+
|
|
51
93
|
## Version selectors
|
|
52
94
|
|
|
53
95
|
Commands that read a config name the version explicitly — there is no default:
|
|
@@ -64,14 +106,14 @@ Commands that read a config name the version explicitly — there is no default:
|
|
|
64
106
|
| Command | What it does |
|
|
65
107
|
|---|---|
|
|
66
108
|
| `init` (alias `create`) | Set up RevTurbine while preserving existing integrations: install missing packages, pin the CLI exactly, create a starter for a fresh integration, and install skills for one agent. Use `--scaffold` to create a missing root starter explicitly; existing files are never overwritten. `--agent claude-code\|cursor\|codex` overrides environment detection; an unknown agent skips skills and prints the selection command. Also supports `--dir`, `--dry-run`, `--no-skills`, `--json`. With no `package.json`, offers a new project (`--yes` for noninteractive creation). Runs the invoked CLI even inside a repo that pins a different one. |
|
|
67
|
-
| `signup` | Create
|
|
68
|
-
| `login` / `logout` | Device-flow auth; tokens stored at `~/.revturbine/credentials.json` (mode 0600). |
|
|
69
|
-
| `whoami` | Authentication state first: not logged in, credentials accepted, credentials rejected for the selected instance/tenant, or verification unavailable. Then shows instance, tenant, and credentials source; configured tenant information alone does not prove login. Verification and subsequent telemetry each time out after 3 seconds. Status reports exit 0. `--json` retains its seven fields: `instance`, `tenant
|
|
109
|
+
| `signup` | Create a RevTurbine operator login headlessly: email + password, then an emailed one-time code to verify, then a token is stored. |
|
|
110
|
+
| `login` / `logout` | Device-flow auth; tokens stored at `~/.revturbine/credentials.json` (mode 0600). For CI, skip login and set `REVTURBINE_TOKEN` (see [CI / non-interactive use](#ci--non-interactive-use)). |
|
|
111
|
+
| `whoami` | Authentication state first: not logged in, credentials accepted, credentials rejected for the selected instance/tenant, or verification unavailable. Then shows instance, tenant, and credentials source; configured tenant information alone does not prove login. Verification and subsequent telemetry each time out after 3 seconds. Status reports exit 0. `--json` retains its seven fields: `instance`, `tenant` (`null` when `REVTURBINE_TOKEN` is set without `-t`: the server resolves the token user's own tenant, and `tenant_source` names the variable), `tenant_source`, `credentials_dir`, `credentials_source`, `token_present` (boolean), and `token_valid` (`true` for 2xx, `false` for 401/403, `null` when absent or unverified, including redirects, other HTTP errors, timeouts and network failures). |
|
|
70
112
|
| `schema` | Emit the bundled `RevTurbineConfig` JSON schema (for agents to author against). |
|
|
71
113
|
| `docs` | Print the canonical documentation URL. |
|
|
72
114
|
| `download` | Fetch a config version (`--live` / `--draft` / `--release <id>`); `--save`. |
|
|
73
115
|
| `validate` | Offline schema validation of a `<file>`, or the full server catalog against the open draft (`--draft`). |
|
|
74
|
-
| `diff` | Compare any two versions (dry-run, no writes). A file vs `--draft`/`--live`/`--release` previews the launch — the server side is the base, so `+`/`-` read as created/pruned on launch. |
|
|
116
|
+
| `diff` | Compare any two versions (dry-run, no writes). A file vs `--draft`/`--live`/`--release` previews the launch — the server side is the base, so `+`/`-` read as created/pruned on launch. `--exit-code` makes the status machine-readable: `0` no differences, `1` differences, anything else an error (an unexpected internal error exits `70` so `1` always means "differences"). Every top-level Playbook collection is compared. |
|
|
75
117
|
| `show <kind>` | Summary tables: `plans` · `entitlements` · `segments` · `placements` · `trials` for any version. |
|
|
76
118
|
| `upload` | Stage a Playbook file as the open draft. |
|
|
77
119
|
| `launch` | Take a config live: validate (launch gate) → submit → approve → deploy. `launch <file>` or `launch --draft`. |
|
|
@@ -145,6 +187,33 @@ Public ingest tokens are intentionally embeddable but remain tenant-bound,
|
|
|
145
187
|
origin-restricted, and optionally IP-restricted. They cannot mint other tokens
|
|
146
188
|
or access private control-plane APIs.
|
|
147
189
|
|
|
190
|
+
## CI / non-interactive use
|
|
191
|
+
|
|
192
|
+
`login` and `signup` are interactive. In CI, supply the token through the
|
|
193
|
+
environment instead:
|
|
194
|
+
|
|
195
|
+
| Variable | Meaning |
|
|
196
|
+
|---|---|
|
|
197
|
+
| `REVTURBINE_TOKEN` | Bearer token for every request. Wins over any stored credential (which is then ignored). With it set and no `-t/--tenant-id`, **no `x-tenant-id` header is sent** and the server resolves the token user's own tenant; `-t` still sends one (it must be that tenant). |
|
|
198
|
+
| `REVTURBINE_HTTP_HEADERS` | A JSON object of extra headers added to every request to the RevTurbine instance, e.g. `{"x-vercel-protection-bypass":"…"}` to reach a protection-gated preview/staging deployment. It may not set `Authorization`, `x-tenant-id`, `x-rt-tenant-id` or `Content-Type`. A malformed value exits `2`. |
|
|
199
|
+
|
|
200
|
+
Neither the token nor any header value is ever logged, echoed in an error, or
|
|
201
|
+
sent as telemetry: diagnostics name only the variable and the header names, and
|
|
202
|
+
any stderr line that would contain a registered secret shows `<redacted>`.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
export REVTURBINE_TOKEN="$RT_TOKEN"
|
|
206
|
+
export REVTURBINE_HTTP_HEADERS="{\"x-vercel-protection-bypass\":\"$VERCEL_BYPASS\"}"
|
|
207
|
+
URL=https://staging.example.com/app
|
|
208
|
+
if revturbine diff ./seed.playbook.json --live --url "$URL" --exit-code; then
|
|
209
|
+
echo "no changes: skip launch"
|
|
210
|
+
else
|
|
211
|
+
status=$?
|
|
212
|
+
[ "$status" -eq 1 ] || exit "$status" # 2-7 / 70 = a real error
|
|
213
|
+
revturbine launch ./seed.playbook.json --url "$URL"
|
|
214
|
+
fi
|
|
215
|
+
```
|
|
216
|
+
|
|
148
217
|
## Exit-code classes
|
|
149
218
|
|
|
150
219
|
```
|
|
@@ -158,6 +227,9 @@ or access private control-plane APIs.
|
|
|
158
227
|
7 server error
|
|
159
228
|
```
|
|
160
229
|
|
|
230
|
+
`diff --exit-code` is the one exception: `1` means "differences" there, and an
|
|
231
|
+
unexpected internal error exits `70` instead.
|
|
232
|
+
|
|
161
233
|
## Schema validation
|
|
162
234
|
|
|
163
235
|
Validation is **mandatory** and runs fully offline against a vendored,
|